Skip to main content
Vulnerability Database/CVE-2026-71253

CVE-2026-71253: Apache Johnzon Unsafe Reflection RCE Flaw

CVE-2026-71253 is an unsafe reflection vulnerability in Apache Johnzon that allows attackers to execute arbitrary code through malicious JSON input. This article covers the technical details, affected versions, and mitigation strategies.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-71253 Overview

CVE-2026-71253 is an unsafe reflection vulnerability in Apache Johnzon, the Apache Software Foundation's JSON processing library for Java. The flaw resides in ClassConverter, which loads and statically initializes attacker-named classes supplied through untrusted JSON input. An attacker who controls JSON data processed by a vulnerable Johnzon deployment can trigger loading of arbitrary classes on the classpath. Static initializers of those classes execute during loading, which can lead to remote code execution depending on the gadgets available in the target application.

The vulnerability affects Apache Johnzon from 1.0.0 before 2.2.0 and is tracked under CWE-470: Use of Externally-Controlled Input to Select Classes or Code.

Critical Impact

Network-reachable JSON endpoints that use Apache Johnzon can be coerced into loading attacker-chosen classes, enabling arbitrary code execution with no authentication or user interaction.

Affected Products

  • Apache Johnzon 1.0.0 through 1.3.0 (javax namespace)
  • Apache Johnzon 2.0.0 through 2.1.x (jakarta specification namespace)
  • Applications embedding Johnzon via Apache TomEE, Meecrowave, or other MicroProfile stacks

Discovery Timeline

  • 2026-10-19 - CVE-2026-71253 published to NVD
  • 2026-10-20 - Last updated in NVD database

Technical Details for CVE-2026-71253

Vulnerability Analysis

Apache Johnzon provides a ClassConverter component used to deserialize JSON string values into java.lang.Class instances. The converter accepts a fully qualified class name from the JSON payload and invokes Class.forName with that name. Because Class.forName triggers static class initialization by default, any static { } block in the resolved class executes immediately. Attackers can abuse this behavior to invoke gadget classes already present on the classpath that perform sensitive actions during initialization.

The vulnerability requires no authentication and is reachable over the network wherever Johnzon deserializes untrusted JSON into generic object graphs. Exploitation severity depends on the gadgets available in the deployment, but typical enterprise Java classpaths contain classes whose static initializers can establish outbound connections, read files, or facilitate code execution chains.

Root Cause

The root cause is the absence of an allowlist in ClassConverter. The converter trusted the deserialized string to designate a legitimate class, and it did not restrict class loading to a safe set of types. This design pattern maps directly to CWE-470, where externally controlled input selects the code to execute.

Attack Vector

An attacker sends a crafted JSON document to any endpoint that uses Johnzon to populate a target type containing a Class field or that performs mapping to Object. When Johnzon encounters the string value, ClassConverter resolves and initializes the named class. The attack vector is network based, requires no privileges, and no user interaction.

java
// Representative patch context from Apache Johnzon 2.2.0
// The fix hardens ClassConverter so untrusted JSON cannot drive arbitrary class loading,
// and ensures JSON-Schema validation does not skip numeric schema types.

public class ExclusiveMaximumValidation implements ValidationExtension {
    @Override
    public Optional<Function<JsonValue, Stream<ValidationResult.ValidationError>>> create(final ValidationContext model) {
-       if (model.getSchema().getString("type", "object").equals("number")) {
+       if (SchemaType.isNumber(model.getSchema())) {
            return Optional.ofNullable(model.getSchema().get("exclusiveMaximum"))
                    .filter(v -> v.getValueType() == JsonValue.ValueType.NUMBER)
                    .map(m -> new Impl(model.toPointer(),
                                       model.getValueProvider(),
                                       JsonNumber.class.cast(m).doubleValue()));

Source: apache/johnzon commit 91e7b0d and companion commit dd3d006.

Stop Remote Code Execution Before It Runs

Singularity™ Endpoint detects and blocks exploit attempts at machine speed, including zero-days and novel attack techniques.

Stop Exploit Attempts

Detection Methods for CVE-2026-71253

Indicators of Compromise

  • JSON request bodies containing fully qualified Java class names in string fields, especially names referencing sun., com.sun., javax.naming., or other sensitive namespaces.
  • Unexpected Class.forName or ClassLoader.loadClass invocations originating from Johnzon packages (org.apache.johnzon.*) observed in application logs or JVM flight recordings.
  • New outbound network connections from the Java application process immediately following inbound JSON requests.

Detection Strategies

  • Inspect application and web server logs for JSON payloads containing class-name shaped strings in unexpected fields.
  • Enable JVM security manager auditing or Java Flight Recorder events for class loading and correlate with request traces.
  • Perform a software composition analysis scan to identify Apache Johnzon versions below 1.3.1 or 2.2.0 across repositories and running containers.

Monitoring Recommendations

  • Alert on process behavior that follows JSON API traffic, such as spawning child processes, loading unexpected JAR files, or initiating outbound connections from the application tier.
  • Monitor container and host telemetry for drift in loaded classes after deployment of Johnzon-based services.
  • Track Apache Software Foundation security announcements and the Apache Johnzon mailing list thread for follow-up advisories.

How to Mitigate CVE-2026-71253

Immediate Actions Required

  • Upgrade Apache Johnzon to version 1.3.1 for deployments using the javax namespace, or to version 2.2.0 for deployments using the jakarta specification namespace.
  • Inventory all applications, container images, and build pipelines that bundle Johnzon transitively through Apache TomEE, Meecrowave, or MicroProfile distributions.
  • Restart affected Java processes after patching so the vulnerable ClassConverter is unloaded from memory.

Patch Information

The Apache Johnzon project fixed the issue in commits 91e7b0d and dd3d006. The commits constrain ClassConverter deserialization and correct related JSON-Schema validation gaps. Users are directed to Apache Johnzon 1.3.1 or 2.2.0.

Workarounds

  • Remove or override ClassConverter registration in Johnzon mapper configurations where upgrading is not immediately feasible.
  • Validate inbound JSON at the API gateway and reject payloads whose string fields match Java class-name patterns when such values are not expected.
  • Run the Java process under a restrictive security policy that prevents loading of classes outside the application's required packages.
bash
# Maven dependency pin to the fixed Jakarta-namespace release
mvn versions:use-dep-version \
  -Dincludes=org.apache.johnzon:johnzon-core \
  -DdepVersion=2.2.0 \
  -DforceVersion=true

# Gradle equivalent in build.gradle
# implementation("org.apache.johnzon:johnzon-core:2.2.0")

# For javax-namespace deployments, pin to 1.3.1
# implementation("org.apache.johnzon:johnzon-core:1.3.1")

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.