Java4Shell: memory corruption in the OpenJDK Base64 decoder
A flaw in the optimized OpenJDK Base64 decoder can corrupt heap memory when an affected Java application decodes untrusted data. An unauthenticated caller may be able to compromise an exposed service. Inventory the Java runtimes bundled with your applications and install the security update from your JDK distributor. Oracle advisory and affected versions
| Field | Recorded result |
|---|---|
| Eden release and module version | Eden Sphinx 0.9.0 · Java4Shell Base64 Tail Guard 1.0.0 |
| Test dates | November 17–18, 2026 UTC |
| Test coverage | 20 Java runtimes across seven distributions, with heap corruption observed on 19 affected builds |
| Serving coverage | 32 of 32 expected Sphinx shards acknowledged the module in every recorded run |
The vulnerability
OpenJDK uses a processor-specific optimization to decode Base64 on some x86-64 systems. On affected builds and processors, malformed input can cause the optimized decoder to write outside its output buffer. The decoder can corrupt heap memory before the application reports an error. That matters when a service decodes data supplied by a caller before it checks who sent the request. The original researchers demonstrated remote code execution under the right conditions.
Check the exact JDK that each process is running. A host package inventory can miss a runtime bundled into a container or installed alongside the application. The processor also matters. In the recorded investigation, the affected optimization ran on a host with AVX-512 VBMI support. A separate host without the necessary instructions could not exercise it.
The Eden patch
The test used two complementary protections in front of a Java HTTP service. The declarative policy denied the decode route entirely. The native module, Java4Shell Base64 Tail Guard, inspected complete requests and refused the unsafe inputs while allowing the legitimate requests in the comparison to reach the same application.
Tier 1 · Declarative route deny
This is the recorded policy for the test application's /api/decode route. The empty method list matches all HTTP methods. Setting descendants extends the policy to child paths. Apply a route-wide deny only if you can accept that legitimate calls will also be refused.
{
"version": 1,
"profile": "http-structure-v1",
"policy": {
"version": 1,
"rules": [
{
"scope": {
"methods": [],
"path": "/api/decode",
"descendants": true
},
"require": {
"kind": "deny"
}
}
]
}
}
Tier 2 · Native Rust module
The module evaluates the HTTP request before it is released upstream. It waits until Eden can provide a complete request, checks the route, and reads the request data through the SDK. If its Base64 validation flags the request, it returns Decision::Refuse. If the request passes, it returns Decision::Continue and Eden delivers the request to the application.
The Rust excerpt below shows the recorded enforcement path. It starts after the module has checked the route and obtained the request view. The validator is part of the compiled Java4Shell Base64 Tail Guard 1.0.0 package.
let body_range = match request.body_range() {
Availability::Ready(range) => range,
Availability::NeedMore => return Ok(Decision::NeedMore),
Availability::Unavailable => return Err(Failure),
};
let body = match message.bytes(body_range)? {
Availability::Ready(bytes) => bytes,
Availability::NeedMore => return Ok(Decision::NeedMore),
Availability::Unavailable => return Err(Failure),
};
if has_underflow_tail(body) { return Ok(Decision::Refuse); }
if has_underflow_tail(head) { return Ok(Decision::Refuse); }
Ok(Decision::Continue)
The module runs without allocating heap memory or holding state between requests. NeedMore lets the gateway wait for data that has yet to arrive. An unavailable input is an evaluation failure. For an installation that requires this protection, plan for the route to refuse traffic if the approved module stops serving.
Implement the remediation
Update the JDK
Upgrade to the fixed release from your JDK distributor and verify the version of the running JVM on each serving instance. Replace outdated base images and bundled runtimes as part of the rollout. Where an upgrade must wait, consult your distributor about disabling Base64 intrinsics on affected x86-64 runtimes with -XX:-UseBASE64Intrinsics. Validate the setting in staging and allow for a possible performance change. Oracle advisory and affected versions
Apply the route-wide policy
- Identify the exposed listener and the application routes that deliver untrusted Base64 to the decoder. Keep the origin behind the intended listener. For HTTPS traffic, confirm where Eden has authorized access to the HTTP request. Sphinx deployment overview
- With an authenticated operator who has Configure permission, set
INTERLAYto the target interlay UUID andIDEMPOTENCY_KEYto a fresh key for this update. ReadGET /api/v1/interlays/{interlay}withX-Eden-Verbose: true. Save the returned, complete settings object ascurrent-settings.jsonand retain the current remediation declaration for rollback. - Save the policy above as
remediation.json. Merge it into the settings object before issuing the update. Review the route scope before applying this example to a different application.
jq -e --slurpfile policy remediation.json \
'.remediation = $policy[0] | {settings: .}' current-settings.json \
> interlay-update.json
eden api request PATCH "/api/v1/interlays/$INTERLAY" \
--header "Idempotency-Key:$IDEMPOTENCY_KEY" \
--body-file interlay-update.json --content-type application/json --confirm
- Read the interlay back. Confirm that
remediation_status.stateisreadyand that the desired and effective policy digests match. Verify that the intended route is closed and that unrelated routes still work. - To restore the previous policy, fetch current settings again and restore the saved remediation field while preserving other changes. Omit that field if the previous configuration had none. Submit the update with a new idempotency key and verify the effective policy.
Import and activate the targeted module
- Obtain the approved schema-2 package for the target Eden release. Set
PATCH_ARCHIVEto that archive andPACKAGE_SHA256to its expected archive digest. Verify the digest before importing it into the same interlay.
printf '%s %s\n' "$PACKAGE_SHA256" "$PATCH_ARCHIVE" | sha256sum --check &&
eden api request PUT "/api/v1/interlays/$INTERLAY/patch-packages/$PACKAGE_SHA256" \
--body-file "$PATCH_ARCHIVE" \
--content-type application/vnd.eden.patch-package.v2+tar --confirm
- Enroll the publisher key and attest the host software inventory. Inspect the prepared configuration from the import. Obtain independent host approval and sign the typed authority statement with the matching SDK. Submit the admit action, followed by the activate action, using the appropriate typed payload for each request. Remediation API and package format
eden api request POST "/api/v1/interlays/$INTERLAY/native-authority" \
--body-file authority-action.json --content-type application/json --confirm
- Read the operation receipt and confirm
serving_nowand the expected serving-shard count before relying on the protection. Check normal traffic against the backend as well as the Eden response. When switching from a route-wide denial, coordinate the policy change so the route does not reopen before the targeted module is serving. - Confirm the vendor update on every instance before retiring temporary protection. Revoke by the recorded operation UUID. Plan for a service refusal when removing mandatory protection. To restore service under that requirement, approve and activate a compatible operation and verify shard acknowledgments again.
Affected-product verification
Eden ran the comparison against a real Java HTTP service on hardware that supports the affected decoder optimization. The service reported whether the request reached its decoder, and the process output recorded whether decoding changed memory outside the expected output. Comparing the response at the Eden listener with the backend audit distinguished a refusal in transit from an error inside Java.
| Stage | Observation |
|---|---|
| Before protection | The application recorded heap corruption on 19 affected builds. The Temurin 11 observation showed no heap corruption. |
| Declarative policy | Closing the decode route also refused ordinary calls that used it. |
| Native module serving | All four unsafe test cases per run returned HTTP 403 before reaching the decoder. All six benign cases returned HTTP 200 and decoded successfully. Each activation reached 32 of 32 expected shards. |
| Required module revoked | The listener returned HTTP 503 for both categories of request and kept the route closed. |
An HTTP 200 from the baseline did not tell us whether decoding was safe. In the protected comparison the audit recorded no decode attempt for the refused requests, while the successful requests still exercised the real decoder.
Version sweep across affected distributions
The same Eden module binary served the recorded runs across seven distributions. The table shows whether the unprotected decoder exhibited heap corruption, followed by the results with the module serving and after revocation. These rows record observed behavior for the listed builds. Consult the distributor's advisory for a complete affected-version list.
| Distribution | Runtime | Heap corruption observed | Module refused | Benign passed | After revoke | Shards |
|---|---|---|---|---|---|---|
| Eclipse Temurin | 17.0.21 | Yes | 403 × 4 | 200 × 6 | 503 | 32/32 |
| Eclipse Temurin | 21.0.13 | Yes | 403 × 4 | 200 × 6 | 503 | 32/32 |
| Eclipse Temurin | 22.0.2 | Yes | 403 × 4 | 200 × 6 | 503 | 32/32 |
| Eclipse Temurin | 23.0.2 | Yes | 403 × 4 | 200 × 6 | 503 | 32/32 |
| Eclipse Temurin | 24.0.2 | Yes | 403 × 4 | 200 × 6 | 503 | 32/32 |
| Eclipse Temurin | 25.0.5 | Yes | 403 × 4 | 200 × 6 | 503 | 32/32 |
| Amazon Corretto | 17.0.21 | Yes | 403 × 4 | 200 × 6 | 503 | 32/32 |
| Amazon Corretto | 21.0.13 | Yes | 403 × 4 | 200 × 6 | 503 | 32/32 |
| Amazon Corretto | 25.0.5 | Yes | 403 × 4 | 200 × 6 | 503 | 32/32 |
| Azul Zulu | 17.0.21.0.3 | Yes | 403 × 4 | 200 × 6 | 503 | 32/32 |
| Azul Zulu | 21.0.13.0.3 | Yes | 403 × 4 | 200 × 6 | 503 | 32/32 |
| Azul Zulu | 25.0.5.0.3 | Yes | 403 × 4 | 200 × 6 | 503 | 32/32 |
| BellSoft Liberica | 17.0.21.0.3 | Yes | 403 × 4 | 200 × 6 | 503 | 32/32 |
| BellSoft Liberica | 21.0.13.0.3 | Yes | 403 × 4 | 200 × 6 | 503 | 32/32 |
| SAP SapMachine | 17.0.21.0.3 | Yes | 403 × 4 | 200 × 6 | 503 | 32/32 |
| SAP SapMachine | 21.0.13.0.3 | Yes | 403 × 4 | 200 × 6 | 503 | 32/32 |
| Oracle OpenJDK (Container Registry) | 25.0.2 | Yes | 403 × 4 | 200 × 6 | 503 | 32/32 |
| Oracle OpenJDK (Container Registry) | 27.0.1.0.3 | Yes | 403 × 4 | 200 × 6 | 503 | 32/32 |
| Oracle GraalVM Community | 21.0.2 | Yes | 403 × 4 | 200 × 6 | 503 | 32/32 |
| Eclipse Temurin | 11.0.33 | No | 403 × 4 | 200 × 6 | 503 | 32/32 |
Temurin 11.0.33 was an additional observation. It went through the same rollout checks, and its unprotected decoder did not exhibit heap corruption in this comparison.
Evidence and artifacts
- Recorded software. Eden Sphinx 0.9.0 and Java4Shell Base64 Tail Guard 1.0.0. All 20 runtime runs reported 32 of 32 expected shards serving.
- Verification records. The evidence includes the application decode audit, the listener response for each comparison stage, and the import, approval, activation, shard acknowledgment, and revocation receipts. The qualification used one recorded module binary across the distribution sweep.
- Recorded module binary SHA-256.
33c96ca932078ecf4db6ec4cdaec316000bbf417c1037ae27d5c348a1375dd33. - Recorded module source SHA-256.
cdc6982a36740978cc51b74f460beb32fa847ddb05fbae464d3afb24fea892bc. Use the separate archive digest for package import.
Scope and limits
The evidence covers the configured HTTP route, the inspected request fields, and the tested builds. Traffic that bypasses the listener and protocols or encrypted fields the module cannot inspect require separate protection. Inspecting a complete HTTP request gives the module access to the necessary fields. The guard's decision is what refused the recorded requests. Keep the vendor update as the permanent remediation for every affected JDK.