CWE一覧に戻る
CWE-566

ユーザー制御のSQL主キーによる認証バイパス

Authorization Bypass Through User-Controlled SQL Primary Key
脆弱性 作成中
JA

この製品は、アクターがアクセスできないはずのレコードを含むデータベース・テーブルを使用するが、そのアクターが制御できる主キーを持つSQL文を実行する。

ユーザーが主キーを任意の値に設定できる場合、そのユーザーはキーを変更して不正なレコードを指すことができる。

データベースのアクセス制御エラーは、以下のような場合に発生する:

EN

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.

When a user can set a primary key to any value, then the user can modify the key to point to unauthorized records.

Database access control errors occur when:

Scope: Confidentiality, Integrity, Access Control / Impact: Read Application Data; Modify Application Data; Bypass Protection Mechanism
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.
Use a parameterized query AND make sure that the accepted values conform to the business rules. Construct your SQL statement accordingly.
MITRE公式ページ — CWE-566