Retrieval of a user record occurs in the system based on some key value that is under user control. The key would typically identify a user-related record stored in the system and would be used to lookup that record for presentation to the user. It is likely that an attacker would have to be an authenticated user in the system. However, the authorization process would not properly check the data access operation to ensure that the authenticated user performing the operation has sufficient entitlements to perform the requested data access, hence bypassing any other authorization checks present in the system.
For example, attackers can look at places where user specific data is retrieved (e.g. search screens) and determine whether the key for the item being looked up is controllable externally. The key may be a hidden field in the HTML form field, might be passed as a URL parameter or as an unencrypted cookie variable, then in each of these cases it will be possible to tamper with the key value.
One manifestation of this weakness is when a system uses sequential or otherwise easily-guessable session IDs that would allow one user to easily switch to another user's session and read/modify their data.
| Impact | Details |
|---|---|
|
Bypass Protection Mechanism |
Scope: Access Control
Access control checks for specific user data or functionality can be bypassed.
|
|
Gain Privileges or Assume Identity |
Scope: Access Control
Horizontal escalation of privilege is possible (one user can view/modify information of another user).
|
|
Gain Privileges or Assume Identity |
Scope: Access Control
Vertical escalation of privilege is possible if the user-controlled key is actually a flag that indicates administrator status, allowing the attacker to gain administrative access.
|
| Phase(s) | Mitigation |
|---|---|
|
Architecture and Design |
For each and every data access, ensure that the user has sufficient privilege to access the record that is being requested.
|
|
Architecture and Design; Implementation |
Make sure that the key that is used in the lookup of a specific user's record is not controllable externally by the user or that any tampering can be detected.
|
|
Architecture and Design |
Use encryption in order to make it more difficult to guess other legitimate values of the key or associate a digital signature with the key so that the server can verify that there has been no tampering.
|
| Nature | Type | ID | Name |
|---|---|---|---|
| ChildOf | Class Class - a weakness that is described in a very abstract fashion, typically independent of any specific language or technology. More specific than a Pillar Weakness, but more general than a Base Weakness. Class level weaknesses typically describe issues in terms of 1 or 2 of the following dimensions: behavior, property, and resource. | 863 | Incorrect Authorization |
| ParentOf | Variant Variant - a weakness that is linked to a certain type of product, typically involving a specific language or technology. More specific than a Base weakness. Variant level weaknesses typically describe issues in terms of 3 to 5 of the following dimensions: behavior, property, technology, language, and resource. | 566 | Authorization Bypass Through User-Controlled SQL Primary Key |
| Nature | Type | ID | Name |
|---|---|---|---|
| ChildOf | Class Class - a weakness that is described in a very abstract fashion, typically independent of any specific language or technology. More specific than a Pillar Weakness, but more general than a Base Weakness. Class level weaknesses typically describe issues in terms of 1 or 2 of the following dimensions: behavior, property, and resource. | 863 | Incorrect Authorization |
| Nature | Type | ID | Name |
|---|---|---|---|
| MemberOf | Category Category - a CWE entry that contains a set of other entries that share a common characteristic. | 1011 | Authorize Actors |
| Nature | Type | ID | Name |
|---|---|---|---|
| ChildOf | Pillar Pillar - a weakness that is the most abstract type of weakness and represents a theme for all class/base/variant weaknesses related to it. A Pillar is different from a Category as a Pillar is still technically a type of weakness that describes a mistake, while a Category represents a common characteristic used to group related things. | 284 | Improper Access Control |
| Phase | Note |
|---|---|
| Architecture and Design | REALIZATION: This weakness is caused during implementation of an architectural security tactic. |
Class: Not Language-Specific (Undetermined Prevalence)
Example 1
The following code uses a parameterized statement, which escapes metacharacters and prevents SQL injection vulnerabilities, to construct and execute a SQL query that searches for an invoice matching the specified identifier [1]. The identifier is selected from a list of all invoices associated with the current authenticated user.
The problem is that the developer has not considered all of the possible values of id. Although the interface generates a list of invoice identifiers that belong to the current user, an attacker can bypass this interface to request any desired invoice. Because the code in this example does not check to ensure that the user has permission to access the requested invoice, it will display any invoice, even if it does not belong to the current user.
Note: this is a curated list of examples for users to understand the variety of ways in which this weakness can be introduced. It is not a complete list of all CVEs that are related to this CWE entry.
| Reference | Description |
|---|---|
|
An educational application does not appropriately restrict file IDs to a particular user. The attacker can brute-force guess IDs, indicating IDOR.
|
| Method | Details |
|---|---|
|
Automated Static Analysis |
Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)
Effectiveness: High |
| Nature | Type | ID | Name |
|---|---|---|---|
| MemberOf | CategoryCategory - a CWE entry that contains a set of other entries that share a common characteristic. | 715 | OWASP Top Ten 2007 Category A4 - Insecure Direct Object Reference |
| MemberOf | CategoryCategory - a CWE entry that contains a set of other entries that share a common characteristic. | 723 | OWASP Top Ten 2004 Category A2 - Broken Access Control |
| MemberOf | CategoryCategory - a CWE entry that contains a set of other entries that share a common characteristic. | 813 | OWASP Top Ten 2010 Category A4 - Insecure Direct Object References |
| MemberOf | CategoryCategory - a CWE entry that contains a set of other entries that share a common characteristic. | 932 | OWASP Top Ten 2013 Category A4 - Insecure Direct Object References |
| MemberOf | CategoryCategory - a CWE entry that contains a set of other entries that share a common characteristic. | 945 | SFP Secondary Cluster: Insecure Resource Access |
| MemberOf | CategoryCategory - a CWE entry that contains a set of other entries that share a common characteristic. | 1031 | OWASP Top Ten 2017 Category A5 - Broken Access Control |
| MemberOf | CategoryCategory - a CWE entry that contains a set of other entries that share a common characteristic. | 1345 | OWASP Top Ten 2021 Category A01:2021 - Broken Access Control |
| MemberOf | CategoryCategory - a CWE entry that contains a set of other entries that share a common characteristic. | 1396 | Comprehensive Categorization: Access Control |
Rationale
This CWE entry is at the Base level of abstraction, which is a preferred level of abstraction for mapping to the root causes of vulnerabilities.Comments
Carefully read both the name and description to ensure that this mapping is an appropriate fit. Do not try to 'force' a mapping to a lower-level Base/Variant simply to comply with this preferred level of abstraction.| Submissions | |||
|---|---|---|---|
| Submission Date | Submitter | Organization | |
|
2008年01月30日
(CWE Draft 8, 2008年01月30日) |
Evgeny Lebanidze | Cigital | |
| Modifications | |||
| Modification Date | Modifier | Organization | |
|
2024年02月29日
(CWE 4.14, 2024年02月29日) |
CWE Content Team | MITRE | |
| updated Demonstrative_Examples | |||
| 2023年10月26日 | CWE Content Team | MITRE | |
| updated Observed_Examples | |||
| 2023年06月29日 | CWE Content Team | MITRE | |
| updated Mapping_Notes | |||
| 2023年04月27日 | CWE Content Team | MITRE | |
| updated Detection_Factors, Relationships | |||
| 2021年10月28日 | CWE Content Team | MITRE | |
| updated Relationships | |||
| 2021年03月15日 | CWE Content Team | MITRE | |
| updated Alternate_Terms | |||
| 2020年12月10日 | CWE Content Team | MITRE | |
| updated Relationships | |||
| 2020年06月25日 | CWE Content Team | MITRE | |
| updated Alternate_Terms | |||
| 2020年02月24日 | CWE Content Team | MITRE | |
| updated Relationships | |||
| 2019年06月20日 | CWE Content Team | MITRE | |
| updated Relationships | |||
| 2018年03月27日 | CWE Content Team | MITRE | |
| updated Relationships | |||
| 2017年11月08日 | CWE Content Team | MITRE | |
| updated Description, Enabling_Factors_for_Exploitation, Modes_of_Introduction, Relationships | |||
| 2014年07月30日 | CWE Content Team | MITRE | |
| updated Relationships | |||
| 2013年07月17日 | CWE Content Team | MITRE | |
| updated Relationships | |||
| 2013年02月21日 | CWE Content Team | MITRE | |
| updated Alternate_Terms, Common_Consequences | |||
| 2012年05月11日 | CWE Content Team | MITRE | |
| updated Relationships | |||
| 2011年06月01日 | CWE Content Team | MITRE | |
| updated Common_Consequences, Relationships | |||
| 2011年03月29日 | CWE Content Team | MITRE | |
| updated Alternate_Terms, Applicable_Platforms, Description, Name, Potential_Mitigations, Relationships | |||
| 2010年06月21日 | CWE Content Team | MITRE | |
| updated Relationships | |||
| 2009年10月29日 | CWE Content Team | MITRE | |
| updated Common_Consequences | |||
| 2009年05月27日 | CWE Content Team | MITRE | |
| updated Relationships | |||
| 2009年03月10日 | CWE Content Team | MITRE | |
| updated Relationships | |||
| 2008年10月14日 | CWE Content Team | MITRE | |
| updated Description | |||
| 2008年09月08日 | CWE Content Team | MITRE | |
| updated Common_Consequences, Relationships, Type | |||
| Previous Entry Names | |||
| Change Date | Previous Entry Name | ||
| 2011年03月29日 | Access Control Bypass Through User-Controlled Key | ||
Use of the Common Weakness Enumeration (CWE™) and the associated references from this website are subject to the Terms of Use. CWE is sponsored by the U.S. Department of Homeland Security (DHS) Cybersecurity and Infrastructure Security Agency (CISA) and managed by the Homeland Security Systems Engineering and Development Institute (HSSEDI) which is operated by The MITRE Corporation (MITRE). Copyright © 2006–2025, The MITRE Corporation. CWE, CWSS, CWRAF, and the CWE logo are trademarks of The MITRE Corporation.