Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CWE-125 (跨界内存读) — Vulnerability Class 2901

2901 vulnerabilities classified as CWE-125 (跨界内存读). AI Chinese analysis included.

CWE-125, Out-of-bounds Read, is a memory safety weakness where software accesses memory locations outside the designated buffer boundaries, either before its start or past its end. This vulnerability typically arises from insufficient bounds checking during array indexing or pointer arithmetic, allowing attackers to read sensitive data such as stack canaries, cryptographic keys, or internal application state. By leveraging this flaw, adversaries can achieve information disclosure or potentially facilitate further exploitation techniques like heap spraying. Developers mitigate this risk by implementing rigorous input validation, utilizing static analysis tools to detect unsafe memory access patterns, and adopting safer programming languages or libraries that enforce automatic bounds checking. Additionally, employing compiler protections like Address Sanitizer during development helps identify these errors early, ensuring that memory reads remain strictly within allocated limits to prevent unauthorized data exposure.

MITRE CWE Description
The product reads data past the end, or before the beginning, of the intended buffer.
Common Consequences (4)
ConfidentialityRead Memory
An attacker could get secret values such as cryptographic keys, PII, memory addresses, or other information that could be used in additional attacks.
ConfidentialityBypass Protection Mechanism
Out-of-bounds memory could contain memory addresses or other information that can be used to bypass ASLR and other protection mechanisms in order to improve the reliability of exploiting a separate weakness for code execution.
AvailabilityDoS: Crash, Exit, or Restart
An attacker could cause a segmentation fault or crash by causing memory to be read outside of the bounds of the buffer. This is especially likely when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string.
OtherVaries by Context
The read operation could produce other undefined or unexpected results.
Mitigations (2)
ImplementationAssume 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…
Architecture and DesignUse a language that provides appropriate memory abstractions.
Examples (2)
In the following code, the method retrieves a value from an array at a specific array index location that is given as an input parameter to the method
int getValueFromArray(int *array, int len, int index) { int value; // check that the array index is less than the maximum // length of the array if (index < len) { // get the value at the specified index of the array value = array[index]; } // if array index is invalid then output error message // and return value indicating error else { printf("Value is: %d\n", array[index]); value = -1; } return value; }
Bad · C
... // check that the array index is within the correct // range of values for the array if (index >= 0 && index < len) { ...
Good · C
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.
int processMessageFromSocket(int socket) { int success; char buffer[BUFFER_SIZE]; char message[MESSAGE_SIZE]; // get message from socket and store into buffer //Ignoring possibliity that buffer > BUFFER_SIZE if (getMessage(socket, buffer, BUFFER_SIZE) > 0) { // place contents of the buffer into message structure ExMessage *msg = recastBuffer(buffer); // copy message body into string for processing int index; for (index = 0; index < msg->msgLength; index++) { message[index] = msg->msgBody[index]; } message[index] = '\0'; // process message success = processMessage(message); } return success; }
Bad · C
CVE IDTitleCVSSSeverityPublished
CVE-2018-10877 Linux kernel 缓冲区错误漏洞 — kernel 8.4 -2018-07-18
CVE-2018-10623 Delta Industrial Automation DOPSoft 缓冲区错误漏洞 — Delta Industrial Automation DOPSoft 9.8 -2018-06-18
CVE-2018-3745 Joyent Node.js atob 安全漏洞 — atob node module 7.5 -2018-05-29
CVE-2018-10475 Foxit Reader 缓冲区错误漏洞 — Foxit Reader 6.5 -2018-05-17
CVE-2018-10476 Foxit Reader 缓冲区错误漏洞 — Foxit Reader 6.5 -2018-05-17
CVE-2018-10478 Foxit Reader 缓冲区错误漏洞 — Foxit Reader 6.5 -2018-05-17
CVE-2018-10479 Foxit Reader 缓冲区错误漏洞 — Foxit Reader 6.5 -2018-05-17
CVE-2018-10480 Foxit Reader 缓冲区错误漏洞 — Foxit Reader 6.5 -2018-05-17
CVE-2018-10481 Foxit Reader 缓冲区错误漏洞 — Foxit Reader 6.5 -2018-05-17
CVE-2018-10482 Foxit Reader 缓冲区错误漏洞 — Foxit Reader 6.5 -2018-05-17
CVE-2018-10485 Foxit Reader 缓冲区错误漏洞 — Foxit Reader 6.5 -2018-05-17
CVE-2018-10486 Foxit Reader 缓冲区错误漏洞 — Foxit Reader 6.5 -2018-05-17
CVE-2018-10487 Foxit Reader 缓冲区错误漏洞 — Foxit Reader 6.5 -2018-05-17
CVE-2018-10492 Foxit Reader 缓冲区错误漏洞 — Foxit Reader 6.5 -2018-05-17
CVE-2018-10493 Foxit Reader 缓冲区错误漏洞 — Foxit Reader 6.5 -2018-05-17
CVE-2018-1179 Foxit Reader 缓冲区错误漏洞 — Foxit Reader 6.5 -2018-05-17
CVE-2018-9950 Foxit Reader 缓冲区错误漏洞 — Foxit Reader 6.5 -2018-05-17
CVE-2018-9963 Foxit Reader 缓冲区错误漏洞 — Foxit Reader 6.5 -2018-05-17
CVE-2018-9971 Foxit Reader 缓冲区错误漏洞 — Foxit Reader 6.5 -2018-05-17
CVE-2018-9972 Foxit Reader 缓冲区错误漏洞 — Foxit Reader 6.5 -2018-05-17
CVE-2018-9973 Foxit Reader 缓冲区错误漏洞 — Foxit Reader 6.5 -2018-05-17
CVE-2018-9976 Foxit Reader 缓冲区错误漏洞 — Foxit Reader 6.5 -2018-05-17
CVE-2018-9978 Foxit Reader 缓冲区错误漏洞 — Foxit Reader 6.5 -2018-05-17
CVE-2018-9979 Foxit Reader 缓冲区错误漏洞 — Foxit Reader 6.5 -2018-05-17
CVE-2018-9980 Foxit Reader 缓冲区错误漏洞 — Foxit Reader 6.5 -2018-05-17
CVE-2018-9983 Foxit Reader 缓冲区错误漏洞 — Foxit Reader 6.5 -2018-05-17
CVE-2018-9984 Foxit Reader 缓冲区错误漏洞 — Foxit Reader 6.5 -2018-05-17
CVE-2017-14461 Dovecot 缓冲区错误漏洞 — Dovecot 7.1 -2018-03-02
CVE-2018-5380 Quagga BGP daemon 安全漏洞 — bgpd 4.3 -2018-02-19
CVE-2017-10956 Foxit Reader 安全漏洞 — Foxit Reader 6.5 -2017-12-20

Vulnerabilities classified as CWE-125 (跨界内存读) represent 2901 CVEs. The CWE taxonomy describes the weakness; review individual CVEs for product-specific impact.