Reading list
Learn Memory corruption from real reports
Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.
12 reports, easiest first.
-
`utile` allocates uninitialized Buffers when number is passed in input
The base64 encode and decode functions in the utile module allocate buffers without initialising them when a number is passed as input. On Node.js 6.x and below this could expose sensitive data from uninitialised memory, and on any Node.js version a large number could cause a denial of service by consuming memory.
When a program creates a buffer (a chunk of memory for data), it should fill it with zeros first. If it does not, the buffer may contain leftover data from other parts of the program, which could be private. Also, if a user can supply a number instead of text, the program might try to create an enormous buffer and run out of memory, crashing the service.
The lesson. Likely the base64 encode and decode functions pass a number directly to Buffer allocation without checking the input type or initialising the buffer.
-
A stack buffer overflow in BabyGrid.cpp can lead to program crashes via a malicious localization file
A stack buffer overflow in Notepad++'s BabyGrid.cpp occurs when a malicious nativeLang.xml file contains an overly long name attribute for certain ShortcutMapper tags, due to unsafe lstrcat and lstrcpy calls without bounds checks. An attacker could cause the program to crash when the user opens the Shortcut Mapper, potentially leading to loss of unsaved data.
Notepad++ lets you change its language using a file called nativeLang.xml. If that file contains a very long piece of text in a certain place, the program copies it into a small memory space without checking the length, which can make the program crash. An attacker could trick someone into using a bad language file, and then the program crashes when they open a particular menu.
The lesson. The code uses unsafe string functions (lstrcat and lstrcpy) that do not check the size of the destination buffer, allowing a stack buffer overflow.
-
Openscad import_stl.cc:import_stl() stack-based buffer overflow vulnerability
A stack-based buffer overflow in Openscad's STL import function allows an attacker to execute arbitrary code by providing a specially crafted STL file with more than three vertex lines in an outer loop.
When Openscad reads an STL file, it stores vertex coordinates in a fixed-size array on the stack. If the file contains more than three vertices in one loop, the program writes past the array, corrupting memory. An attacker can exploit this to run their own code on the victim's computer.
The lesson. The code does not check the index `i` before writing to the fixed-size array `vdata[3][3]`, allowing writes beyond its bounds when more than three vertex lines appear in an outer loop.
-
CVE-2026-92391: curl_mime_free stack overflow by recursion
The MIME cleanup and sizing functions in libcurl recurse without a depth limit, unlike the read path which caps nesting at 40 levels. An attacker who can control the nesting depth of a multipart structure built through the public API can cause a stack overflow and crash the process during cleanup.
libcurl is a library for making network requests, and its MIME API lets programs build multipart messages with nested parts. The code that frees these structures calls itself once per nesting level, so a very deep structure uses up all the stack memory and crashes the program. The read path already limits nesting depth, but the cleanup path does not.
The lesson. The cleanup functions form a mutual recursion with no depth limit, unlike the read path which enforces MAX_MIME_LEVELS.
-
Open Babel CSR format title out-of-bounds write vulnerability
A heap buffer overflow exists in Open Babel's CSR format when writing a molecule title longer than 80 characters, because PadString copies the title using strncpy with the input length instead of the destination size. An attacker could supply a malicious file to trigger the overflow and potentially achieve arbitrary code execution.
Open Babel is a tool that converts chemical file formats. When it writes a file in the CSR format, it copies the molecule's title into a fixed-size buffer without checking if the title is too long. If the title is longer than the buffer, it overwrites memory beyond the buffer, which can crash the program or let an attacker run their own code.
The lesson. The PadString function uses strncpy with the length of the input string instead of the destination buffer size, causing a heap buffer overflow when the input exceeds the allocated size.
-
Out of bounds read in Skia (CVE-2026-106399)
An off-by-one bounds check in skcms_GetTagByIndex allows an index equal to tag_count to read past the tag table, and the subsequent dereference uses an attacker-chosen offset from the profile buffer. A caller that iterates inclusively could trigger a heap out-of-bounds read, potentially leaking memory or crashing.
An ICC profile is a small file that describes colour information for images. The code that reads these files has a check that is slightly wrong: it allows one index too many, so it can read a little past the end of a list. That can crash the program or leak a few bytes of memory, but only if the program using the library makes the same mistake.
The lesson. The bounds check uses `>` instead of `>=`, so an index equal to tag_count is accepted and reads past the tag table.
-
GTKWave LXT2 lxt2_rd_expand_integer_to_bits stack-based buffer overflow vulnerability
A stack-based buffer overflow in GTKWave's LXT2 file parser allows an attacker to overwrite the stack by crafting a malicious .lxt2 file with large msb/lsb values, leading to arbitrary code execution when the victim opens the file.
GTKWave is a program for viewing signal traces from electronic simulations. A bug in how it reads a certain file format lets an attacker write past the end of a small memory buffer on the stack, which can crash the program or let the attacker run their own code. The victim just has to open a malicious file.
The lesson. The function lxt2_rd_expand_integer_to_bits copies a variable-length bit string into a fixed-size 33-byte stack buffer without checking the length, and the length is derived from attacker-controlled msb and lsb values in the file.
-
GTKWave VZT LZMA_read_varint out-of-bounds write vulnerability
A stack buffer overflow exists in GTKWave's LZMA_read_varint function when parsing VZT files, allowing an attacker to write beyond a 16-byte buffer by supplying a varint with no terminating byte. A victim opening a malicious .vzt file could trigger arbitrary code execution.
GTKWave is a program for viewing signal traces from electronic simulations. When it opens a compressed trace file, it reads numbers that tell it how big each block is. The code that reads these numbers uses a small fixed-size box on the stack (a temporary memory area) and keeps putting bytes into it without checking if the box is full. If a malicious file provides a number that never ends, the program writes past the box, corrupting memory and potentially letting an attacker run their own code.
The lesson. The LZMA_read_varint function reads bytes into a fixed 16-byte stack buffer in a loop that only stops when a byte with the high bit set is read, without checking the buffer index against the buffer size.
-
The Biosig Project libbiosig Nex parsing out-of-bounds read vulnerability
An out-of-bounds read vulnerability exists in libbiosig's Nex file parsing because an attacker-controlled offset is used without bounds checking. A crafted .nex file can cause an information leak or denial of service.
This report describes a bug in a library that reads medical signal files. When the library processes a file, it trusts a number stored in the file to decide where to read data from memory. If that number is too large, the library reads from outside the intended memory area, which can crash the program or leak data.
The lesson. The code uses an attacker-controlled offset from the file to compute a pointer into a heap buffer without validating that the offset stays within the buffer's bounds.
-
Tp-Link AC1350 Wireless MU-MIMO Gigabit Access Point (EAP225 V3) web interface memory corruption vulnerability
A stack-based buffer overflow in the httpd_portal service of the TP-Link EAP225 access point allows an unauthenticated attacker to crash the web interface by sending a crafted HTTP POST request with an overly long form value. This results in denial of service, requiring a device restart to recover.
The device's web server has a fixed-size memory area for storing form data. When a form value is longer than that area, it spills over and corrupts other memory, causing the server to crash. An attacker can trigger this without logging in, simply by sending a specially crafted request.
The lesson. The code copies attacker-controlled key and value strings into fixed-size stack buffers using the calculated length instead of the buffer size, leading to a stack-based buffer overflow.
-
stack buffer overflows in the curses module
The curses module's getstr() and instr() functions accept a negative length argument, which is passed to the underlying C library without validation, causing a stack buffer overflow when the user provides more input than the fixed-size buffer can hold. An attacker who can control the argument could crash the interpreter or potentially execute code if they also know the stack canary.
The curses module lets Python programs draw text-based interfaces. Its getstr() and instr() functions read user input into a fixed-size memory buffer on the stack. If you give them a negative number for the maximum length, the safety check is bypassed, and typing too much data overwrites other memory, crashing the program or worse.
The lesson. The code does not validate that the length argument is non-negative before passing it to the C library function, which then performs no bounds checking.
-
Stack Buffer-Overflow in MariaDB Charset_collation_map_st::insert_or_replace()
A stack buffer overflow exists in MariaDB's charset collation map handling, where user-supplied identifiers are copied into fixed-size stack buffers using the attacker-controlled length rather than the buffer size. Any authenticated user can crash the entire server with a single SET statement, and on builds without stack protection it may be exploitable for code execution.
A buffer is a small reserved area of memory. This code copies a name the user types into a fixed-size box without checking whether the name fits, so a very long name spills over into neighbouring memory and crashes the database server. Because the name is only allowed to contain letters, digits and underscores, turning the crash into running attacker code is harder but not ruled out on some builds.
The lesson. The code passes the attacker-controlled token length to strmake() as the copy limit instead of the destination buffer size, so an overlong identifier overflows the fixed-size stack buffer.