Deserialization of Untrusted Data Affecting com.alibaba:fastjson package, versions [1.2.68,2.0.0)


Severity

Recommended
0.0
critical
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.41% (34th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Deserialization of Untrusted Data vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-JAVA-COMALIBABA-18296111
  • published24 Jul 2026
  • disclosed23 Jul 2026
  • creditKirill Firsov

Introduced: 23 Jul 2026

NewCVE-2026-16723  (opens in a new tab)
CWE-502  (opens in a new tab)

How to fix?

Upgrade com.alibaba:fastjson to version 2.0.0 or higher.

Overview

com.alibaba:fastjson is a fast JSON parser/generator for Java.

Affected versions of this package are vulnerable to Deserialization of Untrusted Data through the JSON parsing path in JSON.parse, JSON.parseObject(String), and JSON.parseObject(String, Class) when it runs inside a Spring Boot executable fat-jar. An attacker can execute code by supplying crafted JSON that reaches the vulnerable type-resolution logic, including nested payloads in Object or Map fields. The issue affects applications using the stock default configuration, and it can let a remote attacker run arbitrary code in the process that deserializes the JSON.

Notes

  • The vulnerable path is verified only in Spring Boot executable fat-jar deployments started with java -jar; plain classpath launches and WAR-style deployments are outside the documented trigger condition.
  • The issue is present under fastjson’s stock defaults with AutoType and SafeMode both off; enabling SafeMode blocks the vulnerable @type handling before this path is reached.

Workarounds

  • Enable SafeMode by setting -Dfastjson.parser.safeMode=true, calling ParserConfig.getGlobalInstance().setSafeMode(true), or configuring it in fastjson.properties; this blocks @type-based payloads before they reach the vulnerable parsing path.
  • Switch to a noneautotype build such as com.alibaba:fastjson:1.2.83_noneautotype; this removes the vulnerable code path from the deployed artifact.
  • Migrate to fastjson2; this avoids the vulnerable fastjson 1.x parsing behavior in affected deployments.

Details

Serialization is a process of converting an object into a sequence of bytes which can be persisted to a disk or database or can be sent through streams. The reverse process of creating object from sequence of bytes is called deserialization. Serialization is commonly used for communication (sharing objects between multiple hosts) and persistence (store the object state in a file or a database). It is an integral part of popular protocols like Remote Method Invocation (RMI), Java Management Extension (JMX), Java Messaging System (JMS), Action Message Format (AMF), Java Server Faces (JSF) ViewState, etc.

Deserialization of untrusted data (CWE-502) is when the application deserializes untrusted data without sufficiently verifying that the resulting data will be valid, thus allowing the attacker to control the state or the flow of the execution.

References

CVSS Base Scores

version 4.0
version 3.1