不安全的直接对象引用 不安全的直接对象引用(IDOR)是一种安全漏洞,当应用程序允许用户根据用户提供的输入直接访问或修改对象(如文件、数据库记录或 URL),而没有足够的访问控制时,就会发生这种漏洞。这意味着,如果用户在 URL 或 API 请求中更改参数值(如 ID),他们可能会访问或操作本不应查看或修改的数据。 摘要 工具 方法论 数值参数 常见标识符参数 弱伪随机数生成器 哈希参数 通配符参数 IDOR 技巧 实验 参考文献 工具 PortSwigger/BApp Store > Authz PortSwigger/BApp Store > AuthMatrix PortSwigger/BApp Store > Autorize 方法论 IDOR 代表“不安全的直接对象引用”。
不安全的直接对象引用(IDOR)是一种安全漏洞,当应用程序允许用户根据用户提供的输入直接访问或修改对象(如文件、数据库记录或 URL),而没有足够的访问控制时,就会发生这种漏洞。这意味着,如果用户在 URL 或 API 请求中更改参数值(如 ID),他们可能会访问或操作本不应查看或修改的数据。
IDOR 代表“不安全的直接对象引用”。这是一种安全漏洞类型,当应用程序根据用户提供的输入直接提供对对象的访问权限时就会出现。因此,攻击者可以绕过授权,直接访问系统中的资源,从而可能导致未经授权的信息泄露、修改或删除。
IDOR 示例:
假设有一个 Web 应用程序,允许用户通过单击链接 https://example.com/profile?user_id=123 查看自己的个人资料:
<?php $user_id = $_GET['user_id']; $user_info = get_user_info($user_id); ...
在这里,user_id=123 is a direct reference to a specific user's profile. If the application doesn't properly check that the logged-in user has the right to view the profile associated with user_id=123, an attacker could simply change the user_id 参数可用于查看其他用户的个人资料:
https://example.com/profile?user_id=124

通过递增和递减这些数值来访问敏感信息。
287789, 287790, 287791, ...0x4642d, 0x4642e, 0x4642f, ...1695574808, 1695575098, ...Examples:
Some identifiers can be guessed like names and emails, they might grant you access to customer data.
john, doe, john.doe, ...john.doe@mail.comam9obi5kb2VAbWFpbC5jb20=Examples:
95f6e264-bb00-11ec-8833-00155d01ef005ae9b90a2c144b9def01ec37
Examples:
Sometimes we see websites using hashed values to generate a random user id or token, like sha1(username), md5(email), ...
098f6bcd4621d373cade4e832627b4f6a94a8fe5ccb19ba61c4c0873d391e987982fbbd39f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08Examples:
Send a wildcard (*, %, ., _) instead of an ID, some backend might respond with the data of all the users.
GET /api/users/* HTTP/1.1GET /api/users/% HTTP/1.1GET /api/users/_ HTTP/1.1GET /api/users/. HTTP/1.1POST → PUTXML → JSON{"id":19} → {"id":[19]}user_id=hacker_id&user_id=victim_id免责声明:
本文件由基于人工智能的机器翻译服务翻译而成。尽管我们力求翻译准确,但请注意,自动翻译可能包含错误或不准确之处。应以原始语言版本的文件为准。对于关键信息,建议使用专业的人工翻译。对于因使用本翻译而产生的任何误解或误读,我们概不负责。