CVE-2022-42890: Untrusted code execution in Apache XML Graphics Batik
Summary
CVE-2022-42890: Untrusted code execution in Apache XML Graphics Batik. Affects org.apache.xmlgraphics:batik versions < 1.16. Fixed in 1.16. How to fix ↓
Also tracked for
- batik · Debian:11
The same CVE-2022-42890 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
Apache XML Graphics Batik is a Java-based toolkit for applications that handle SVG (Scalable Vector Graphics) files. It provides functionality for rendering, manipulating, and converting SVG content. Batik is widely used in various applications and libraries for processing SVG files. However, prior to version 1.16, Batik is vulnerable to untrusted code execution, which allows an attacker to run Java code from untrusted SVG via JavaScript.
Vulnerability Detail
The vulnerability in Batik arises from a lack of proper input validation and sanitization of SVG files. By crafting a malicious SVG file with embedded JavaScript code, an attacker can execute arbitrary Java code within the context of the application using Batik. This can lead to various security risks, including remote code execution, information disclosure, and unauthorized access to system resources. The vulnerability has a CVSS score of 7.5, indicating a high severity level.
How To Fix
Latest published version: 1.20 as of 22 Oct 2026
Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.
If you need the minimum change
1.16
This is the first release that contains the fix.
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
As a temporary workaround, users can disable the execution of JavaScript within SVG files processed by Batik. This can be achieved by modifying the configuration or settings of the application using Batik. However, this workaround may impact the functionality of certain SVG files that rely on JavaScript for intended behavior.
Conclusion
The vulnerability in Apache XML Graphics Batik allows for untrusted code execution, posing significant security risks. To mitigate this issue, it is crucial to upgrade to version 1.16 or later of the package. Additionally, disabling JavaScript execution within SVG files processed by Batik can serve as a temporary workaround. For further assistance and support in vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for org.apache.xmlgraphics:batik →
FAQ
Apache XML Graphics Batik is a Java-based toolkit for handling SVG files, providing rendering, manipulation, and conversion capabilities.
The vulnerability allows an attacker to execute arbitrary Java code, potentially leading to remote code execution, information disclosure, and unauthorized access to system resources.
To fix this vulnerability, upgrade to version 1.16 or later of Apache XML Graphics Batik.
As a temporary workaround, you can disable JavaScript execution within SVG files processed by Batik.
The CVSS score of this vulnerability is 7.5, indicating a high severity level.
References
Related vulnerabilities
Recent vulnerabilities recorded for org.apache.xmlgraphics:batik.