Cloudanix VulnDB

CVE-2023-32200

High · 8.8

CVSS

8.8

EPSS

1.5%

Published

Jul 12, 2023

CISA due date

—

Cloudanix analysis

Schedule a fix SSVC: Track

A flaw in Apache Jena lets attackers run their own code on the server simply by sending specially crafted database queries.

Exploitation
Remote Authenticated
Attacker needs
Low Privilege
Complexity
Low
Impact
Remote Code Execution
Component
Library
Class
RCE
Remediation
Upgrade
Effort
Medium
Patch risk
Low

What it actually does

Insufficient restrictions on script functions allow remote execution of JavaScript code via crafted SPARQL queries, leading to arbitrary code execution on the server.

Why it matters to the business

Attackers can fully compromise affected servers to steal data, deploy malware, or disrupt operations; the flaw has been public for over three years with no known fixes listed, increasing long-term exposure risk for any remaining deployments.

How an attack unfolds

An attacker with network access crafts a SPARQL query that invokes restricted script functions to execute JavaScript, bypassing intended controls and achieving remote code execution on the Jena instance.

How to fix it

Upgrade Apache Jena to a version later than 4.8.0 that enforces proper script function restrictions; until upgraded, restrict network access to SPARQL endpoints and disable unnecessary script extensions.

How to confirm the fix worked

Confirm Jena version exceeds 4.8.0; test that attempted script execution via SPARQL queries is rejected and produces access-denied errors rather than executing code.

Typical attack path

  1. Identify publicly reachable Apache Jena SPARQL endpoint
  2. Craft SPARQL query containing script invocation payload
  3. Submit query to execute JavaScript code
  4. Escalate to full system control or data exfiltration

How to detect it

Inspect SPARQL endpoint logs for queries containing script, javascript, or function invocation patterns that were previously blocked; correlate with successful code execution indicators such as unexpected processes or file writes.

  • SPARQL queries containing 'javascript' or script function calls
  • Unexpected JavaScript execution artifacts in Jena process logs

What your security team should do

  • Prioritize upgrade of all Apache Jena instances beyond 4.8.0
  • Implement network segmentation and query allow-listing for SPARQL endpoints
  • Monitor for anomalous SPARQL traffic while remediation is pending
  • Review downstream dependents and update any packages relying on vulnerable Jena versions

The record

There is insufficient restrictions of called script functions in Apache Jena versions 4.8.0 and earlier. It allows a remote user to execute javascript via a SPARQL query. This issue affects Apache Jena: from 3.7.0 through 4.8.0.

Affected packages

Ecosystem Package Introduced Fixed
Maven org.apache.jena:jena 3.7.0 4.9.0
Debian:12 apache-jena 0 No fix
Debian:13 apache-jena 0 4.9.0-1
Ubuntu:22.04:LTS apache-jena 0 No fix
Ubuntu:24.04:LTS apache-jena 0 No fix
Ubuntu:24.10 apache-jena 0 No fix
Ubuntu:25.04 apache-jena 0 No fix
Ubuntu:25.10 apache-jena 0 No fix
maven org.apache.jena/jena 3.7.0 No fix

Related vulnerabilities