{"id":"CVE-2026-24738","aliases":["CVE-2026-24738","GHSA-j49h-6577-5xwq","GO-2026-4379"],"related":[],"kind":"vulnerability","state":"published","title":"gmrtd ReadFile Vulnerable to Denial of Service via Excessive TLV Length Values","summary":"gmrtd is a Go library for reading Machine Readable Travel Documents (MRTDs). Prior to version 0.17.2, ReadFile accepts TLVs with lengths that can range up to 4GB, which can cause unconstrained resource consumption in both memory and cpu cycles. ReadFile can consume an extended TLV with lengths well outside what would be available in ICs. It can accept something all the way up to 4GB which would take too many iterations in 256 byte chunks, and would also try to allocate memory that might not be available in constrained environments like phones. Or if an API sends data  to ReadFile, the same problem applies. The very small chunked read also locks the goroutine in  accepting data for a very large number of iterations.  projects using the gmrtd library to read files from NFCs can experience extreme slowdowns or memory consumption. A malicious NFC can just behave like the mock transceiver described above and by just sending dummy bytes as each chunk to be read, can make the receiving thread unresponsive and fill up memory on the host system. Version 0.17.2 patches the issue.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"gmrtd is a Go library for reading Machine Readable Travel Documents (MRTDs). Prior to version 0.17.2, ReadFile accepts TLVs with lengths that can range up to 4GB, which can cause unconstrained resource consumption in both memory and cpu cycles. ReadFile can consume an extended TLV with lengths well outside what would be available in ICs. It can accept something all the way up to 4GB which would take too many iterations in 256 byte chunks, and would also try to allocate memory that might not be available in constrained environments like phones. Or if an API sends data  to ReadFile, the same problem applies. The very small chunked read also locks the goroutine in  accepting data for a very large number of iterations.  projects using the gmrtd library to read files from NFCs can experience extreme slowdowns or memory consumption. A malicious NFC can just behave like the mock transceiver described above and by just sending dummy bytes as each chunk to be read, can make the receiving thread unresponsive and fill up memory on the host system. Version 0.17.2 patches the issue.","source":"cvelist"},{"lang":"en","text":"# 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**.","format":"markdown","source":"ghsa"},{"lang":"en","text":"gmrtd ReadFile Vulnerable to Denial of Service via Excessive TLV Length Values in github.com/gmrtd/gmrtd","format":"markdown","source":"go"},{"lang":"es","text":"gmrtd es una librería Go para leer Documentos de Viaje de Lectura Mecánica (MRTDs). Antes de la versión 0.17.2, ReadFile acepta TLVs con longitudes que pueden oscilar hasta 4GB, lo que puede causar un consumo de recursos sin restricciones tanto en memoria como en ciclos de CPU. ReadFile puede consumir un TLV extendido con longitudes muy superiores a lo que estaría disponible en los ICs. Puede aceptar algo de hasta 4GB, lo que requeriría demasiadas iteraciones en bloques de 256 bytes, y también intentaría asignar memoria que podría no estar disponible en entornos restringidos como los teléfonos. O si una API envía datos a ReadFile, el mismo problema se aplica. La lectura en bloques muy pequeños también bloquea la goroutine al aceptar datos durante un número muy grande de iteraciones. Los proyectos que utilizan la librería gmrtd para leer archivos de NFCs pueden experimentar ralentizaciones extremas o consumo de memoria. Un NFC malicioso puede simplemente comportarse como el transceptor simulado descrito anteriormente y, simplemente enviando bytes ficticios como cada bloque a leer, puede hacer que el hilo receptor no responda y llenar la memoria del sistema anfitrión. La versión 0.17.2 corrige el problema.","source":"nvd"}],"published":"2026-01-27T00:57:19.000Z","modified":"2026-06-17T10:23:30.700Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"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","score":5.9,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"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","score":5.9,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"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","rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":6.5,"rating":"MEDIUM"}],"cwes":["CWE-400","CWE-770"],"affected":[{"ranges":[{"version":"< 0.17.2","status":"affected"}],"vendor":"gmrtd","product":"gmrtd","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.17.2"}],"ecosystem":"Go","package":"github.com/gmrtd/gmrtd","purl":"pkg:golang/github.com/gmrtd/gmrtd","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.17.2"}],"ecosystem":"Go","package":"github.com/gmrtd/gmrtd","purl":"pkg:golang/github.com/gmrtd/gmrtd","source":"go"},{"ranges":[{"status":"affected","fixed":"0.17.2"}],"vendor":"gmrtd","product":"gmrtd","cpe":"cpe:2.3:a:gmrtd:gmrtd:*:*:*:*:*:go:*:*","source":"nvd"}],"references":[{"url":"https://github.com/gmrtd/gmrtd/security/advisories/GHSA-j49h-6577-5xwq","tags":["advisory","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/gmrtd/gmrtd/commit/54469a95e5a20a8602ac1457b2110bfeb80c8891","tags":["fix","patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/gmrtd/gmrtd/releases/tag/v0.17.2","tags":["product","release-notes","web","x-refsource-misc"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-24738","tags":["advisory"],"sources":["ghsa","go"]},{"url":"https://github.com/gmrtd/gmrtd","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-01-28T15:16:00.633Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-24738","url":"https://www.cve.org/CVERecord?id=CVE-2026-24738","licence":"CVE Terms of Use","modified":"2026-01-28T15:16:31.785Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-j49h-6577-5xwq","url":"https://github.com/advisories/GHSA-j49h-6577-5xwq","licence":"CC-BY-4.0","modified":"2026-02-03T03:05:45.673Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2026-4379","url":"https://pkg.go.dev/vuln/GO-2026-4379","licence":"CC-BY-4.0","modified":"2026-03-03T04:57:55.473Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-24738","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-24738","licence":"Public domain","modified":"2026-06-17T10:23:30.700Z"}],"updatedAt":"2026-11-25T22:59:13.243Z","epss":{"score":0.00281,"percentile":0.2214,"date":"2026-12-01T12:00:22.000Z"}}