CWE-122
Weakness AllowedHeap-based Buffer Overflow
Abstraction: Variant · Status: Draft
The product writes past the end of a buffer that was allocated on the heap.
Mapping guidance
This CWE entry is at the Variant level of abstraction, which is a preferred level of abstraction for mapping to the root causes of vulnerabilities.
Carefully read both the name and description to ensure that this mapping is an appropriate fit. Do not try to 'force' a mapping to a lower-level Base/Variant simply to comply with this preferred level of abstraction.
Modes of introduction
Detection methods
Fuzzing
Fuzz testing (fuzzing) is a powerful technique for generating large numbers of diverse inputs - either randomly or algorithmically - and dynamically invoking the code with those inputs. Even with random inputs, it is often capable of generating unexpected results such as crashes, memory corruption, or resource consumption. Fuzzing effectively produces repeatable test cases that clearly indicate bugs, which helps developers to diagnose the issues.
Effectiveness: High
Automated Dynamic Analysis
Use tools that are integrated during compilation to insert runtime error-checking mechanisms related to memory safety errors, such as AddressSanitizer (ASan) for C/C++ [REF-1518].
Effectiveness: Moderate
Crafted inputs are necessary to reach the code containing the error, such as generated by fuzzers. Also, these tools may reduce performance, and they only report the error condition - not the original mistake that led to the error.
Notes
Terminology
There is significant inconsistency regarding the "buffer overflow" term, which can have multiple interpretations and uses. Many people mean "writing past the end of a buffer." Others mean "writing past the end of a buffer, or before the beginning of a buffer." Still others might include "read" in the term.
Content history
Contributed or reviewed taxonomy mappings for ISA/IEC 62443
updated Potential_Mitigations, Time_of_Introduction
added/updated white box definitions
updated Applicable_Platforms, Common_Consequences, Relationships, Other_Notes, Taxonomy_Mappings, Weakness_Ordinalities
updated Common_Consequences, Other_Notes, Relationship_Notes
updated Common_Consequences, Relationships
updated Relationships
updated References
updated Common_Consequences
updated Demonstrative_Examples, References, Relationships
updated Demonstrative_Examples
updated Demonstrative_Examples, Potential_Mitigations
updated Observed_Examples
updated Relationships, Taxonomy_Mappings
updated Causal_Nature, Likelihood_of_Exploit, Observed_Examples, References, Relationships, Taxonomy_Mappings, White_Box_Definitions
updated References
updated Relationships
updated Relationships
updated References
updated Observed_Examples
updated Detection_Factors, Potential_Mitigations, References, Relationships, Time_of_Introduction
updated Mapping_Notes
updated Observed_Examples
updated Observed_Examples, Taxonomy_Mappings
updated Applicable_Platforms
updated Functional_Areas, References
updated Alternate_Terms, Applicable_Platforms, Detection_Factors, Observed_Examples, References, Relationship_Notes, Terminology_Notes
updated Relationships
updated Description, Diagram
7164 vulnerabilities reference this CWE, most recent first.
GHSA-Q67P-8XJR-9RWQ
Vulnerability from github – Published: 2026-07-14 18:32 – Updated: 2026-07-14 18:32Heap-based buffer overflow in Windows Print Spooler Components allows an authorized attacker to elevate privileges locally.
{
"affected": [],
"aliases": [
"CVE-2026-50499"
],
"database_specific": {
"cwe_ids": [
"CWE-122"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2026-07-14T18:17:56Z",
"severity": "HIGH"
},
"details": "Heap-based buffer overflow in Windows Print Spooler Components allows an authorized attacker to elevate privileges locally.",
"id": "GHSA-q67p-8xjr-9rwq",
"modified": "2026-07-14T18:32:28Z",
"published": "2026-07-14T18:32:28Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-50499"
},
{
"type": "WEB",
"url": "https://msrc.microsoft.com/update-guide/vulnerability/CVE-2026-50499"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-Q6CX-465R-334M
Vulnerability from github – Published: 2026-07-14 18:32 – Updated: 2026-07-14 18:32Heap-based buffer overflow in Remote Desktop Client allows an unauthorized attacker to execute code over a network.
{
"affected": [],
"aliases": [
"CVE-2026-54990"
],
"database_specific": {
"cwe_ids": [
"CWE-122"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2026-07-14T17:17:06Z",
"severity": "CRITICAL"
},
"details": "Heap-based buffer overflow in Remote Desktop Client allows an unauthorized attacker to execute code over a network.",
"id": "GHSA-q6cx-465r-334m",
"modified": "2026-07-14T18:32:08Z",
"published": "2026-07-14T18:32:08Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-54990"
},
{
"type": "WEB",
"url": "https://msrc.microsoft.com/update-guide/vulnerability/CVE-2026-54990"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-Q6F4-2QXX-8CWW
Vulnerability from github – Published: 2026-02-12 21:31 – Updated: 2026-02-27 00:31A heap buffer overflow in the processRequest function of Open TFTP Server MultiThreaded v1.7 allows attackers to cause a Denial of Service (DoS) via a crafted DATA packet.
{
"affected": [],
"aliases": [
"CVE-2025-67433"
],
"database_specific": {
"cwe_ids": [
"CWE-122"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2026-02-12T20:16:02Z",
"severity": "HIGH"
},
"details": "A heap buffer overflow in the processRequest function of Open TFTP Server MultiThreaded v1.7 allows attackers to cause a Denial of Service (DoS) via a crafted DATA packet.",
"id": "GHSA-q6f4-2qxx-8cww",
"modified": "2026-02-27T00:31:44Z",
"published": "2026-02-12T21:31:27Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2025-67433"
},
{
"type": "WEB",
"url": "https://gist.github.com/Hyobin/f1b7d48d29e60a378bb9c88ba8b8080a"
},
{
"type": "WEB",
"url": "https://gist.github.com/transparencybeam/f1b7d48d29e60a378bb9c88ba8b8080a"
},
{
"type": "WEB",
"url": "https://sourceforge.net/projects/tftp-server/files/tftp%20server%20multithreaded"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-Q6MJ-3XWF-WJGV
Vulnerability from github – Published: 2026-09-08 15:31 – Updated: 2026-09-09 18:31CommServe contained a heap-based buffer overflow issue affecting service availability. Software customers upgrade to resolved maintenance release. Update CommServe.
{
"affected": [],
"aliases": [
"CVE-2026-77102"
],
"database_specific": {
"cwe_ids": [
"CWE-122"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2026-09-08T13:17:25Z",
"severity": "HIGH"
},
"details": "CommServe contained a heap-based buffer overflow issue affecting service availability. Software customers upgrade to resolved maintenance release. Update CommServe.",
"id": "GHSA-q6mj-3xwf-wjgv",
"modified": "2026-09-09T18:31:19Z",
"published": "2026-09-08T15:31:54Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-77102"
},
{
"type": "WEB",
"url": "https://documentation.commvault.com/securityadvisories/CV_2026_08_4.html"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H",
"type": "CVSS_V3"
},
{
"score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X",
"type": "CVSS_V4"
}
]
}
GHSA-Q6PP-VPRG-P5G9
Vulnerability from github – Published: 2022-05-24 19:17 – Updated: 2022-08-22 00:00vim is vulnerable to Heap-based Buffer Overflow
{
"affected": [],
"aliases": [
"CVE-2021-3875"
],
"database_specific": {
"cwe_ids": [
"CWE-122",
"CWE-787"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2021-10-15T14:15:00Z",
"severity": "HIGH"
},
"details": "vim is vulnerable to Heap-based Buffer Overflow",
"id": "GHSA-q6pp-vprg-p5g9",
"modified": "2022-08-22T00:00:54Z",
"published": "2022-05-24T19:17:43Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2021-3875"
},
{
"type": "WEB",
"url": "https://github.com/vim/vim/commit/35a319b77f897744eec1155b736e9372c9c5575f"
},
{
"type": "WEB",
"url": "https://huntr.dev/bounties/5cdbc168-6ba1-4bc2-ba6c-28be12166a53"
},
{
"type": "WEB",
"url": "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/7K4JJBIH3OQSZRVTWKCJCDLGMFGQ5DOH"
},
{
"type": "WEB",
"url": "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/S42L4Z4DTW4LHLQ4FJ33VEOXRCBE7WN4"
},
{
"type": "WEB",
"url": "https://security.gentoo.org/glsa/202208-32"
},
{
"type": "WEB",
"url": "http://www.openwall.com/lists/oss-security/2022/01/15/1"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-Q6WR-5CJV-CQVH
Vulnerability from github – Published: 2024-04-09 18:30 – Updated: 2024-04-09 18:30Microsoft OLE DB Driver for SQL Server Remote Code Execution Vulnerability
{
"affected": [],
"aliases": [
"CVE-2024-29983"
],
"database_specific": {
"cwe_ids": [
"CWE-122"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2024-04-09T17:16:01Z",
"severity": "HIGH"
},
"details": "Microsoft OLE DB Driver for SQL Server Remote Code Execution Vulnerability",
"id": "GHSA-q6wr-5cjv-cqvh",
"modified": "2024-04-09T18:30:28Z",
"published": "2024-04-09T18:30:28Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-29983"
},
{
"type": "WEB",
"url": "https://msrc.microsoft.com/update-guide/vulnerability/CVE-2024-29983"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-Q72M-F2R4-W4CW
Vulnerability from github – Published: 2026-09-08 18:32 – Updated: 2026-09-08 21:06Duplicate Advisory
This advisory has been withdrawn because it is a duplicate of GHSA-2j8r-3c22-8565. This link is maintained to preserve external references.
Original Description
Heap-based buffer overflow in Visual Studio allows an unauthorized attacker to execute code over a network.
{
"affected": [
{
"database_specific": {
"last_known_affected_version_range": "\u003c= 18.9.0-beta1.26405.1"
},
"package": {
"ecosystem": "NuGet",
"name": "Microsoft.DiaSymReader.Native"
},
"ranges": [
{
"events": [
{
"introduced": "17.10.0-beta1.24272.1"
},
{
"fixed": "18.9.0-beta1.26405.2"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [],
"database_specific": {
"cwe_ids": [
"CWE-122"
],
"github_reviewed": true,
"github_reviewed_at": "2026-09-08T21:06:05Z",
"nvd_published_at": "2026-09-08T18:19:19Z",
"severity": "HIGH"
},
"details": "### Duplicate Advisory\nThis advisory has been withdrawn because it is a duplicate of GHSA-2j8r-3c22-8565. This link is maintained to preserve external references.\n\n### Original Description\nHeap-based buffer overflow in Visual Studio allows an unauthorized attacker to execute code over a network.",
"id": "GHSA-q72m-f2r4-w4cw",
"modified": "2026-09-08T21:06:05Z",
"published": "2026-09-08T18:32:43Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-69522"
},
{
"type": "WEB",
"url": "https://msrc.microsoft.com/update-guide/vulnerability/CVE-2026-69522"
},
{
"type": "PACKAGE",
"url": "https://www.nuget.org/packages/Microsoft.DiaSymReader.Native"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
],
"summary": "Duplicate Advisory: Microsoft Security Advisory CVE-2026-69522 \u2013 .NET and Visual Studio Remote Code Execution Vulnerability",
"withdrawn": "2026-09-08T21:06:05Z"
}
GHSA-Q774-GVH6-H2CC
Vulnerability from github – Published: 2025-11-11 18:30 – Updated: 2025-11-11 18:30Heap-based buffer overflow in Windows Subsystem for Linux GUI allows an unauthorized attacker to execute code over a network.
{
"affected": [],
"aliases": [
"CVE-2025-62220"
],
"database_specific": {
"cwe_ids": [
"CWE-122"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2025-11-11T18:15:49Z",
"severity": "HIGH"
},
"details": "Heap-based buffer overflow in Windows Subsystem for Linux GUI allows an unauthorized attacker to execute code over a network.",
"id": "GHSA-q774-gvh6-h2cc",
"modified": "2025-11-11T18:30:23Z",
"published": "2025-11-11T18:30:23Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2025-62220"
},
{
"type": "WEB",
"url": "https://msrc.microsoft.com/update-guide/vulnerability/CVE-2025-62220"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-Q7GX-445J-XWQ8
Vulnerability from github – Published: 2025-09-08 15:37 – Updated: 2025-11-05 00:31Cpanel::JSON::XS before version 4.40 for Perl has an integer buffer overflow causing a segfault when parsing crafted JSON, enabling denial-of-service attacks or other unspecified impact
{
"affected": [],
"aliases": [
"CVE-2025-40929"
],
"database_specific": {
"cwe_ids": [
"CWE-122"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2025-09-08T15:15:35Z",
"severity": "MODERATE"
},
"details": "Cpanel::JSON::XS before version 4.40 for Perl has an integer buffer overflow causing a segfault when parsing crafted JSON, enabling denial-of-service attacks or other unspecified impact",
"id": "GHSA-q7gx-445j-xwq8",
"modified": "2025-11-05T00:31:26Z",
"published": "2025-09-08T15:37:45Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2025-40929"
},
{
"type": "WEB",
"url": "https://github.com/rurban/Cpanel-JSON-XS/commit/378236219eaa35742c3962ecbdee364903b0a1f2.patch"
},
{
"type": "WEB",
"url": "https://lists.debian.org/debian-lts-announce/2025/09/msg00034.html"
},
{
"type": "WEB",
"url": "https://metacpan.org/release/RURBAN/Cpanel-JSON-XS-4.39/source/XS.xs#L713"
},
{
"type": "WEB",
"url": "https://metacpan.org/release/RURBAN/Cpanel-JSON-XS-4.40/changes"
},
{
"type": "WEB",
"url": "http://www.openwall.com/lists/oss-security/2025/09/08/1"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:L",
"type": "CVSS_V3"
}
]
}
GHSA-Q7M2-R25P-88M7
Vulnerability from github – Published: 2026-10-13 21:34 – Updated: 2026-10-13 21:34Heap-based buffer overflow in Windows Client-Side Caching (CSC) Service allows an authorized attacker to elevate privileges locally.
{
"affected": [],
"aliases": [
"CVE-2026-83698"
],
"database_specific": {
"cwe_ids": [
"CWE-122"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2026-10-13T19:20:13Z",
"severity": "HIGH"
},
"details": "Heap-based buffer overflow in Windows Client-Side Caching (CSC) Service allows an authorized attacker to elevate privileges locally.",
"id": "GHSA-q7m2-r25p-88m7",
"modified": "2026-10-13T21:34:40Z",
"published": "2026-10-13T21:34:40Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-83698"
},
{
"type": "WEB",
"url": "https://msrc.microsoft.com/update-guide/vulnerability/CVE-2026-83698"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
Mitigation
Pre-design: Use a language or compiler that performs automatic bounds checking.
Mitigation
Use an abstraction library to abstract away risky APIs. Not a complete solution.
Mitigation MIT-10
Strategy: Environment Hardening
- Use automatic buffer overflow detection mechanisms that are offered by certain compilers or compiler extensions. Examples include: the Microsoft Visual Studio /GS flag, Fedora/Red Hat FORTIFY_SOURCE GCC flag, StackGuard, and ProPolice, which provide various mechanisms including canary-based detection and range/index checking.
- D3-SFCV (Stack Frame Canary Validation) from D3FEND [REF-1334] discusses canary-based detection in detail.
Mitigation MIT-11
Strategy: Environment Hardening
- Run or compile the software using features or extensions that randomly arrange the positions of a program's executable and libraries in memory. Because this makes the addresses unpredictable, it can prevent an attacker from reliably jumping to exploitable code.
- Examples include Address Space Layout Randomization (ASLR) [REF-58] [REF-60] and Position-Independent Executables (PIE) [REF-64]. Imported modules may be similarly realigned if their default memory addresses conflict with other modules, in a process known as "rebasing" (for Windows) and "prelinking" (for Linux) [REF-1332] using randomly generated addresses. ASLR for libraries cannot be used in conjunction with prelink since it would require relocating the libraries at run-time, defeating the whole purpose of prelinking.
- For more information on these techniques see D3-SAOR (Segment Address Offset Randomization) from D3FEND [REF-1335].
Mitigation
Implement and perform bounds checking on input.
Mitigation
Strategy: Libraries or Frameworks
Do not use dangerous functions such as gets. Look for their safe equivalent, which checks for the boundary.
Mitigation
Use OS-level preventative functionality. This is not a complete solution, but it provides some defense in depth.
CAPEC-92: Forced Integer Overflow
This attack forces an integer variable to go out of range. The integer variable is often used as an offset such as size of memory allocation or similarly. The attacker would typically control the value of such variable and try to get it out of range. For instance the integer in question is incremented past the maximum possible value, it may wrap to become a very small, or negative number, therefore providing a very incorrect value which can lead to unexpected behavior. At worst the attacker can execute arbitrary code.