Home/ Blog/ Security news/ Article
Blog · Security news

A critical fastjson flaw lets attackers run code on the server with no special configuration (CVE-2026-16723)

CVE-2026-16723 lets attackers run code on Java apps using fastjson 1.2.68 to 1.2.83 in default configuration. Turn on SafeMode or move to fastjson2.

One open server rack door among rows of closed racks, evoking the fastjson flaw.

Java teams spent the last three years believing they had fastjson under control. After the 2022 deserialization bugs, the standard advice was to keep AutoType, the feature that lets a piece of JSON name its own target class, switched off. CVE-2026-16723 ignores that switch. Alibaba, which maintains the library and assigned the identifier, rates it 9.0 and says it fires under fastjson's default settings, with no AutoType turned on and no attacker-supplied gadget class sitting in the application's classpath.

The affected band runs from fastjson 1.2.68 to 1.2.83, the final release line of fastjson 1.x. That range matters. It is exactly the set of versions people upgraded to in order to get the post-2022 hardening, and the newest 1.2.x build is already inside it, so moving up within the 1.x line closes nothing.

What is actually exposed

There is one precondition, and it is common. The target has to be packaged as a Spring Boot fat-jar, the single self-contained .jar you launch with java -jar app.jar. Alibaba's advisory says the finding was reproduced on every current JDK from 8 to 21, and on Spring Boot 2.x, 3.x and 4.x, which covers most Java services shipped in the last decade.

The root cause, per the vendor advisory, is a resource-probing path. While resolving a type, the library reaches for a class name taken from attacker-controlled input and probes for it with getResourceAsStream. That is a different code path from the AutoType blocklist everyone has been guarding, which is why disabling AutoType leaves it open. Naming a fixed target class for the parse does not help either. The researcher who reported it, Kirill Firsov of FearsOff, showed the payload can hide inside Object or Map typed fields that the application expects to be free-form. A public proof-of-concept is circulating, and NSFOCUS CERT reported that it has seen exploitation activity, so treat the window as open now, not hypothetical.

Source: Alibaba fastjson2 security advisory for CVE-2026-16723.
BuildVulnerable to CVE-2026-16723Recommended action
fastjson 1.2.68 to 1.2.83Yes, in default configurationEnable SafeMode now
fastjson 1.2.83_noneautotypeNoDrop-in replacement for 1.x
fastjson2NoTarget for migration

Turn on SafeMode today, then hunt for stray copies

There is no clean version bump inside 1.x that closes this, so pick from three real options, in order of how fast you can apply them.

Enable SafeMode. Setting -Dfastjson.parser.safeMode=true, or the equivalent property or code call, tells fastjson to refuse type-directed deserialization entirely, which removes the class-probing behavior this abuses. It is the fastest lever and the one Alibaba lists first.

Swap in the hardened build. The vendor ships a com.alibaba:fastjson:1.2.83_noneautotype artifact that bakes the same restriction in, useful when you cannot set a JVM flag across a whole fleet.

Migrate to fastjson2. The successor library is not affected. Alibaba says fastjson2 validates types against an allowlist and no longer probes for classes during type resolution, so this class of bug does not apply. It is the longer job, and the one that ends the pattern.

The harder part is knowing where fastjson even runs. It is frequently a transitive dependency pulled in by a framework or an SDK you never chose directly, so grepping your own pom.xml will miss it. Use your software bill of materials or a composition-analysis scan to list every com.alibaba:fastjson at 1.2.x anywhere in the build, including shaded copies tucked inside other jars.

Detection when you cannot patch immediately

This is not a bug you catch with a payload signature, because the malicious JSON looks like ordinary data until the type name is resolved. Watch behavior instead. The remote-class step means a Java service that suddenly makes an outbound connection to a host it has never contacted, right after handling a request, is a strong signal. So is a JVM loading a class from an unexpected source. A managed detection service correlates that kind of process and network telemetry across hosts and maps it to the relevant MITRE ATT&CK techniques, which is how you spot exploitation in the gap before every copy of the library is patched.

The Java deserialization surface keeps paying out

This is the second Java data-binding flaw worth patching this week. We covered a jackson-databind authorization bypass days ago, and Oracle's quarterly update again patched unauthenticated deserialization in Coherence and WebLogic. The through-line is old. Any library that turns untrusted bytes into typed objects is a deserialization target, and blocklist-based fixes keep getting walked around one code path at a time. fastjson2's allowlist design is the honest answer, and CVE-2026-16723 is one more reason to finish that migration rather than bolt another patch onto the 1.x line.

Frequently asked questions

What is CVE-2026-16723?

CVE-2026-16723 is a critical remote code execution flaw in the fastjson Java library, scored 9.0 by Alibaba. It lets an attacker run code on a server that deserializes untrusted JSON with fastjson 1.2.68 through 1.2.83, and it works in the library's default configuration.

Which fastjson versions are affected?

Versions 1.2.68 through 1.2.83, the final release line of fastjson 1.x, are affected. There is no fixed 1.2.x version to move to, so upgrading within that line does not help. fastjson2 is not affected by this flaw.

Does turning off AutoType stop CVE-2026-16723?

No. The flaw uses a resource-probing code path that is separate from the AutoType blocklist, so disabling AutoType leaves it open. Enable SafeMode with -Dfastjson.parser.safeMode=true, switch to the 1.2.83_noneautotype build, or migrate to fastjson2 to close it.

Is CVE-2026-16723 being exploited?

A public proof-of-concept is circulating, and NSFOCUS CERT reported that it has observed exploitation activity as of July 2026. Alibaba assigned the CVE and rates it 9.0. Treat exposed services as an urgent patch-or-mitigate item rather than a low-priority backlog entry.

How do I fix the fastjson RCE?

Enable SafeMode, adopt Alibaba's 1.2.83_noneautotype build, or migrate to fastjson2, which removed the vulnerable behavior. Because fastjson is often a transitive dependency, use a software bill of materials or composition-analysis scan to find every fastjson 1.2.x copy in your builds, including shaded ones.

Is fastjson2 affected by CVE-2026-16723?

No. Alibaba states fastjson2 validates types against an allowlist and no longer probes for classes during type resolution, so this class of bug does not apply. Migrating from fastjson 1.x to fastjson2 is the durable fix, though it is a larger change than enabling SafeMode.

Ready to meet the Guardians?

Deploys fast - agentless for monitoring and cloud, a lightweight agent for deep endpoint security. Just Suriq, standing watch.