High severityJavaInsecure DeserializationHIGH confidence
Jackson Default Typing
Enabling Jackson polymorphic default typing lets the JSON payload choose which classes to instantiate, exposing gadget-chain deserialization (CWE-502).
Standards mapping
- OWASP Top 10
- A08:2021 - Software and Data Integrity Failures
- OWASP ASVS
- V5.5.3 (L1)
Vulnerable vs. safe
Flagged by this check
mapper.enableDefaultTyping();Passes - the safe pattern
Foo good = mapper.readValue(json, Foo.class);Why it matters & how to fix it
Enabling Jackson polymorphic default typing lets the JSON payload choose which classes to instantiate, exposing gadget-chain deserialization (CWE-502). Do not call enableDefaultTyping/activateDefaultTyping on untrusted input. If polymorphism is required, use @JsonTypeInfo with an explicit allow-list (PolymorphicTypeValidator) of permitted subtypes.
References
Rule ID integsec-java-jackson-default-typing - engine: Opengrep - license: MIT - Copyright (c) IntegSec Inc.
TurboPentest runs this check automatically
Connect a GitHub repo and this check runs on every white-box pentest - AI-validated and reported with proof, from $99 per target.
Start a pentestRelated checks
- JavaScript / TypeScript - Insecure DeserializationNode Serialize Unserialize
- JavaScript / TypeScript - Insecure DeserializationYAML Unsafe Load
- Python - Insecure DeserializationJsonpickle Decode
- Python - Insecure DeserializationPickle Load
- Python - Insecure DeserializationYAML Unsafe Load
- Java - Insecure DeserializationObject Input Stream Readobject