CVE-2024-56522: Tecnickcom/tcpdf TCPDF Has Incorrect Comparison Vulnerability

HIGH
Advisory Identifier: GHSA-w95c-7994-ghpr
CVSS 7.5
CWE-843 CWE-697
Published
Advisory Summary

CVE-2024-56522 is a HIGH (CVSS 7.5) tcpdf has incorrect comparison vulnerability (CWE-843: Access of Resource Using Incompatible Type ('Type Confusion')) affecting Tecnickcom/tcpdf libraries in the Packagist ecosystem. The issue involves tcpdf has incorrect comparison. Remediation is available by upgrading affected packages to version 6.8.0.

CVE-2024-56522 at a Glance

CVE Identifier CVE-2024-56522
GHSA Identifier GHSA-w95c-7994-ghpr
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-843: Access of Resource Using Incompatible Type ('Type Confusion')
Affected Product Tecnickcom/tcpdf
Package Ecosystem Packagist
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-2024-56522

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

tecnickcom/tcpdf fixed: 6.8.0
Upgrade tecnickcom/tcpdf to 6.8.0
Verify Direct and Transitive Dependencies

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

inspect dependencies for tecnickcom/tcpdf

How to Check if You Are Affected

To determine whether your application is affected by CVE-2024-56522, inspect your project dependencies for Tecnickcom/tcpdf:

inspect dependencies for tecnickcom/tcpdf

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

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-843: Access of Resource Using Incompatible Type ('Type Confusion'), where the product allocates or initializes a resource such as a pointer, object, or variable using one type, but it later accesses that resource using a type that is incompatible with the original type. In Tecnickcom/tcpdf, 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

An issue was discovered in TCPDF before 6.8.0. unserializeTCPDFtag uses != (aka loose comparison) and does not use a constant-time function to compare TCPDF tag hashes.

CVE-2024-56522 Affected Tecnickcom/tcpdf Versions

1 component(s)
Fixed Versions:
6.8.0
Product / Package Ecosystem Affected Versions Fixed Version
tecnickcom/tcpdf
Packagist
< 6.8.0
6.8.0

References

Frequently Asked Questions

What is CVE-2024-56522?
CVE-2024-56522 is a security vulnerability in Tecnickcom/tcpdf involving TCPDF has incorrect comparison under CWE-843: Access of Resource Using Incompatible Type ('Type Confusion').
Which Tecnickcom/tcpdf versions are affected?
Affected versions include releases prior to 6.8.0 across affected packages: tecnickcom/tcpdf.
What version fixes CVE-2024-56522?
Upgrading to 6.8.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is tecnickcom/tcpdf affected?
Yes, tecnickcom/tcpdf is affected in releases prior to 6.8.0. Upgrade your dependency to 6.8.0 or later.
What is the CVSS score of CVE-2024-56522?
CVE-2024-56522 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-2024-56522?
CVE-2024-56522 is classified under CWE-843: Access of Resource Using Incompatible Type ('Type Confusion') (The product allocates or initializes a resource such as a pointer, object, or variable using one type, but it later accesses that resource using a type that is incompatible with the original type.).
How can I check Packagist dependencies for CVE-2024-56522?
Run the dependency tree command: 'inspect dependencies for tecnickcom/tcpdf'. 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-w95c-7994-ghpr",
  "modified" : "2025-11-03T22:53:58Z",
  "published" : "2024-12-27T06:30:48Z",
  "aliases" : [ "CVE-2024-56522" ],
  "summary" : "TCPDF has incorrect comparison",
  "details" : "An issue was discovered in TCPDF before 6.8.0. unserializeTCPDFtag uses != (aka loose comparison) and does not use a constant-time function to compare TCPDF tag hashes.",
  "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" : "Packagist",
      "name" : "tecnickcom/tcpdf"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "6.8.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-56522"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/tecnickcom/TCPDF/commit/d54b97cec33f4f1a5ad81119a82085cad93cec89"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/tecnickcom/TCPDF"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/tecnickcom/TCPDF/compare/6.7.8...6.8.0"
  }, {
    "type" : "WEB",
    "url" : "https://lists.debian.org/debian-lts-announce/2025/06/msg00004.html"
  }, {
    "type" : "WEB",
    "url" : "https://tcpdf.org"
  }, {
    "type" : "WEB",
    "url" : "https://www.php.net/manual/en/types.comparisons.php"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-697", "CWE-843" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-12-27T21:07:22Z",
    "nvd_published_at" : "2024-12-27T05:15:08Z"
  }
}