jackson-databind: Renamed @JsonIgnore'd setters can deserialize via private fields
FasterXML jackson-databind
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| com.fasterxml.jackson.core:jackson-databind Maven |
|
|
| tools.jackson.core:jackson-databind Maven |
|
FasterXML jackson-databind
| Product | Affected | Fixed in |
|---|---|---|
| com.fasterxml.jackson.core:jackson-databind Maven |
|
|
| tools.jackson.core:jackson-databind Maven |
|
3.1.4jackson-databind contains the general-purpose data-binding functionality and tree-model for Jackson Data Processor. From 2.21.0 until 2.21.4 and 3.1.4, POJOPropertiesCollector._renameProperties() allows a property with @JsonProperty("renamed") on the getter and @JsonIgnore on the setter to be renamed rather than dropped. With MapperFeature.INFER_PROPERTY_MUTATORS enabled (default), the private backing field is retained; during deserialization BeanDeserializerFactory.addBeanProps() sees hasField()==true, builds a FieldProperty, and makes the backing field writable. An attacker supplying the renamed JSON key writes the backing field directly, bypassing the @JsonIgnore on the setter. This vulnerability is fixed in 3.1.4.
From the CVE record · GitHub_M
In affected jackson-databind versions, a property with @JsonProperty on its getter and @JsonIgnore on its setter can retain a writable private backing field when MapperFeature.INFER_PROPERTY_MUTATORS is enabled, as it is by default. An attacker who can supply JSON for deserialization can use the renamed key to write that field, bypassing the ignored setter. The input does not specify whether authentication or user interaction is required.
Check applications using Maven com.fasterxml.jackson.core:jackson-databind versions >=2.21.0 <2.21.4 or >=3.0.0 <3.1.4, or tools.jackson.core:jackson-databind versions >=3.0.0 <3.1.4.