CWE-126: Buffer Over-read
The product reads from a buffer using buffer access mechanisms such as indexes or pointers that reference memory locations after the targeted buffer.
Last updated
Overview
CWE-126 (Buffer Over-read) is a variant-level software weakness catalogued by MITRE in the Common Weakness Enumeration (CWE). It describes a recurring type of mistake that can lead to exploitable security vulnerabilities.
Real-world CVEs
481 recorded CVEs are caused by CWE-126 (Buffer Over-read). The highest-severity and most recent are shown first. 93 new CWE-126 CVEs have been recorded so far in 2026 (115 in 2025).
- CVE-2024-49839Critical · CVSS 9.8 · EPSS 22th2025-02-03
- CVE-2023-36397
Windows Pragmatic General Multicast (PGM) Remote Code Execution Vulnerability
Critical · CVSS 9.8 · EPSS 97th2023-11-14 - CVE-2023-22385Critical · CVSS 9.8 · EPSS 28th2023-10-03
- CVE-2019-3563Critical · CVSS 9.8 · EPSS 76th2019-04-29
- CVE-2018-14790Critical · CVSS 9.8 · EPSS 92th2018-10-01
- CVE-2017-7679Critical · CVSS 9.8 · EPSS 98th2017-06-20
- CVE-2024-38373Critical · CVSS 9.6 · EPSS 47th2024-06-24
- CVE-2025-12106Critical · CVSS 9.1 · EPSS 44th2025-12-01
- CVE-2023-53159Critical · CVSS 9.1 · EPSS 26th2025-07-28
- CVE-2024-49846Critical · CVSS 9.1 · EPSS 19th2025-05-06
- CVE-2024-21456Critical · CVSS 9.1 · EPSS 19th2024-07-01
- CVE-2023-6936
Heap-buffer over-read with WOLFSSL_CALLBACKS
Critical · CVSS 9.1 · EPSS 46th2024-02-20
Showing 12 of 481 recorded CWE-126 CVEs. Track new ones as they are published and get AI-written analysis and fixes.
Monitor CWE-126 vulnerabilitiesCommon consequences
What can happen when CWE-126 is exploited.
Read Memory
Affects: Confidentiality
Bypass Protection Mechanism
Affects: Confidentiality
By reading out-of-bounds memory, an attacker might be able to get secret values, such as memory addresses, which can bypass protection mechanisms such as ASLR in order to improve the reliability and likelihood of exploiting a separate weakness to achieve code execution instead of just denial of service.
DoS: Crash, Exit, or Restart
Affects: Availability, Integrity
An attacker might be able to cause a crash or other denial of service by causing the product to read a memory location that is not allowed (such as a segmentation fault), or to cause other conditions in which the read operation returns more data than is expected.
How it happens
When it is introduced
Typically introduced during these phases of the software lifecycle.
Applies to
Languages
How to detect it
Automated Static Analysis
Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)
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
Code examples
Illustrative examples from MITRE showing how the weakness appears in code.
In the following C/C++ example the method processMessageFromSocket() will get a message from a socket, placed into a buffer, and will parse the contents of the buffer into a structure that contains the message length and the message body. A for loop is used to copy the message body into a local character string which will be passed to another method for processing.
Vulnerable example
int processMessageFromSocket(int socket) {However, the message length variable (msgLength) from the structure is used as the condition for ending the for loop without validating that msgLength accurately reflects the actual length of the message body (CWE-606). If msgLength indicates a length that is longer than the size of a message body (CWE-130), then this can result in a buffer over-read by reading past the end of the buffer (CWE-126).
The following C/C++ example demonstrates a buffer over-read due to a missing NULL terminator. The main method of a pattern matching utility that looks for a specific pattern within a specific file uses the string strncopy() method to copy the command line user input file name and pattern to the Filename and Pattern character arrays respectively.
Vulnerable example
int main(int argc, char **argv)Illustrative examples
Real CVEs that MITRE cites as examples of this weakness.
- CVE-2014-0160CISA KEV— Chain: "Heartbleed" bug receives an inconsistent length parameter (CWE-130) enabling an out-of-bounds read (CWE-126), returning memory that could include private cryptographic keys and other sensitive data.
- CVE-2022-1733 — Text editor has out-of-bounds read past end of line while indenting C code
- CVE-2009-2523 — Chain: product does not handle when an input string is not NULL terminated, leading to buffer over-read or heap-based buffer overflow.
Terminology & mappings
Mapped taxonomies
- PLOVER: Buffer over-read
- Software Fault Patterns: Faulty Buffer Access (SFP8)
Frequently asked questions
Common questions about CWE-126.
- What is CWE-126?
- The product reads from a buffer using buffer access mechanisms such as indexes or pointers that reference memory locations after the targeted buffer.
- What CVEs are caused by CWE-126?
- 481 recorded CVEs are attributed to CWE-126, including CVE-2024-49839, CVE-2023-36397, CVE-2023-22385.
- How is CWE-126 detected?
- Automated Static Analysis: Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)
- What are the consequences of CWE-126?
- Exploiting CWE-126 can lead to: Read Memory, Bypass Protection Mechanism, DoS: Crash, Exit, or Restart.
- Is CWE-126 actively exploited?
- 481 recorded CVEs are caused by CWE-126; none are currently in CISA's KEV catalog of actively exploited flaws.
References
- MITRE CWE definition (CWE-126) (opens in a new tab)
- CWE-126 vulnerabilities on NVD (opens in a new tab)
- Learn: What is a CWE?
Weakness data is sourced from the MITRE CWE catalog (v4.20). CVE associations are aggregated and kept current by RadicalNotion.AI.
Stay ahead of CWE-126
Get alerted the moment a new CWE-126 vulnerability affects your stack, with AI-written analysis, severity context, and remediation guidance.