CVE-2018-1000613

9.8 CRITICAL

📋 TL;DR

This vulnerability in Bouncy Castle Java Cryptography APIs allows remote code execution through unsafe reflection during XMSS/XMSS^MT private key deserialization. Attackers can craft malicious private keys that reference arbitrary classes from the application's classpath, leading to unexpected code execution. Applications using Bouncy Castle 1.58-1.59 for XMSS key operations are affected.

💻 Affected Systems

Products:
  • Bouncy Castle Java Cryptography APIs
Versions: 1.58 up to but not including 1.60
Operating Systems: All platforms running Java
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects XMSS/XMSS^MT private key deserialization functionality. Applications must use these specific key types to be vulnerable.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Full remote code execution with application privileges, potentially leading to complete system compromise, data theft, or lateral movement.

🟠

Likely Case

Remote code execution in applications that deserialize untrusted XMSS private keys, allowing attackers to execute arbitrary code within the application context.

🟢

If Mitigated

Limited impact if proper input validation and sandboxing prevent execution of malicious classes.

🌐 Internet-Facing: HIGH - Applications accepting XMSS private keys from untrusted sources are directly exploitable.
🏢 Internal Only: MEDIUM - Internal systems processing XMSS keys from untrusted sources remain vulnerable.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ⚠️ Yes
Complexity: MEDIUM

Exploitation requires crafting malicious XMSS private keys and getting them deserialized by vulnerable applications. No public exploit code is documented.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 1.60 and later

Vendor Advisory: https://github.com/bcgit/bc-java/commit/4092ede58da51af9a21e4825fbad0d9a3ef5a223

Restart Required: Yes

Instructions:

1. Update Bouncy Castle library to version 1.60 or higher. 2. Replace bcprov-jdk15on-1.58/1.59 JAR files with bcprov-jdk15on-1.60+. 3. Restart all Java applications using Bouncy Castle. 4. Verify no older versions remain in classpath.

🔧 Temporary Workarounds

Disable XMSS key processing

all

Prevent deserialization of XMSS/XMSS^MT private keys if not required

Configure applications to reject XMSS key types
Implement input validation to block XMSS private keys

Classpath restriction

all

Limit available classes in application classpath to reduce attack surface

Use custom classloaders with restricted class access
Implement Java Security Manager policies

🧯 If You Can't Patch

  • Implement strict input validation to reject untrusted XMSS private keys
  • Isolate vulnerable applications in network segments with limited access

🔍 How to Verify

Check if Vulnerable:

Check Bouncy Castle version in classpath: find JAR files containing 'bcprov' and verify version is 1.58 or 1.59

Check Version:

java -cp bcprov-jdk15on-*.jar org.bouncycastle.jcajce.provider.BouncyCastleProvider | grep 'BouncyCastle Security Provider'

Verify Fix Applied:

Confirm bcprov-jdk15on-1.60+ JAR files are present and no 1.58/1.59 versions remain

📡 Detection & Monitoring

Log Indicators:

  • Java exceptions during XMSS key deserialization
  • ClassNotFound or ClassCast exceptions from Bouncy Castle
  • Unexpected class loading events

Network Indicators:

  • Inbound connections delivering binary/key data to applications using Bouncy Castle
  • Unusual outbound connections after key processing

SIEM Query:

source="*java*" AND ("XMSS" OR "BouncyCastle" OR "ClassNotFoundException")

🔗 References

📤 Share & Export