Jar url should be blocked by DefaultScriptSecurity
Description
Server-Side Request Forgery (SSRF) vulnerability in Batik of Apache XML Graphics allows an attacker to access files using a Jar url. This issue affects Apache XML Graphics Batik 1.14.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Server-Side Request Forgery (SSRF) in Apache Batik via jar URL allows attackers to read local files or access internal resources.
Vulnerability
Overview
CVE-2022-40146 is a Server-Side Request Forgery (SSRF) vulnerability in Apache XML Graphics Batik version 1.14. The issue stems from Batik's handling of jar URLs within SVG files. Specifically, the DefaultScriptSecurity mechanism fails to properly block jar: protocol URLs, allowing an attacker to craft an SVG that references a malicious jar archive via a networked URL (e.g., jar:http://attacker.com/poc.jar!/) [1][3]. This omission means SVG content can trigger outbound requests to arbitrary hosts or local file system access.
Exploitation
Exploitation requires the attacker to supply a crafted SVG file to an application that uses Batik for SVG processing, such as transcoding or rendering. The attack is triggered when Batik processes an SVG containing a ` element with an xlink:href` pointing to a jar URL [3]. No authentication is needed if the application accepts user-supplied SVGs. The SSRF occurs when Batik attempts to fetch the jar archive, making requests to attacker-controlled or internal network addresses.
Impact
A successful attack can lead to reading arbitrary files on the server (via file:// scheme) or probing internal infrastructure that is not otherwise accessible. Although the primary vector is SSRF, this can escalate to information disclosure, internal network scanning, or potentially triggering other vulnerabilities in internal services.
Mitigation
Apache released a fix in Batik 1.15 (or later). Users should upgrade to Batik 1.17, which addresses multiple CVEs, including this one [4]. No workaround is available for version 1.14; upgrading is the only mitigatin [4].
AI Insight generated on May 21, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
org.apache.xmlgraphics:batikMaven | >= 1.0, < 1.15 | 1.15 |
Affected products
3- ghsa-coords2 versionspkg:maven/org.apache.xmlgraphics/batikpkg:rpm/suse/xmlgraphics-batik&distro=SUSE%20Linux%20Enterprise%20Software%20Development%20Kit%2012%20SP5
>= 1.0, < 1.15+ 1 more
- (no CPE)range: >= 1.0, < 1.15
- (no CPE)range: < 1.17-2.7.1
- Apache Software Foundation/Apache XML Graphicsv5Range: Batik 1.14
Patches
0No patches discovered yet.
Vulnerability mechanics
AI mechanics synthesis has not run for this CVE yet.
References
7- github.com/advisories/GHSA-h4qg-p7r2-cpg3ghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2022-40146ghsaADVISORY
- security.gentoo.org/glsa/202401-11ghsavendor-advisoryWEB
- issues.apache.org/jira/browse/BATIK-1335ghsaWEB
- lists.apache.org/thread/hxtddqjty2sbs12y97c8g7xfh17jzxsxghsaWEB
- lists.debian.org/debian-lts-announce/2023/10/msg00021.htmlghsamailing-listWEB
- lists.debian.org/debian-lts-announce/2025/07/msg00006.htmlghsaWEB
News mentions
0No linked articles in our index yet.