security
security_error
ai_generated
true
java.io.ObjectInputStream: Deserialization of untrusted data
ID: security/deserialization-rce
85%Fix Rate
88%Confidence
3Evidence
2023-01-01First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| any | active | — | — | — |
Root Cause
Deserializing untrusted data (Java ObjectInputStream, Python pickle, YAML) enables RCE.
genericWorkarounds
-
92% success Use safe serialization formats (JSON, protobuf) instead
Replace pickle.loads with json.loads; use Jackson instead of ObjectInputStream
-
95% success Use yaml.safe_load instead of yaml.load
yaml.safe_load(data) blocks arbitrary Python object construction
Dead Ends
Common approaches that don't work:
-
Add a class whitelist to ObjectInputStream
65% fail
Whitelist can be bypassed through gadget chains in allowed classes.
-
Validate serialized data before deserializing
85% fail
Validation requires deserialization first, creating a chicken-and-egg problem.