CWE一覧に戻る
CWE-1284

入力における指定数量の不適切な検証

Improper Validation of Specified Quantity in Input
脆弱性 作成中
JA

製品は、(サイズや長さなどの)量を指定することが期待される入力を受け取りますが、その量が必要な特性を持つことを検証しないか、誤って検証します。

指定数量には、サイズ、長さ、頻度、価格、レート、操作回数、時間などが含まれる。コードは、リソースの割り当て、計算の実行、反復の制御などのために、指定された量に依存することがある。

EN

The product receives input that is expected to specify a quantity (such as size or length), but it does not validate or incorrectly validates that the quantity has the required properties.

Specified quantities include size, length, frequency, price, rate, number of operations, time, and others. Code may rely on specified quantities to allocate resources, perform calculations, control iteration, etc.

Scope: Other, Integrity, Availability / Impact: Varies by Context; DoS: Resource Consumption (CPU); Modify Memory; Read Memory
Assume all input is malicious. Use an "accept known good" input validation strategy, i.e., use a list of acceptable inputs that strictly conform to specifications. Reject any input that does not strictly conform to specifications, or transform it into something that does.

When performing input validation, consider all potentially relevant properties, including length, type of input, the full range of acceptable values, missing or extra inputs, syntax, consistency across related fields, and conformance to business rules. As an example of business rule logic, "boat" may be syntactically valid because it only contains alphanumeric characters, but it is not valid if the input is only expected to contain colors such as "red" or "blue."

Do not rely exclusively on looking for malicious or malformed inputs. This is likely to miss at least one undesirable input, especially if the code's environment changes. This can give attackers enough room to bypass the intended validation. However, denylists can be useful for detecting potential attacks or determining which inputs are so malformed that they should be rejected outright.
MITRE公式ページ — CWE-1284