CVE-2025-70974

10.0 CRITICAL

📋 TL;DR

This is a critical deserialization vulnerability in Fastjson that allows remote code execution via JNDI injection. Attackers can exploit it by sending specially crafted JSON documents containing malicious @type keys, potentially leading to full system compromise. Any application using vulnerable Fastjson versions for JSON parsing is affected.

💻 Affected Systems

Products:
  • Fastjson
Versions: All versions before 1.2.48
Operating Systems: All platforms running Java
Default Config Vulnerable: ⚠️ Yes
Notes: Applications using Fastjson's default autoType feature are vulnerable. This is an incomplete fix for CVE-2017-18349, with later bypasses in CVE-2022-25845.

⚠️ Manual Verification Required

This CVE does not have specific version information in our database, so automatic vulnerability detection cannot determine if your system is affected.

Why? The CVE database entry doesn't specify which versions are vulnerable (no version ranges provided by the vendor/NVD).

🔒 Custom verification scripts are available for registered users. Sign up free to download automated test scripts.

Recommended Actions:
  1. Review the CVE details at NVD
  2. Check vendor security advisories for your specific version
  3. Test if the vulnerability is exploitable in your environment
  4. Consider updating to the latest version as a precaution

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete system takeover with attacker executing arbitrary code, installing malware, stealing data, and pivoting to other systems.

🟠

Likely Case

Remote code execution leading to data theft, ransomware deployment, or cryptocurrency mining.

🟢

If Mitigated

Limited impact with proper network segmentation, but still potential for application compromise.

🌐 Internet-Facing: HIGH - Exploitable remotely without authentication via HTTP requests containing JSON.
🏢 Internal Only: HIGH - Internal applications can be exploited by authenticated users or via lateral movement.

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: CONFIRMED
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

Actively exploited in the wild from 2023-2025. Multiple public PoCs and exploit kits available.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 1.2.48 or later

Vendor Advisory: https://github.com/alibaba/fastjson/compare/1.2.47...1.2.48

Restart Required: Yes

Instructions:

1. Update Fastjson dependency to version 1.2.48 or later. 2. Update pom.xml or build.gradle with new version. 3. Rebuild and redeploy application. 4. Restart application server.

🔧 Temporary Workarounds

Disable autoType feature

all

Configure Fastjson to disable the autoType feature which is required for exploitation

ParserConfig.getGlobalInstance().setAutoTypeSupport(false);

Use SafeMode

all

Enable Fastjson's SafeMode to prevent deserialization of arbitrary classes

ParserConfig.getGlobalInstance().setSafeMode(true);

🧯 If You Can't Patch

  • Implement strict input validation to reject JSON containing @type keys
  • Deploy WAF rules to block requests containing suspicious @type patterns

🔍 How to Verify

Check if Vulnerable:

Check application dependencies for Fastjson version <1.2.48. Review pom.xml, build.gradle, or deployed JAR files.

Check Version:

java -cp fastjson-*.jar com.alibaba.fastjson.JSON 2>&1 | grep version

Verify Fix Applied:

Confirm Fastjson version is 1.2.48 or later. Test with known exploit payloads to ensure they are rejected.

📡 Detection & Monitoring

Log Indicators:

  • Unusual JNDI lookup attempts in logs
  • Exceptions related to ClassNotFoundException or autoType
  • Suspicious @type values in request logs

Network Indicators:

  • HTTP requests containing @type keys with unusual class names
  • Outbound LDAP/RMI connections from application servers

SIEM Query:

source="application.logs" AND ("@type" OR "autoType" OR "JNDI")

🔗 References

📤 Share & Export