CVE-2022-41704: Batik Apache XML Graphics Batik Vulnerable Vulnerability

HIGH
Advisory Identifier: GHSA-r29w-r9ph-vm76
CVSS 7.5
CWE-918
Published
Advisory Summary

CVE-2022-41704 is a HIGH (CVSS 7.5) apache xml graphics batik vulnerable vulnerability (CWE-918: Server-Side Request Forgery (SSRF)) affecting Batik libraries in the Maven ecosystem. The issue involves apache xml graphics batik vulnerable to code execution via svg.. Remediation is available by upgrading affected packages to version 1.16.

CVE-2022-41704 at a Glance

CVE Identifier CVE-2022-41704
GHSA Identifier GHSA-r29w-r9ph-vm76
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-918: Server-Side Request Forgery (SSRF)
Affected Product Batik
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 7.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2022-41704

To remediate this vulnerability, upgrade all affected Batik dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

org.apache.xmlgraphics:batik fixed: 1.16
<dependency>
    <groupId>org.apache.xmlgraphics</groupId>
    <artifactId>batik</artifactId>
    <version>1.16</version>
</dependency>
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

mvn dependency:tree -Dincludes=org.apache.xmlgraphics

How to Check if You Are Affected

To determine whether your Java application is affected by CVE-2022-41704, inspect your build dependencies using the Maven Dependency Plugin:

mvn dependency:tree -Dincludes=org.apache.xmlgraphics

Analyze the terminal output to locate any version of Batik in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.16), your application is affected.

Note: The mvn dependency:tree -Dincludes=org.apache.xmlgraphics command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-918: Server-Side Request Forgery (SSRF), where the web server receives a url or similar request from an upstream component and retrieves the contents of this url, but it does not sufficiently ensure that the request is being sent to the expected destination. In Batik, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

A vulnerability in Batik of Apache XML Graphics allows an attacker to run untrusted Java code from an SVG. This issue affects Apache XML Graphics prior to 1.16. It is recommended to update to version 1.16.

CVE-2022-41704 Affected Batik Versions

1 component(s)
Fixed Versions:
1.16
Product / Package Ecosystem Affected Versions Fixed Version
org.apache.xmlgraphics:batik
Maven
< 1.16
1.16

References

Frequently Asked Questions

What is CVE-2022-41704?
CVE-2022-41704 is a security vulnerability in Batik involving Apache XML Graphics Batik vulnerable to code execution via SVG. under CWE-918: Server-Side Request Forgery (SSRF).
Which Batik versions are affected?
Affected versions include releases prior to 1.16 across affected packages: org.apache.xmlgraphics:batik.
What version fixes CVE-2022-41704?
Upgrading to 1.16 (or the latest patched release for your respective branch) resolves the vulnerability.
Is batik affected?
Yes, org.apache.xmlgraphics:batik is affected in releases prior to 1.16. Upgrade your dependency to 1.16 or later.
What is the CVSS score of CVE-2022-41704?
CVE-2022-41704 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N.
What CWE is associated with CVE-2022-41704?
CVE-2022-41704 is classified under CWE-918: Server-Side Request Forgery (SSRF) (The web server receives a URL or similar request from an upstream component and retrieves the contents of this URL, but it does not sufficiently ensure that the request is being sent to the expected destination.).
How can I check Maven dependencies for CVE-2022-41704?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=org.apache.xmlgraphics'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-r29w-r9ph-vm76",
  "modified" : "2022-10-31T15:41:18Z",
  "published" : "2022-10-25T19:00:29Z",
  "aliases" : [ "CVE-2022-41704" ],
  "summary" : "Apache XML Graphics Batik vulnerable to code execution via SVG.",
  "details" : "A vulnerability in Batik of Apache XML Graphics allows an attacker to run untrusted Java code from an SVG. This issue affects Apache XML Graphics prior to 1.16. It is recommended to update to version 1.16.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.apache.xmlgraphics:batik"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.16"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-41704"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/apache/xmlgraphics-batik/commit/905f368b50c2567cf2c4869a0ab596a7b1b5125c"
  }, {
    "type" : "WEB",
    "url" : "https://issues.apache.org/jira/browse/BATIK-1338"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread/hplhx0o74jb7blj39fm4kw3otcnjd6xf"
  }, {
    "type" : "WEB",
    "url" : "https://lists.debian.org/debian-lts-announce/2022/10/msg00038.html"
  }, {
    "type" : "WEB",
    "url" : "https://security.gentoo.org/glsa/202401-11"
  }, {
    "type" : "WEB",
    "url" : "https://www.debian.org/security/2022/dsa-5264"
  }, {
    "type" : "WEB",
    "url" : "https://xmlgraphics.apache.org/security.html"
  }, {
    "type" : "WEB",
    "url" : "http://svn.apache.org/repos/asf/xmlgraphics/batik/trunk"
  }, {
    "type" : "WEB",
    "url" : "http://www.openwall.com/lists/oss-security/2022/10/25/2"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-918" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-10-25T23:10:27Z",
    "nvd_published_at" : "2022-10-25T17:15:00Z"
  }
}