Critical Java Code Execution Vulnerability in Apache Batik

batik Updated 02 Oct 2025

Summary

25/10/2022
N/A
Yes i
High
7.5

CVE-2022-41704: A vulnerability in Batik of Apache XML Graphics allows an attacker to run untrusted Java code from an SVG. Affects batik across 2 version ranges.

< 1.12-4+deb11u1 >= 1b708df57205a70c2c9fb8235ff5eab837609968, < 8e94aaaf3872a670040c6faebe82c907cb380fad

Fixed in 1.12-4+deb11u1. How to fix ↓

Free scan

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.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

Apache Batik is a powerful toolkit for processing and rendering SVG (Scalable Vector Graphics) images in Java applications. It provides a range of functionalities, including SVG manipulation, rendering, and conversion to various formats. However, prior to version 1.16, Batik was susceptible to a vulnerability that allowed attackers to execute untrusted Java code through specially crafted SVG files, posing significant security risks to applications using this library.

Vulnerability Detail

CVE-2022-41704 is a vulnerability in Apache Batik that allows an attacker to run untrusted Java code from an SVG file. This issue arises from improper handling of SVG content, which can be exploited to execute arbitrary code in the context of the application using Batik. The ramifications of this vulnerability are severe, as it can lead to unauthorized access, data breaches, and potential system compromise. The vulnerability affects all versions of Apache Batik prior to 1.16, making it critical for users to update to the latest version to mitigate risks.

How To Fix

Minimum fixed version

1.12-4+deb11u1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade batik

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

If immediate updating is not feasible, consider implementing strict input validation and sanitization for SVG files processed by your application. This can help mitigate the risk of executing untrusted code until the update can be applied.

Conclusion

CVE-2022-41704 represents a significant security risk for applications using Apache Batik prior to version 1.16. It is crucial for developers to update to the latest version to protect against potential exploitation. Additionally, implementing workarounds can help mitigate risks until an update is possible.

See every vulnerability recorded for batik →

Share this vulnerability

FAQ

CVE-2022-41704 is a vulnerability in Apache Batik that allows attackers to execute untrusted Java code from SVG files.

All versions of Apache Batik prior to 1.16 are affected by this vulnerability.

Exploitation of this vulnerability can lead to unauthorized access, data breaches, and system compromise.

You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without any signup.

The CVSS score for CVE-2022-41704 is 7.5, indicating a high severity level.

Related vulnerabilities

Recent vulnerabilities recorded for batik.

How To Fix

Minimum fixed version

1.12-4+deb11u1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade batik

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback