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.
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:
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.
Applications using gmrtd to read data from NFC or APDU sources may experience:
No confidentiality or data integrity impact has been identified.
This issue has been resolved in v0.17.2.
The fix introduces:
Users should upgrade to v0.17.2 or later.
No additional mitigation is required once the library is updated.
Discovered and reported by @ramrunner.
{
"github_reviewed_at": "2026-01-27T00:57:19Z",
"severity": "MODERATE",
"cwe_ids": [
"CWE-400",
"CWE-770"
],
"github_reviewed": true,
"nvd_published_at": "2026-01-27T21:16:03Z"
}