CVE-2022-24197: Itext7 core Out-of-bounds Write Vulnerability

MODERATE
Advisory Identifier: GHSA-c32g-2mgr-cfq7
CVSS 6.5
CWE-787
Published
Advisory Summary

CVE-2022-24197 is a MODERATE (CVSS 6.5) out-of-bounds write vulnerability (CWE-787: Out-of-bounds Write) affecting Itext7 core libraries in the Maven ecosystem. The issue involves out-of-bounds write in itext. Remediation is available by upgrading affected packages to version 7.1.18.

CVE-2022-24197 at a Glance

CVE Identifier CVE-2022-24197
GHSA Identifier GHSA-c32g-2mgr-cfq7
Severity MODERATE
CVSS v3.1 Base Score 6.5
CWE Classification CWE-787: Out-of-bounds Write
Affected Product Itext7 core
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 6.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:R/S:U/C:N/I:N/A:H).

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

How to Fix CVE-2022-24197

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

com.itextpdf:itext7-core fixed: 7.1.18
<dependency>
    <groupId>com.itextpdf</groupId>
    <artifactId>itext7-core</artifactId>
    <version>7.1.18</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=com.itextpdf

How to Check if You Are Affected

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

mvn dependency:tree -Dincludes=com.itextpdf

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

Note: The mvn dependency:tree -Dincludes=com.itextpdf 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-787: Out-of-bounds Write, where the product writes data past the end, or before the beginning, of the intended buffer. In Itext7 core, 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

iText v7.1.17 was discovered to contain a stack-based buffer overflow via the component ByteBuffer.append, which allows attackers to cause a Denial of Service (DoS) via a crafted PDF file.

CVE-2022-24197 Affected Itext7 core Versions

1 component(s)
Fixed Versions:
7.1.18
Product / Package Ecosystem Affected Versions Fixed Version
com.itextpdf:itext7-core
Maven
< 7.1.18
7.1.18

References

Frequently Asked Questions

What is CVE-2022-24197?
CVE-2022-24197 is a security vulnerability in Itext7 core involving Out-of-bounds Write in iText under CWE-787: Out-of-bounds Write.
Which Itext7 core versions are affected?
Affected versions include releases prior to 7.1.18 across affected packages: com.itextpdf:itext7-core.
What version fixes CVE-2022-24197?
Upgrading to 7.1.18 (or the latest patched release for your respective branch) resolves the vulnerability.
Is itext7-core affected?
Yes, com.itextpdf:itext7-core is affected in releases prior to 7.1.18. Upgrade your dependency to 7.1.18 or later.
What is the CVSS score of CVE-2022-24197?
CVE-2022-24197 has a CVSS v3.1 base score of 6.5 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2022-24197?
CVE-2022-24197 is classified under CWE-787: Out-of-bounds Write (The product writes data past the end, or before the beginning, of the intended buffer.).
How can I check Maven dependencies for CVE-2022-24197?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=com.itextpdf'. 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-c32g-2mgr-cfq7",
  "modified" : "2022-02-07T20:59:22Z",
  "published" : "2022-02-02T00:01:45Z",
  "aliases" : [ "CVE-2022-24197" ],
  "summary" : "Out-of-bounds Write in iText",
  "details" : "iText v7.1.17 was discovered to contain a stack-based buffer overflow via the component ByteBuffer.append, which allows attackers to cause a Denial of Service (DoS) via a crafted PDF file.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "com.itextpdf:itext7-core"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "7.1.18"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 7.1.17"
    }
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-24197"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/itext/itext7/pull/78"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/itext/itext7/pull/78#issuecomment-1089282165"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/itext/itext7"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/itext/itext7/releases/tag/7.1.18"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-787" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-02-07T20:59:22Z",
    "nvd_published_at" : "2022-02-01T20:15:00Z"
  }
}