目标达成 感谢每一位支持者 — 我们达成了 100% 目标!

目标: 1000 元 · 已筹: 1000

100.0%

CWE-566 通过用户控制SQL主密钥绕过授权机制 类漏洞列表 4

CWE-566 通过用户控制SQL主密钥绕过授权机制 类弱点 4 条 CVE 漏洞汇总,含 AI 中文分析。

CWE-566属于授权绕过漏洞,源于程序使用用户可控的SQL主键查询数据库。攻击者通过篡改主键值,强制查询指向未授权记录,从而绕过访问控制逻辑。开发者应避免直接拼接用户输入作为主键,需实施严格的输入验证,确保主键值在预期范围内,并结合应用层权限检查,防止非法数据访问。

MITRE CWE 官方描述
CWE:CWE-566 通过用户控制的 SQL 主键绕过授权(Authorization Bypass Through User-Controlled SQL Primary Key) 英文:产品使用包含不应被某主体(actor)访问的记录的数据库表,但它执行了一条使用该主体可控制的主键的 SQL 语句。 当用户能够将主键设置为任意值时,用户即可修改该主键以指向未授权的记录。当出现以下情况时会发生数据库访问控制错误:数据从不受信任的来源进入程序;该数据用于指定 SQL 查询中主键的值;该不受信任的来源没有权限访问关联表中的所有行。
常见影响 (1)
Confidentiality, Integrity, Access ControlRead Application Data, Modify Application Data, Bypass Protection Mechanism
缓解措施 (2)
ImplementationAssume 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.
ImplementationUse a parameterized query AND make sure that the accepted values conform to the business rules. Construct your SQL statement accordingly.
代码示例 (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 ID标题CVSS风险等级Published
CVE-2025-9953 DATABASE Databank Accreditation Software 安全漏洞 — Databank Accreditation Software 9.8 Critical2026-02-19
CVE-2025-30369 Zulip server 安全漏洞 — zulip 2.7 Low2025-03-31
CVE-2025-30368 Zulip server 安全漏洞 — zulip 2.7 Low2025-03-31
CVE-2024-22261 Harbor SQL注入漏洞 — Harbor 2.7 Low2024-06-10

CWE-566(通过用户控制SQL主密钥绕过授权机制) 是常见的弱点类别,本平台收录该类弱点关联的 4 条 CVE 漏洞。