Weakness · High
CWE-125: Out-of-bounds Read
What it is
The product reads data past the end, or before the beginning, of the intended buffer.
- Severity (our rating)
- High
- Likelihood of exploit
- Not rated by MITRE
- Introduced during
- Implementation
- Exploited in the wild
- 17 known exploited CVEs
What an attacker can do
- Read Memory (Confidentiality)
- Bypass Protection Mechanism (Confidentiality)
- DoS: Crash, Exit, or Restart (Availability)
- Varies by Context (Other)
How to prevent it
Implementation
- Assume all input is malicious. Use an "accept known good" input validation strategy, i.e., use a list of acceptable inputs that strictly conform to specifications. Reject any input that does not strictly conform to specifications, or transform it into something that does. When performing input validation, consider all potentially relevant properties, including length, type of input, the full range of acceptable values, missing or extra inputs, syntax, consistency across related fields, and conformance to business rules. As an example of business rule logic, "boat" may be syntactically valid because it only contains alphanumeric characters, but it is not valid if the input is only expected to contain colors such as "red" or "blue." Do not rely exclusively on looking for malicious or malformed inputs. This is likely to miss at least one undesirable input, especially if the code's environment changes. This can give attackers enough room to bypass the intended validation. However, denylists can be useful for detecting potential attacks or determining which inputs are so malformed that they should be rejected outright. To reduce the likelihood of introducing an out-of-bounds read, ensure that you validate and ensure correct calculations for any length argument, buffer size calculation, or offset. Be especially careful of relying on a sentinel (i.e. special character such as NUL) in untrusted inputs.
Architecture and Design
- Use a language that provides appropriate memory abstractions.
How to find it
- 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.
- 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.)
- 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++.
Exploited in the wild: 17 CVEs
Vulnerabilities caused by CWE-125 that attackers have used, from CISA's Known Exploited Vulnerabilities catalog, newest first.
- CVE-2026-11645Google Chromium V8 Out-of-Bounds Read and Write Vulnerability · added June 9, 2026
- CVE-2023-36424Microsoft Windows Out-of-Bounds Read Vulnerability · added April 13, 2026
- CVE-2026-3055Citrix NetScaler Out-of-Bounds Read Vulnerability · added March 30, 2026
- CVE-2025-5777 ransomwareCitrix NetScaler ADC and Gateway Out-of-Bounds Read Vulnerability · added July 10, 2025
- CVE-2025-5419Google Chromium V8 Out-of-Bounds Read and Write Vulnerability · added June 5, 2025
- CVE-2024-53150Linux Kernel Out-of-Bounds Read Vulnerability · added April 9, 2025
- CVE-2025-24991Microsoft Windows NTFS Out-Of-Bounds Read Vulnerability · added March 11, 2025
- CVE-2025-22226VMware ESXi, Workstation, and Fusion Information Disclosure Vulnerability · added March 4, 2025
- CVE-2023-42916Apple Multiple Products WebKit Out-of-Bounds Read Vulnerability · added December 4, 2023
- CVE-2021-25487Samsung Mobile Devices Out-of-Bounds Read Vulnerability · added June 29, 2023
- CVE-2023-28204Apple Multiple Products WebKit Out-of-Bounds Read Vulnerability · added May 22, 2023
- CVE-2017-5030Google Chromium V8 Memory Corruption Vulnerability · added June 8, 2022
- CVE-2016-5198Google Chromium V8 Out-of-Bounds Memory Vulnerability · added June 8, 2022
- CVE-2014-0160OpenSSL Information Disclosure Vulnerability · added May 4, 2022
- CVE-2022-22675Apple macOS Out-of-Bounds Write Vulnerability · added April 4, 2022
- CVE-2022-22674Apple macOS Out-of-Bounds Read Vulnerability · added April 4, 2022
- CVE-2020-11899Treck TCP/IP stack Out-of-Bounds Read Vulnerability · added March 3, 2022
H2 Security
Found it in your code?
We review where it appears, fix it with your team, and check it was not already used against you.
Talk to our teamT Academy
Stop writing it in the first place
Learn to build software and systems without weaknesses like this one, with practice on real hosts in your browser, every objective checked on the machine.
Start freeSource: MITRE Common Weakness Enumeration, CWE version 4.19.1. CWE is a trademark of The MITRE Corporation.