CVE-2026-97893 — Apache Software Foundation Apache Jena (6.2.0) — CWE-20
A Denial of Service (DoS) vulnerability exists in the ARQ SPARQL Query Optimiser in Apache Jena ARQ prior to version 6.3.0 that allows a SPARQL query to use that cause excessive memory usage. Users are recommended to upgrade to version 6.3.0, which fixes this issue. Users who are unable to upgrade immediately, especially those who operate a public facing SPARQL service/application backed by Apache Jena are recommended to configure the ARQ symbol arq:optPathFlatten=false in their SPARQL execution context which disables the problematic optimisation.
A Denial of Service (DoS) vulnerability exists in the ARQ SPARQL Query Optimiser in Apache Jena ARQ prior to version 6.3.0 that allows a SPARQL query to use that cause excessive memory usage. Users are recommended to upgrade to version 6.3.0, which fixes this issue. Users who are unable to upgrade immediately, especially those who operate a public facing SPARQL service/application backed by Apache Jena are recommended to configure the ARQ symbol arq:optPathFlatten=false in their SPARQL execution context which disables the problematic optimisation.
🎯 What is this vulnerability?
This vulnerability is a Denial of Service (DoS) flaw located in the ARQ SPARQL Query Optimiser within Apache Jena. Specifically, it affects versions prior to 6.3.0.
Technical Flaw Analysis:
- CWE-20 (Improper Input Validation): The core issue is the lack of resource constraints or validation on specific SPARQL query patterns during the optimization phase.
- Mechanism: The ARQ engine includes an optimization step known as "Path Flattening" (controlled by the symbol
arq:optPathFlatten). When a maliciously crafted SPARQL query is submitted, the optimizer attempts to flatten complex path expressions. Due to insufficient bounds on the expansion or memory allocation during this flattening process, the query causes excessive memory usage. - Impact: This leads to an Out-Of-Memory (OOM) condition, crashing the Java Virtual Machine (JVM) or causing the application to become unresponsive, thereby denying service to legitimate users.
- Authentication: None required (
PR:N). The vulnerability is exploitable by any user who can submit a SPARQL query to the endpoint. - Fingerprinting: An attacker scans for Apache Jena-based SPARQL endpoints. Common default ports are 3030 (Fuseki) or 8080 (if embedded in a web app).
- Version Identification: * Check HTTP headers for
- Vector: Network (
AV:N), Low Complexity (AC:L), No Privileges Required (PR:N). - Payload Construction: The attacker crafts a SPARQL query that triggers the
optPathFlattenoptimization path in a way that causes unbounded memory allocation.
Note: The exact syntactic structure of the malicious query is not publicly detailed in the CVE description. However, it typically involves complex - Illustrative PoC (Conceptual):
⚡ Attack Chain
1. Discovery & Reconnaissance
Server: Apache Jena Fuseki/6.2.0.
* Query the about endpoint (e.g., GET /about) which often returns JSON-LD containing version information.
* If version is not explicitly exposed, assume vulnerability if the service is known to be Jena < 6.3.0.2. Exploitation
PATH expressions (e.g., (a|b) or nested sequences) that, when flattened by the optimizer, generate an exponentially large intermediate representation.
# Illustrative example of a complex path expression that may trigger excessive memory usage
# during optimization in vulnerable versions. The exact pattern depends on internal optimizer logic.
SELECT * {
?s (a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z)* ?o
}Clarification:* The above is an illustrative example of the vulnerability class (complex path expansion). The actual exploit likely uses a specific combination of path operators that causes the flattening algorithm to allocate memory without limit.
curl -X POST "http://target:3030/query" \
-H "Content-Type: application/sparql-query" \
-d "SELECT * { ?s (a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z)* ?o }"3. Post-exploitation
🌍 Real World Impact
🛡️ Remediation & Mitigation
1. Upgrade (Primary Fix)
# Example for Maven
<dependency>
<groupId>org.apache.jena</groupId>
<artifactId>apache-jena</artifactId>
<version>6.3.0</version>
</dependency>2. Workaround (If Upgrade is Not Immediate)
arq:optPathFlatten to false in the SPARQL execution context.
* Implementation:
* Fuseki: Add the following to your Fuseki configuration or use a custom Dataset setup:// Java code example for disabling the optimization
QueryExecution qe = QueryExecutionFactory.create(query, dataset);
qe.getContext().setSymbol(SymbolFactory.create("arq:optPathFlatten"), false);* Web Application: If using Jena in a web app, ensure the QueryExecution context is configured with this symbol set to false before executing queries.
* Note: Disabling this optimization may slightly degrade query performance for complex path queries, but it prevents the DoS.
3. WAF/ModSecurity Rules
PATH expressions.SecRule REQUEST_BODY "@rx \(\s*[a-zA-Z0-9_]+\s*(\|\s*[a-zA-Z0-9_]+\s*){10,}\)" \
"id:100001,phase:2,deny,status:403,msg:'Potential SPARQL DoS: Complex Path Expression',log"Note:* This rule is heuristic and may produce false positives. Tune the threshold based on your application's normal query patterns.
4. Detection & IoCs
POST requests to /query or /update endpoints with large request bodies containing complex SPARQL PATH syntax.java.lang.OutOfMemoryError: Java heap space.
* ARQ logs: Exceptions related to query optimization or memory allocation.
⚠️ Urgency
arq:optPathFlatten=false) if you cannot upgrade immediately.
2. Short-term: Upgrade to Apache Jena 6.3.0.
3. Ongoing: Monitor for DoS attempts and tune WAF rules.[🤖 CVE Professor AI Security Engine]
FOFA Query