1. CVE archive
  2. Vulnerability types
  3. CWE-566
CWE-566 · #499 most frequent type in the archive

Authorization Bypass Through User-Controlled SQL Primary Key

The product uses a database table that includes records that should not be accessible to an actor, but it executes a SQL statement with a primary key that can be controlled by that actor.

Part of: CWE-639 · Authorization Bypass Through User-Controlled Key

6CVEs of this type in the archive
2critical (CVSS ≥ 9)
1high severity (7–8.9)
Oct 28, 2026latest published

What it is

The product uses a database table that includes records that should not be accessible to an actor, but it executes a SQL statement with a primary key that can be controlled by that actor.

Impact on systems

ScopeImpact
Confidentiality, Integrity, Access Control Read Application Data, Modify Application Data, Bypass Protection Mechanism
When a user can set a primary key to any value, then the user can modify the key to point to unauthorized records.

How to prevent it

Implementation Modify the query to include a clause that performs an authorization check, or otherwise ensure that the check is performed before the query is executed.
Implementation Assume all input is malicious. Use a standard input validation mechanism to validate all input for length, type, syntax, and business rules before accepting the data. Use an accept known good validation strategy.
Implementation Use a parameterized query AND make sure that the accepted values conform to the business rules. Construct your SQL statement accordingly.

Source: MITRE CWE catalog · Official entry on the MITRE website

CWE-566 CVEs published per year

2026: year in progress, updated every hour

Show the data as a table
YearCVE
20141
20253
20262

All CWE-566 CVEs

6 results

Dottor Marc

Is this type of vulnerability in your systems?

An archive tells you what exists; a Vulnerability Assessment tells you what is exposed on your side. Dottor Marc tests your web applications and network with automated and manual checks.