{"id":"CVE-2026-54638","aliases":["CVE-2026-54638","GHSA-whmm-qj9r-wvr2","GO-2026-6138"],"related":[],"kind":"vulnerability","state":"published","title":"td has pre-auth denial of service via unbounded memory allocation in proto.UnencryptedMessage.Decode","summary":"gotd/td is a T Telegram MTProto API client in Go. Prior to 0.145.1, proto.UnencryptedMessage.Decode in proto/unencrypted_message.go read attacker controlled dataLen from an unauthenticated MTProto unencrypted packet and allocated make([]byte, dataLen) before checking the remaining buffer, allowing remote unauthenticated denial of service through excessive memory allocation and CPU or garbage collection pressure. This issue is fixed in version 0.145.1.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"gotd/td is a T Telegram MTProto API client in Go. Prior to 0.145.1, proto.UnencryptedMessage.Decode in proto/unencrypted_message.go read attacker controlled dataLen from an unauthenticated MTProto unencrypted packet and allocated make([]byte, dataLen) before checking the remaining buffer, allowing remote unauthenticated denial of service through excessive memory allocation and CPU or garbage collection pressure. This issue is fixed in version 0.145.1.","source":"cvelist"},{"lang":"en","text":"### Impact\n\nA remote, unauthenticated attacker can cause excessive memory allocation (and resulting CPU / GC pressure, potentially OOM termination) by sending a crafted unencrypted MTProto packet.\n\n`(*proto.UnencryptedMessage).Decode` read an attacker-controlled 32-bit `dataLen` field and immediately allocated a buffer of that size via `make([]byte, dataLen)` **before** validating that the underlying buffer actually contained that many bytes. A 20-byte packet declaring a ~1.75 GB payload (e.g. `dataLen = 0x70000000`) forces the runtime to provision and zero-initialize a multi-gigabyte heap allocation before the length is rejected.\n\nUnencrypted messages are part of the unauthenticated MTProto handshake path, so no credentials or established session are required to reach the vulnerable code.\n\nImpact is limited to availability; there is no evidence of memory corruption, out-of-bounds access, or code execution.\n\n### Patches\n\nFixed in **v0.145.1** by validating `dataLen` against the remaining buffer length before allocation (commit `9d5d1f31e`).\n\n### Workarounds\n\nUpgrade to v0.145.1 or later. There is no in-process workaround for affected versions short of avoiding exposure of the unauthenticated MTProto parsing path to untrusted peers.","format":"markdown","source":"ghsa"},{"lang":"en","text":"Unbounded memory allocation in proto.UnencryptedMessage.Decode in github.com/gotd/td","format":"markdown","source":"go"},{"lang":"es","text":"gotd/td es un cliente API MTProto de Telegram T en Go. Antes de la versión 0.145.1, proto.UnencryptedMessage.Decode en proto/unencrypted_message.go leía un dataLen controlado por el atacante de un paquete MTProto no cifrado no autenticado y asignaba make([]byte, dataLen) antes de verificar el búfer restante, lo que permitía una denegación de servicio remota no autenticada a través de una asignación excesiva de memoria y presión de CPU o de recolección de basura. Este problema se solucionó en la versión 0.145.1.","source":"nvd"}],"published":"2026-07-28T22:14:53.550Z","modified":"2026-10-23T23:10:00.157Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"}],"cwes":["CWE-770","CWE-789"],"affected":[{"ranges":[{"version":"< 0.145.1","status":"affected"}],"vendor":"gotd","product":"td","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.145.1"}],"ecosystem":"Go","package":"github.com/gotd/td","purl":"pkg:golang/github.com/gotd/td","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.145.1"}],"ecosystem":"Go","package":"github.com/gotd/td","purl":"pkg:golang/github.com/gotd/td","source":"go"}],"references":[{"url":"https://github.com/gotd/td/security/advisories/GHSA-whmm-qj9r-wvr2","tags":["advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/gotd/td/issues/1711","tags":["report","web","x-refsource-misc"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/gotd/td/commit/9d5d1f31ea5022d9798d84ccce15de2e91ba6baa","tags":["fix","web","x-refsource-misc"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/gotd/td/releases/tag/v0.145.1","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/gotd/td","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"yes","technicalImpact":"partial","date":"2026-07-29T14:20:16.425Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-54638","url":"https://www.cve.org/CVERecord?id=CVE-2026-54638","licence":"CVE Terms of Use","modified":"2026-07-29T14:20:26.682Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-whmm-qj9r-wvr2","url":"https://github.com/advisories/GHSA-whmm-qj9r-wvr2","licence":"CC-BY-4.0","modified":"2026-08-18T17:24:12.280Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2026-6138","url":"https://pkg.go.dev/vuln/GO-2026-6138","licence":"CC-BY-4.0","modified":"2026-08-18T17:15:27.921Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-54638","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-54638","licence":"Public domain","modified":"2026-10-23T23:10:00.157Z"}],"updatedAt":"2026-11-25T22:59:30.392Z","epss":{"score":0.00346,"percentile":0.30152,"date":"2026-12-01T12:00:22.000Z"}}