GHSA-J49H-6577-5XWQ

Vulnerability from github – Published: 2026-01-27 00:57 – Updated: 2026-01-27 00:57
VLAI?
Summary
gmrtd ReadFile Vulnerable to Denial of Service via Excessive TLV Length Values
Details

Unbounded TLV length in ReadFile can cause Denial of Service

Summary

A Denial of Service vulnerability was identified in ReadFile() where unbounded TLV length values could lead to excessive CPU and memory usage when processing data from a malicious or non-compliant NFC source. This issue has been fixed by enforcing strict limits on acceptable TLV lengths.

Affected Versions

  • Affected: All versions prior to v0.17.2
  • Fixed in: v0.17.2

Details

ReadFile() processes BER-TLV encoded data returned from an NFC or APDU source via a Transceiver interface. Prior to the fix, the implementation did not enforce an upper bound on long-form TLV length values.

A malicious or non-compliant NFC endpoint could advertise an excessively large length (up to 4 GB), causing the library to:

  • Perform a very large number of read iterations
  • Allocate excessive memory
  • Consume significant CPU resources
  • Block execution for an extended period

While such lengths are unrealistic for compliant MRTD or ISO 7816 devices, they can be produced by emulated or malicious sources, or by untrusted inputs routed through higher-level APIs.

Impact

Applications using gmrtd to read data from NFC or APDU sources may experience:

  • Excessive CPU usage
  • Memory exhaustion
  • Application hangs or denial of service

No confidentiality or data integrity impact has been identified.

Resolution

This issue has been resolved in v0.17.2.

The fix introduces:

  • Enforcement of maximum allowable TLV lengths
  • Upper bounds on the number of read operations required to retrieve a file
  • Rejection of APDUs that exceed the requested response length

Recommendation

Users should upgrade to v0.17.2 or later.

No additional mitigation is required once the library is updated.

Credits

Discovered and reported by @ramrunner.

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "Go",
        "name": "github.com/gmrtd/gmrtd"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "0.17.2"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2026-24738"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-400",
      "CWE-770"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-01-27T00:57:19Z",
    "nvd_published_at": null,
    "severity": "MODERATE"
  },
  "details": "# Unbounded TLV length in ReadFile can cause Denial of Service\n\n## Summary\n\nA Denial of Service vulnerability was identified in `ReadFile()` where unbounded TLV length values could lead to excessive CPU and memory usage when processing data from a malicious or non-compliant NFC source. This issue has been fixed by enforcing strict limits on acceptable TLV lengths.\n\n## Affected Versions\n\n- **Affected:** All versions prior to **v0.17.2**\n- **Fixed in:** **v0.17.2**\n\n## Details\n\n`ReadFile()` processes BER-TLV encoded data returned from an NFC or APDU source via a `Transceiver` interface. Prior to the fix, the implementation did not enforce an upper bound on long-form TLV length values.\n\nA malicious or non-compliant NFC endpoint could advertise an excessively large length (up to 4 GB), causing the library to:\n\n- Perform a very large number of read iterations  \n- Allocate excessive memory  \n- Consume significant CPU resources  \n- Block execution for an extended period  \n\nWhile such lengths are unrealistic for compliant MRTD or ISO 7816 devices, they can be produced by emulated or malicious sources, or by untrusted inputs routed through higher-level APIs.\n\n## Impact\n\nApplications using `gmrtd` to read data from NFC or APDU sources may experience:\n\n- Excessive CPU usage  \n- Memory exhaustion  \n- Application hangs or denial of service  \n\nNo confidentiality or data integrity impact has been identified.\n\n## Resolution\n\nThis issue has been resolved in **v0.17.2**.\n\nThe fix introduces:\n\n- Enforcement of maximum allowable TLV lengths  \n- Upper bounds on the number of read operations required to retrieve a file  \n- Rejection of APDUs that exceed the requested response length  \n\n## Recommendation\n\nUsers should **upgrade to v0.17.2 or later**.\n\nNo additional mitigation is required once the library is updated.\n\n## Credits\n\nDiscovered and reported by **@ramrunner**.",
  "id": "GHSA-j49h-6577-5xwq",
  "modified": "2026-01-27T00:57:19Z",
  "published": "2026-01-27T00:57:19Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/gmrtd/gmrtd/security/advisories/GHSA-j49h-6577-5xwq"
    },
    {
      "type": "WEB",
      "url": "https://github.com/gmrtd/gmrtd/commit/54469a95e5a20a8602ac1457b2110bfeb80c8891"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/gmrtd/gmrtd"
    },
    {
      "type": "WEB",
      "url": "https://github.com/gmrtd/gmrtd/releases/tag/v0.17.2"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:4.0/AV:A/AC:L/AT:P/PR:N/UI:P/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N",
      "type": "CVSS_V4"
    }
  ],
  "summary": "gmrtd ReadFile Vulnerable to Denial of Service via Excessive TLV Length Values"
}


Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Sightings

Author Source Type Date

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.


Loading…

Detection rules are retrieved from Rulezet.

Loading…

Loading…