CME-1302
Deserialization Allowlist (Safe Loading)
Description
Restricts deserialization to an explicit allowlist of permitted types, classes, or functions. Prevents attacker-controlled serialized data from instantiating arbitrary objects, invoking dangerous functions, or triggering unintended code paths. Applies to JSON schema validation, YAML safe_load, pickle restrictions, and custom deserialization frameworks.
CVSS Vector Impacts
| Metric | Transition | Rationale |
|---|---|---|
| Attack Complexity (AC) | L → H | Only allowlisted types can be deserialized; attacker must find an exploitable gadget chain using only permitted types, which is fundamentally harder than exploiting unrestricted deserialization |
| Confidentiality (C) | H → L | Arbitrary code execution via gadget chains blocked; attacker cannot exfiltrate data beyond what allowlisted types expose |
| Integrity (I) | H → L | Cannot invoke arbitrary functions or modify state via deserialized objects; modifications limited to intended domain of allowlisted types |
CWE Relationships
Verification
Verify deserialization uses safe loading or allowlist enforcement across all application languages
$ grep -rn 'yaml.safe_load\|SafeLoader\|RestrictedUnpickler\|ObjectInputFilter\|JsonSerializer' <app_source>/
# Expected: safe_load|SafeLoader|RestrictedUnpickler|ObjectInputFilter|JsonSerializer
# Expected: safe_load|SafeLoader|RestrictedUnpickler|ObjectInputFilter|JsonSerializer
Platform: any
$ grep -rn 'yaml.load\|pickle.load\|marshal.load' <app_source>/ | grep -v 'safe_load\|SafeLoader'
# Expected: No output
# Expected: No output
Platform: any
$ grep -rn 'jdk.serialFilter\|ObjectInputFilter\|serialFilter' /etc/java/ /usr/lib/jvm/*/conf/ 2>/dev/null || java -XshowSettings 2>&1 | grep serialFilter
# Expected: serialFilter
# Expected: serialFilter
Platform: linux
$ grep -rn 'TypeNameHandling\.None\|TypeNameHandling\.Auto\|BinaryFormatter' <app_source>/ | grep -v None
# Expected: No output
# Expected: No output
Platform: any