Summary
gmrtd ReadFile Vulnerable to Denial of Service via Excessive TLV Length Values
Unbounded TLV length in ReadFile can cause Denial of Service
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.
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
Credits
Discovered and reported by @ramrunner.
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.
Crafted input forces the application to consume excessive CPU, memory, or other resources, degrading or denying service. Typical impact: denial of service.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Already deployed Kodem?
See it in your environmentNew to Kodem? Get a demo →Remediation advice
Users should upgrade to v0.17.2 or later.
No additional mitigation is required once the library is updated.
Frequently Asked Questions
- What is CVE-2026-24738? CVE-2026-24738 is a medium-severity uncontrolled resource consumption vulnerability in github.com/gmrtd/gmrtd (go), affecting versions < 0.17.2. It is fixed in 0.17.2. Crafted input forces the application to consume excessive CPU, memory, or other resources, degrading or denying service.
- Which versions of github.com/gmrtd/gmrtd are affected by CVE-2026-24738? github.com/gmrtd/gmrtd (go) versions < 0.17.2 is affected.
- Is there a fix for CVE-2026-24738? Yes. CVE-2026-24738 is fixed in 0.17.2. Upgrade to this version or later.
- Is CVE-2026-24738 exploitable, and should I be worried? Whether CVE-2026-24738 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether CVE-2026-24738 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix CVE-2026-24738? Upgrade
github.com/gmrtd/gmrtdto 0.17.2 or later.