Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CWE-639 (通过用户控制密钥绕过授权机制) — Vulnerability Class 1073

1073 vulnerabilities classified as CWE-639 (通过用户控制密钥绕过授权机制). AI Chinese analysis included.

CWE-639 represents an authorization bypass weakness where systems fail to validate that a user is permitted to access a resource identified by a user-controlled key. Attackers typically exploit this by manipulating identifiers, such as changing a numeric user ID in a URL or API parameter, to retrieve or modify another user’s private data. This insecure direct object reference allows unauthorized access without requiring authentication bypasses. Developers prevent this vulnerability by implementing robust server-side authorization checks that verify the requesting user’s permissions against the requested resource, rather than trusting client-supplied identifiers. Additionally, using indirect references or opaque tokens instead of predictable, sequential keys can mitigate the risk of enumeration and unauthorized access attempts.

MITRE CWE Description
The system's authorization functionality does not prevent one user from gaining access to another user's data or record by modifying the key value identifying the data. 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.
Common Consequences (3)
Access ControlBypass Protection Mechanism
Access control checks for specific user data or functionality can be bypassed.
Access ControlGain Privileges or Assume Identity
Horizontal escalation of privilege is possible (one user can view/modify information of another user).
Access ControlGain Privileges or Assume Identity
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.
Mitigations (3)
Architecture and DesignFor each and every data access, ensure that the user has sufficient privilege to access the record that is being requested.
Architecture and Design, ImplementationMake 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 DesignUse 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.
Examples (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.
... conn = new SqlConnection(_ConnectionString); conn.Open(); int16 id = System.Convert.ToInt16(invoiceID.Text); SqlCommand query = new SqlCommand( "SELECT * FROM invoices WHERE id = @id", conn); query.Parameters.AddWithValue("@id", id); SqlDataReader objReader = objCommand.ExecuteReader(); ...
Bad · C#
CVE IDTitleCVSSSeverityPublished
CVE-2021-36801 Akaunting Authentication Bypass in Company Selection — Akaunting 8.1 High2021-08-04
CVE-2021-24473 User Profile Picture < 2.6.0 - Arbitrary User Picture Change/Deletion via IDOR — User Profile Picture 5.4 -2021-08-02
CVE-2021-32744 Unauthenticated attacker could gain access to currently open files — online 9.8 Critical2021-07-21
CVE-2021-24374 Jetpack < 9.8 - Carousel Module Non-Published Page/Post Attachment Comment Leak — Jetpack – WP Security, Backup, Speed, & Growth 5.3 -2021-06-21
CVE-2021-32654 Attacker can obtain write access to any federated share/public link — security-advisories 8.1 High2021-06-01
CVE-2021-21324 Insecure Direct Object Reference (IDOR) on "Solutions" — glpi 6.8 Medium2021-03-08
CVE-2020-8297 Nextcloud Deck 安全漏洞 — Nextcloud Deck 4.3 -2021-02-23
CVE-2021-21022 Magento Commerce Incorrect permissions Could Lead To Unauthorized Access — Magento Commerce 5.3 -2021-02-11
CVE-2021-21012 Magento Commerce Insecure Direct Object Reference Vulnerability Could Lead To Sensitive Information Disclosure — Magento Commerce 5.3 -2021-01-13
CVE-2020-26068 Cisco Telepresence CE Software and RoomOS Software Unauthorized Token Generation Vulnerability — Cisco TelePresence Endpoint Software (TC/CE) 5.5 Medium2020-11-18
CVE-2020-8235 Nextcloud 安全漏洞 — Nextcloud Deck app 4.3 -2020-10-05
CVE-2020-16240 GE APM Classic 安全漏洞 — GE Digital APM Classic 5.3 -2020-09-23
CVE-2020-8154 Nextcloud Server 安全漏洞 — Nextcloud Server 6.5 -2020-05-12
CVE-2019-15581 GitLab 安全漏洞 — GitLab EE 5.3 -2020-01-28
CVE-2019-5466 GitLab 信息泄露漏洞 — GitLab CE/EE 4.3 -2020-01-28
CVE-2019-15582 GitLab 信息泄露漏洞 — GitLab EE 5.3 -2020-01-28
CVE-2019-5469 GitLab 安全漏洞 — GitLab 6.5 -2019-12-18
CVE-2017-3183 Sage XRT Treasury, version 3, fails to properly restrict database access to authorized users, which may enable any authenticated user to gain full access to privileged database functions — XRT Treasury 8.8 -2018-07-24
CVE-2017-0936 Nextcloud Server 安全漏洞 — Nextcloud Server 6.5 -2018-03-28
CVE-2017-0920 GitLab Community Edition和Enterprise Edition Projects::MergeRequests::CreationsController安全漏洞 — GitLab Community and Enterprise Editions 4.3 -2018-03-22
CVE-2017-0922 Gitlab Enterprise Edition GitLab Projects::BoardsController组件安全漏洞 — GitLab Community and Enterprise Editions 7.5 -2018-03-21
CVE-2017-0882 GitLab 安全漏洞 — GitLab Community Edition and GitLab Enterprise Edition 8.7.0 through 8.15.7, 8.16.0 through 8.16.7, 8.17.0 through 8.17.3 8.3 -2017-03-28
CVE-2012-5571 Openstack keystone: openstack keystone: authorization bypass via improper ec2 token handling — Red Hat OpenStack Platform 13 (Queens) 5.4 Medium2012-12-18

Vulnerabilities classified as CWE-639 (通过用户控制密钥绕过授权机制) represent 1073 CVEs. The CWE taxonomy describes the weakness; review individual CVEs for product-specific impact.