td has pre-auth denial of service via unbounded memory allocation in proto.UnencryptedMessage.DecodeGHSA-whmm-qj9r-wvr2
HIGHFix: gotd/td@9d5d1f3GHSA-whmm-qj9r-wvr2 is a high-severity (CVSS 7.5) CWE-770 vulnerability in github.com/gotd/td. A fix is available for github.com/gotd/td — see the affected versions and patch details below.
Exploitation Status
No confirmed exploitation observed yet
- CISA assesses this as automatable — exploitation doesn’t require manual, per-target effort, which raises the odds of mass scanning and opportunistic attacks.
- CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.
Exploitation and automatability from CISA’s SSVC triage for GHSA-whmm-qj9r-wvr2.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
GHSA-whmm-qj9r-wvr2 by exploitation likelihood (EPSS) against impact (CVSS). Outside the shaded patch-first corner.
Where this sits among everything scored
Of 396,257 CVEs with a current EPSS score, this one falls in the < 10% band (highlighted). Counts from FIRST.org, log-scaled.
Real-World Exposure
github.com/gotd/tdReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects Go packages — download data is not available via public APIs for these ecosystems.
Description
Impact
A remote, unauthenticated attacker can cause excessive memory allocation (and resulting CPU / GC pressure, potentially OOM termination) by sending a crafted unencrypted MTProto packet.
(*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.
Unencrypted messages are part of the unauthenticated MTProto handshake path, so no credentials or established session are required to reach the vulnerable code.
Impact is limited to availability; there is no evidence of memory corruption, out-of-bounds access, or code execution.
Patches
Fixed in v0.145.1 by validating dataLen against the remaining buffer length before allocation (commit 9d5d1f31e).
Workarounds
Upgrade 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.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐹Go | github.com/gotd/td | all versions | 0.145.1go get github.com/gotd/td@v0.145.1 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for github.com/gotd/td, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update github.com/gotd/td to 0.145.1 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-whmm-qj9r-wvr2 is resolved across your whole dependency graph.
Workarounds
Stop feeding it untrusted input: reject or quarantine files and payloads from unverified sources until you can upgrade, restrict accepted formats to the ones you actually need, and run the parsing or decoding step in a least-privileged sandbox or short-lived worker so a crash or corrupted read cannot reach the rest of the process.
Frequently Asked Questions
Is GHSA-whmm-qj9r-wvr2 in your dependencies?
Find it across Go, including transitive dependencies.