CVE-2018-8013: Batik Deserialization Of Untrusted Data Vulnerability

CRITICAL
Advisory Identifier: GHSA-25gw-4pcc-45cf
CVSS 9.8
CWE-502
Published
Advisory Summary

CVE-2018-8013 is a CRITICAL (CVSS 9.8) deserialization of untrusted data vulnerability (CWE-502: Deserialization of Untrusted Data) affecting Batik libraries in the Maven ecosystem. The issue involves deserialization of untrusted data in apache batik. Remediation is available by upgrading affected packages to version 1.10.

CVE-2018-8013 at a Glance

CVE Identifier CVE-2018-8013
GHSA Identifier GHSA-25gw-4pcc-45cf
Severity CRITICAL
CVSS v3.1 Base Score 9.8
CWE Classification CWE-502: Deserialization of Untrusted Data
Affected Product Batik
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 9.8

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

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 High (I:H)
Availability High (A:H)

How to Fix CVE-2018-8013

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.10
<dependency>
    <groupId>org.apache.xmlgraphics</groupId>
    <artifactId>batik</artifactId>
    <version>1.10</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-2018-8013, 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.10), 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-502: Deserialization of Untrusted Data, where the product deserializes untrusted data without sufficiently ensuring that the resulting data will be valid. 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

In Apache Batik 1.x before 1.10, when deserializing subclass of `AbstractDocument`, the class takes a string from the inputStream as the class name which then use it to call the no-arg constructor of the class. Fix was to check the class type before calling newInstance in deserialization.

CVE-2018-8013 Affected Batik Versions

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

References

Batik Security Information SECURITY
https://ubuntu.com/security/CVE-2018-8013
Batik Security Information SECURITY
https://security.gentoo.org/glsa/202401-11
NVD — CVE-2018-8013 NVD
https://nvd.nist.gov/vuln/detail/CVE-2018-8013
Security Fix Commit FIX COMMIT
https://github.com/apache/xmlgraphics-batik/commit/f91125b26a6ca2b7a1195f1842360bed03629839
Batik Security Information SECURITY
https://xmlgraphics.apache.org/security.html
Batik Security Information SECURITY
https://www.oracle.com/technetwork/security-advisory/cpujul2019-5072835.html
Batik Security Information SECURITY
https://www.oracle.com/technetwork/security-advisory/cpujan2019-5072801.html
Batik Security Information SECURITY
https://www.oracle.com/technetwork/security-advisory/cpuapr2019-5072813.html
Batik Security Information SECURITY
https://www.oracle.com/security-alerts/cpuoct2020.html
Batik Security Information SECURITY
https://www.oracle.com/security-alerts/cpujul2020.html
Batik Security Information SECURITY
https://www.debian.org/security/2018/dsa-4215
usn.ubuntu.com/3661-1 WEB
https://usn.ubuntu.com/3661-1
mail-archives.apache.org/mod_mbox/xmlgraphic... WEB
https://mail-archives.apache.org/mod_mbox/xmlgraphics-batik-dev/201805.mbox/%3c000701d3f28f%24d01860a0%24704921e0%24%40gmail.com%3e
mail-archives.apache.org/mod_mbox/xmlgraphic... WEB
https://mail-archives.apache.org/mod_mbox/xmlgraphics-batik-dev/201805.mbox/%3c000701d3f28f$d01860a0$704921e0$@gmail.com%3e
lists.debian.org/debian-lts-announce... WEB
https://lists.debian.org/debian-lts-announce/2018/05/msg00016.html
lists.apache.org/thread.html/rc0a318... WEB
https://lists.apache.org/thread.html/rc0a31867796043fbe59113fb654fe8b13309fe04f8935acb8d0fab19@%3Ccommits.xmlgraphics.apache.org%3E
lists.apache.org/thread.html/rc0a318... WEB
https://lists.apache.org/thread.html/rc0a31867796043fbe59113fb654fe8b13309fe04f8935acb8d0fab19%40%3Ccommits.xmlgraphics.apache.org%3E
lists.apache.org/thread.html/r9e90b4... WEB
https://lists.apache.org/thread.html/r9e90b4d1cf6ea87a79bb506541140dfbf4801f4463a7cee08126ee44@%3Ccommits.xmlgraphics.apache.org%3E
lists.apache.org/thread.html/r9e90b4... WEB
https://lists.apache.org/thread.html/r9e90b4d1cf6ea87a79bb506541140dfbf4801f4463a7cee08126ee44%40%3Ccommits.xmlgraphics.apache.org%3E
issues.apache.org/jira/browse/batik-1... WEB
https://issues.apache.org/jira/browse/BATIK-1222
Batik Security Information SECURITY
http://www.oracle.com/technetwork/security-advisory/cpujul2018-4258247.html
Batik Security Information SECURITY
http://www.oracle.com/technetwork/security-advisory/cpuoct2018-4428296.html
Batik Security Information SECURITY
http://www.securityfocus.com/bid/104252
Batik Security Information SECURITY
http://www.securitytracker.com/id/1040995

Frequently Asked Questions

What is CVE-2018-8013?
CVE-2018-8013 is a security vulnerability in Batik involving Deserialization of Untrusted Data in Apache Batik under CWE-502: Deserialization of Untrusted Data.
Which Batik versions are affected?
Affected versions include releases prior to 1.10 across affected packages: org.apache.xmlgraphics:batik.
What version fixes CVE-2018-8013?
Upgrading to 1.10 (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.10. Upgrade your dependency to 1.10 or later.
What is the CVSS score of CVE-2018-8013?
CVE-2018-8013 has a CVSS v3.1 base score of 9.8 (CRITICAL) with vector string CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2018-8013?
CVE-2018-8013 is classified under CWE-502: Deserialization of Untrusted Data (The product deserializes untrusted data without sufficiently ensuring that the resulting data will be valid.).
How can I check Maven dependencies for CVE-2018-8013?
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-25gw-4pcc-45cf",
  "modified" : "2024-03-04T23:13:20Z",
  "published" : "2022-05-13T01:14:24Z",
  "aliases" : [ "CVE-2018-8013" ],
  "summary" : "Deserialization of Untrusted Data in Apache Batik",
  "details" : "In Apache Batik 1.x before 1.10, when deserializing subclass of `AbstractDocument`, the class takes a string from the inputStream as the class name which then use it to call the no-arg constructor of the class. Fix was to check the class type before calling newInstance in deserialization.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.apache.xmlgraphics:batik"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.0"
      }, {
        "fixed" : "1.10"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 1.9.1"
    }
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2018-8013"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/apache/xmlgraphics-batik/commit/f91125b26a6ca2b7a1195f1842360bed03629839"
  }, {
    "type" : "WEB",
    "url" : "https://xmlgraphics.apache.org/security.html"
  }, {
    "type" : "WEB",
    "url" : "https://www.oracle.com/technetwork/security-advisory/cpujul2019-5072835.html"
  }, {
    "type" : "WEB",
    "url" : "https://www.oracle.com/technetwork/security-advisory/cpujan2019-5072801.html"
  }, {
    "type" : "WEB",
    "url" : "https://www.oracle.com/technetwork/security-advisory/cpuapr2019-5072813.html"
  }, {
    "type" : "WEB",
    "url" : "https://www.oracle.com/security-alerts/cpuoct2020.html"
  }, {
    "type" : "WEB",
    "url" : "https://www.oracle.com/security-alerts/cpujul2020.html"
  }, {
    "type" : "WEB",
    "url" : "https://www.debian.org/security/2018/dsa-4215"
  }, {
    "type" : "WEB",
    "url" : "https://usn.ubuntu.com/3661-1"
  }, {
    "type" : "WEB",
    "url" : "https://ubuntu.com/security/CVE-2018-8013"
  }, {
    "type" : "WEB",
    "url" : "https://security.gentoo.org/glsa/202401-11"
  }, {
    "type" : "WEB",
    "url" : "https://mail-archives.apache.org/mod_mbox/xmlgraphics-batik-dev/201805.mbox/%3c000701d3f28f%24d01860a0%24704921e0%24%40gmail.com%3e"
  }, {
    "type" : "WEB",
    "url" : "https://mail-archives.apache.org/mod_mbox/xmlgraphics-batik-dev/201805.mbox/%3c000701d3f28f$d01860a0$704921e0$@gmail.com%3e"
  }, {
    "type" : "WEB",
    "url" : "https://lists.debian.org/debian-lts-announce/2018/05/msg00016.html"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/rc0a31867796043fbe59113fb654fe8b13309fe04f8935acb8d0fab19@%3Ccommits.xmlgraphics.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/rc0a31867796043fbe59113fb654fe8b13309fe04f8935acb8d0fab19%40%3Ccommits.xmlgraphics.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/r9e90b4d1cf6ea87a79bb506541140dfbf4801f4463a7cee08126ee44@%3Ccommits.xmlgraphics.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/r9e90b4d1cf6ea87a79bb506541140dfbf4801f4463a7cee08126ee44%40%3Ccommits.xmlgraphics.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://issues.apache.org/jira/browse/BATIK-1222"
  }, {
    "type" : "WEB",
    "url" : "http://www.oracle.com/technetwork/security-advisory/cpujul2018-4258247.html"
  }, {
    "type" : "WEB",
    "url" : "http://www.oracle.com/technetwork/security-advisory/cpuoct2018-4428296.html"
  }, {
    "type" : "WEB",
    "url" : "http://www.securityfocus.com/bid/104252"
  }, {
    "type" : "WEB",
    "url" : "http://www.securitytracker.com/id/1040995"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-502" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-06-29T18:57:27Z",
    "nvd_published_at" : "2018-05-24T16:29:00Z"
  }
}