Skip to content
RCE Write-up Advanced

Bypass FasterXML Jackson-databind Illegal Type Validator

The blocklist that Jackson-databind uses to stop dangerous classes being deserialised can be bypassed by naming a blocked class as the key type of a HashMap, because the key deserialiser creates the class without running the illegal-type check. An attacker who can supply JSON to an application that enables polymorphic typing could therefore instantiate previously blocked gadget classes and reach outcomes such as writing a file.

Chris Follow

Published on mc0wn.blogspot.com

In 2017, a deserialization vulnerability in FasterXML's jackson-databind library was reported (CVE-2017-7525) resulting in an unsafe deserialization in Java leading to numerous exploit scenarios including RCE. The fix for the vulnerability was to create a blocklist of dangerous java classes.

chris, on mc0wn.blogspot.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the map key deserialiser instantiates the key class directly without calling the SubTypeValidator blocklist check that the value deserialiser uses.

Impact

Previously blocked gadgets that rely on a single-argument constructor could be instantiated again, which in the demonstrated case allowed a file to be created; the text does not claim full remote code execution for this bypass.

What the attacker needed

Application enables polymorphic typing; attacker controls JSON input

The fix

The suggested fix was to run the SubTypeValidator check before the key instance is created, and the text says patches went out in June 2026.

How it was found

  1. Enable default typing on an ObjectMapper so type information in JSON is honoured.
  2. Supply a JSON payload whose type is a HashMap parameterised with a blocked class as the key type.
  3. Observe that the blocked class is instantiated through the key deserialiser without the illegal-type error.
  4. Note that the same class used as the map value is still rejected by SubTypeValidator.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

Jackson-databind is a Java library that turns JSON text into Java objects. Some Java classes are dangerous to create from untrusted input, so the library keeps a list of banned classes and refuses them. The researcher found that when a banned class is used as the key type inside a map, the library builds it through a different code path that never consults the banned list, so the protection is skipped.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

More by Chris

View all

6 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.