+ "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**.",
0 commit comments