GHSA-whmm-qj9r-wvr2

Suggest an improvement
Source
https://github.com/advisories/GHSA-whmm-qj9r-wvr2
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/07/GHSA-whmm-qj9r-wvr2/GHSA-whmm-qj9r-wvr2.json
JSON Data
https://api.test.osv.dev/v1/vulns/GHSA-whmm-qj9r-wvr2
Aliases
Published
2026-07-28T22:15:28Z
Modified
2026-08-18T17:26:19Z
Severity
  • 7.5 (High) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H CVSS Calculator
Summary
td has pre-auth denial of service via unbounded memory allocation in proto.UnencryptedMessage.Decode
Details

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.

Database specific
{
    "cwe_ids": [
        "CWE-770",
        "CWE-789"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-07-28T22:15:28Z",
    "nvd_published_at": null,
    "severity": "HIGH"
}
References

Affected packages

Go / github.com/gotd/td

Package

Name
github.com/gotd/td
View open source insights on deps.dev
Purl
pkg:golang/github.com/gotd/td

Affected ranges

Type
SEMVER
Events
Introduced
0 Unknown introduced version / All previous versions are affected
Fixed
0.145.1

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/07/GHSA-whmm-qj9r-wvr2/GHSA-whmm-qj9r-wvr2.json"