CVE-2023-32200

8.8 HIGH

📋 TL;DR

This vulnerability allows remote attackers to execute arbitrary JavaScript code via specially crafted SPARQL queries in Apache Jena. It affects Apache Jena versions 3.7.0 through 4.8.0, potentially compromising systems that expose Jena SPARQL endpoints.

💻 Affected Systems

Products:
  • Apache Jena
Versions: 3.7.0 through 4.8.0
Operating Systems: All
Default Config Vulnerable: ⚠️ Yes
Notes: Affects systems with exposed SPARQL endpoints. Applications using Jena's SPARQL processor are vulnerable.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Remote code execution leading to complete system compromise, data exfiltration, and lateral movement within the network.

🟠

Likely Case

Unauthorized data access, manipulation of RDF datasets, and potential privilege escalation within the Jena environment.

🟢

If Mitigated

Limited impact if proper input validation and sandboxing are implemented, though some data exposure may still occur.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: LIKELY
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

Exploitation requires sending malicious SPARQL queries to vulnerable endpoints. No authentication needed if endpoint is publicly accessible.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 4.9.0

Vendor Advisory: https://lists.apache.org/thread/7hg0t2kws3fyr75dl7lll8389xzzc46z

Restart Required: Yes

Instructions:

1. Download Apache Jena 4.9.0 or later from official Apache repository. 2. Replace existing Jena installation with patched version. 3. Restart all services using Jena.

🔧 Temporary Workarounds

Disable JavaScript Functions

all

Configure Jena to disable JavaScript function execution in SPARQL queries

Set ARQ.enableJavaScript = false in Jena configuration

Restrict SPARQL Endpoint Access

all

Implement network-level restrictions to limit access to SPARQL endpoints

Configure firewall rules to restrict access to SPARQL port (typically 3030)

🧯 If You Can't Patch

  • Implement strict input validation and sanitization for all SPARQL queries
  • Deploy web application firewall (WAF) with rules to detect malicious SPARQL patterns

🔍 How to Verify

Check if Vulnerable:

Check Jena version using Fuseki admin interface or by examining Jena library files

Check Version:

java -cp jena-arq.jar arq.version

Verify Fix Applied:

Verify Jena version is 4.9.0 or later and test SPARQL endpoint with JavaScript function attempts

📡 Detection & Monitoring

Log Indicators:

  • Unusual SPARQL queries containing JavaScript functions
  • Multiple failed query attempts with script-like patterns

Network Indicators:

  • Unusual traffic patterns to SPARQL endpoints
  • Requests containing 'javascript:' or script function calls

SIEM Query:

source="jena.log" AND ("javascript" OR "script" OR "eval")

🔗 References

📤 Share & Export