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

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CWE-180 (不正确的行为次序:规范化之前验证) — Vulnerability Class 10

10 vulnerabilities classified as CWE-180 (不正确的行为次序:规范化之前验证). AI Chinese analysis included.

CWE-180 represents a critical logic flaw where software validates input data before normalizing or canonicalizing it. This sequencing error allows attackers to bypass security controls by submitting specially crafted inputs that appear valid in their raw form but transform into malicious payloads after canonicalization. For instance, an attacker might use encoded characters that pass initial validation checks but resolve to dangerous sequences, such as SQL injection strings or path traversal sequences, once the system processes them. To mitigate this vulnerability, developers must strictly enforce a canonicalization-first approach. By normalizing input data before applying any validation rules, applications ensure that security checks operate on the final, resolved form of the data. This practice effectively neutralizes evasion techniques that rely on encoding or transformation, ensuring that all potential threats are detected and blocked consistently.

MITRE CWE Description
The product validates input before it is canonicalized, which prevents the product from detecting data that becomes invalid after the canonicalization step. This can be used by an attacker to bypass the validation and launch attacks that expose weaknesses that would otherwise be prevented, such as injection.
Common Consequences (1)
Access ControlBypass Protection Mechanism
Mitigations (1)
ImplementationInputs should be decoded and canonicalized to the application's current internal representation before being validated (CWE-180). Make sure that the application does not decode the same input twice (CWE-174). Such errors could be used to bypass allowlist validation schemes by introducing dangerous inputs after they have been checked.
Examples (1)
The following code attempts to validate a given input path by checking it against an allowlist and then return the canonical path. In this specific case, the path is considered valid if it starts with the string "/safe_dir/".
String path = getInputPath(); if (path.startsWith("/safe_dir/")) { File f = new File(path); return f.getCanonicalPath(); }
Bad · Java
String path = getInputPath(); File f = new File(path); if (f.getCanonicalPath().startsWith("/safe_dir/")) { return f.getCanonicalPath(); }
Good · Java

Vulnerabilities classified as CWE-180 (不正确的行为次序:规范化之前验证) represent 10 CVEs. The CWE taxonomy describes the weakness; review individual CVEs for product-specific impact.