Skip to content
OpenAdvisories

Weakness (CWE)

CWE-121: Stack-based Buffer Overflow

Variant Draft

The product writes past the end of a buffer that was allocated on the stack.

How to prevent it (5 mitigations)
  1. Operation, Build and Compilation

    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.

  2. Architecture and Design

    Use an abstraction library to abstract away risky APIs. Not a complete solution.

  3. Implementation

    Implement and perform bounds checking on input.

  4. Implementation

    Do not use dangerous functions such as gets. Use safer, equivalent functions which check for boundary errors.

  5. Operation, Build and Compilation

    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].

Source: MITRE CWE-121

4,138 results · Feed

  • Medium 6.7

    Multiple vulnerabilities previously addressed in IBM SevOne Network Performance Management

    IBM SevOne Network Performance Management 7.0.0 through 8.2.2 could allow a local attacker to execute arbitrary code due to a buffer overflow.

  • Medium 6.5

    IBM® Db2® is vulnerable to a denial of service when executing a specially crafted query with a Materialized Query Table

    IBM Db2 11.5.0 through 11.5.9, and 12.1.0 through 12.1.5 is vulnerable to a denial of service when executing a specially crafted query with a Materialized Query Table.

  • High 7.2

    Multiple Vulnerabilities in IBM API Connect

    IBM API Connect 10.0.8.0 through 10.0.8.12 and 12.1.0.0 through 12.1.1.2 could allow a remote authenticated attacker to execute arbitrary code due to a stack-based buffer overflow.

  • High 7.5

    FreeSWITCH: Pre-authentication stack buffer overflow in mod_rtmp control-message handling

    FreeSWITCH is a Software Defined Telecom Stack enabling the digital transformation from proprietary telecom switches to a software implementation that runs on any commodity hardware. Prior to 1.11.2, rtmp_handle_control() rendered an RTMP user-control message…

  • Medium 5.9

    FreeSWITCH: Stack buffer overflow in mod_rtmp AVC sequence-header construction

    FreeSWITCH is a Software Defined Telecom Stack enabling the digital transformation from proprietary telecom switches to a software implementation that runs on any commodity hardware. Prior to 1.11.2, rtmp_rtp2rtmpH264() built an AVC decoder configuration reco…

  • High 7.5

    FreeSWITCH: Pre-authentication stack buffer overflow in mod_xml_rpc HTTP directory authentication

    FreeSWITCH is a Software Defined Telecom Stack enabling the digital transformation from proprietary telecom switches to a software implementation that runs on any commodity hardware. Prior to 1.11.2, http_directory_auth() rebuilt an expected user@domain:passw…

  • Medium 6.5

    FreeSWITCH mod_sofia: stack buffer overflow from an over-long SIP Contact display-name

    FreeSWITCH is an open-source software telecommunications platform. From 1.10.0 to 1.11.1, there is a stack-based buffer overflow in  mod_sofia  when processing SIP Contact display names for dialog-event notifications. A peer can establish a dialog containing …

  • High 7.5

    FreeSWITCH: Stack buffer overflow parsing the SDP a=crypto key material on inbound calls

    FreeSWITCH is a Software Defined Telecom Stack enabling the digital transformation from proprietary telecom switches to a software implementation that runs on any commodity hardware. Prior to 1.11.2, switch_core_media_add_crypto() passed the encoded key and s…

  • Medium 6.5

    FreeSWITCH mod_sofia: stack buffer overflow from an over-long SIP To-header user

    FreeSWITCH is an open-source software telecommunications platform. From 1.10.0 until 1.11.1, a stack-based buffer overflow in  mod_sofia  when generating dialog-event notifications. A peer can establish a dialog with an excessively long SIP To-header user par…

  • Medium 6.1

    NEURON through 9.0.2 Stack-based Buffer Overflow via CoreNEURON dataset tokens

    NEURON (CoreNEURON) through 9.0.2 contains a stack buffer overflow vulnerability that allows attackers to corrupt stack memory by supplying over-long tokens in a crafted model dataset. Attackers can place oversized version or mechanism-name tokens in bbcore_m…

  • High 7.5

    libnxml before 0.18.6 Stack-based Buffer Overflow via long multi-byte XML name

    libnxml before 0.18.6 contains a stack-based buffer overflow vulnerability in src/nxml_parser.c that allows remote attackers to write past a 1024-byte stack buffer via long XML names. Attackers can supply XML or RSS feeds with a 1022-character element, attrib…

  • High 7.0

    Stack-based buffer overflow in SafeNet Authentication Client SIS token engine

    A stack-based buffer overflow in Thales SafeNet Authentication Client (SAC) SIS token engine processing can be triggered by a malicious physical or software-emulated smart card. The issue can occur before authentication or PIN entry and may cause a denial of …

  • High 7.5

    Gdb: gdb: stack buffer overflow in parse_tsv_definition via stale rs->buf tail

    A flaw was found in the GNU debugger (GDB). When GDB connects to a remote debug target, a malicious target can cause GDB to overflow a buffer on the stack while parsing the target's replies. This can crash GDB or potentially allow the target to execute arbitr…

  • High 7.5

    Gdb: gdb: stack buffer overflow in parse_tracepoint_definition via stale rs->buf tail

    A stack buffer overflow in the GDB client's tracepoint upload handler allows an attacker-controlled debug stub to corrupt stack memory automatically during connection setup. The overflow results from GDB reading beyond the current reply boundary into a stale …

  • High 8.8

    Gdb: gdb: stack buffer overflow in fetch_register_using_p via unchecked p-reply length

    A stack buffer overflow in the GDB client's remote protocol handler allows an attacker-controlled debug target to execute arbitrary code in the GDB process. The vulnerability exists in fetch_register_using_p, which decodes a stub's register reply into an allo…

  • Medium 5.3

    ntopng: Stack buffer overflow (write) in nDPI custom category detection allows remote code execution via crafted network packets

    ntopng is a web-based network traffic monitoring application. Prior to 6.7.260721, ndpi_get_custom_category_match writes a four-byte nDPI protocol-category value through a pointer to the two-byte id variable in IpAddress::reloadBlacklist in src/IpAddress.cpp …

  • High 7.8

    SDL_mixer 3.1.2 through 3.2.4 Stack-based Buffer Overflow via FetchXLaw() in AIFF Decoder

    SDL_mixer 3.1.2 through 3.2.4 contains a stack-based buffer overflow in FetchXLaw() in src/decoder_aiff.c due to miscalculated output offsets when expanding A-law or mu-law samples. Attackers can supply a crafted AIFF-C file that overwrites roughly 1 KB of ad…

  • High 7.8

    SDL_mixer 3.1.2 through 3.2.4 Stack-based Buffer Overflow via FetchXLaw() in WAV Decoder

    SDL_mixer 3.1.2 through 3.2.4 contains a stack-based buffer overflow vulnerability in FetchXLaw() of src/decoder_wav.c when decoding A-law or mu-law WAV files. Attackers can supply a crafted WAV file whose doubly-offset float expansion overwrites about 1 KB o…

  • Medium 6.5

    netrek-client-cow through 3.3.3 Stack Buffer Overflow via handleSMessage

    netrek-client-cow through 3.3.3 contains a stack-based buffer overflow vulnerability in handleSMessage() in short.c that allows malicious servers to overflow a 100-byte stack buffer by sending oversized SP_S_MESSAGE packets. A malicious Netrek server or man-i…

  • High 7.4

    ESP-IDF: Stack-based memory corruption in lwIP DNS/SNTP handling for multi-IP DNS responses

    ESP-IDF is the Espressif Internet of Things (IOT) Development Framework. From 5.2.3 until 5.3.7, 5.4.5, 5.5.6, and 6.0.3, the lwIP DNS resolver's cached-lookup path in dns_lookup() in dns.c copies every cached address into a caller-provided single ip_addr_t o…

  • High 7.1

    ESP-IDF: Stack-Based Out-of-Bounds Write in Thread Border Router ND6 Option Parsing

    ESP-IDF is the Espressif Internet of Things (IOT) Development Framework. From 5.2.0 until 5.2.8, 5.3.6, 5.4.5, 5.5.5, and 6.0.3, the OpenThread Border Router Neighbor Discovery packet handler trusts an attacker-controlled ICMPv6 option length while copying in…

  • Medium 6.6

    Buffer overflow in SAML authentication post-back URL handling in libsnowflakeclient and Snowflake PHP PDO Driver

    A stack-based buffer overflow in libsnowflakeclient and the Snowflake PHP PDO Driver could, under specific conditions, result in memory corruption during SAML-based authentication. During a native SSO/SAML login flow, the affected drivers may have copied a va…

  • High 7.3

    Apache OpenOffice: Stack overflow in CFF hint handling

    An uncontrolled memory access in the PDF export code of Apache OpenOffice versions through 4.1.16 allows a crafted CFF font to cause a stack overflow problem, causing program crash or memory corruption, or even running other code. Users are recommended to upg…

  • High 8.7

    Stack-based buffer overflow in certain ASUS Router firmware allows an unauthenticated nearby attacker to execute arbitr…

  • Critical 9.9

    TOTOLINK A950RG MAC Filter cstecgi.cgi setMacFilterRules stack-based overflow

    A flaw has been found in TOTOLINK A950RG 4.1.2cu.5268_B20221104. Affected by this vulnerability is the function setMacFilterRules of the file /cgi-bin/cstecgi.cgi of the component MAC Filter Handler. This manipulation of the argument addEffect causes stack-ba…

  • Critical 9.9

    TOTOLINK A950RG Multi-SSID Configuration cstecgi.cgi delWiFiMultipleConfig stack-based overflow

    A vulnerability was detected in TOTOLINK A950RG 4.1.2cu.5268_B20221104. Affected is the function setWiFiMultipleConfig/delWiFiMultipleConfig of the file /cgi-bin/cstecgi.cgi of the component Multi-SSID Configuration. The manipulation of the argument wepkey2/w…

  • Critical 9.9

    TOTOLINK A950RG Basic Wireless Configuration cstecgi.cgi strcpy stack-based overflow

    A security vulnerability has been detected in TOTOLINK A950RG 4.1.2cu.5268_B20221104. This impacts the function strcpy of the file /cgi-bin/cstecgi.cgi of the component Basic Wireless Configuration Handler. The manipulation of the argument wepkey leads to sta…

  • Critical 9.9

    TOTOLINK A950RG Easy Setup Wizard cstecgi.cgi setAppEasyWizardConfig stack-based overflow

    A weakness has been identified in TOTOLINK A950RG 4.1.2cu.5268_B20221104. This affects the function setAppEasyWizardConfig of the file /cgi-bin/cstecgi.cgi of the component Easy Setup Wizard Handler. Executing a manipulation of the argument functionType can l…

  • Critical 9.6

    Buffer overflow in ANGLE in Google Chrome prior to 157.0.8103.38 allowed a remote attacker to execute arbitrary code ou…

  • High 7.5

    PyMuPDF 1.25.3 before 2.0 Stack Buffer Overflow via add_freetext_annot() Callout

    PyMuPDF 1.25.3 before 2.0 contains a stack-based buffer overflow vulnerability in JM_set_annot_callout_line() that copies a caller-supplied number of callout points into a fixed three-element stack array. Attackers who control the callout argument passed to P…

  • High 8.8

    ReadyMedia 1.3.0 - 1.3.3 Stack Buffer Overflow via DFF Parser

    ReadyMedia (formerly MiniDLNA) versions 1.3.0 through 1.3.3 contain a stack-based buffer overflow vulnerability that allows remote attackers to corrupt stack memory by crafting a malicious DFF audio file with an oversized PROP chunk size value that is used un…

  • High 8.4

    In multiple functions of hppsfilter.c, there is a possible out-of-bounds write due to a stack buffer overflow. This cou…

  • High 7.5

    In parseMetaData of StagefrightMetadataRetriever.cpp, there is a possible denial of service due to a stack buffer overf…

  • Medium 5.9

    psqlODBC stack buffer overflow copying ctid and oid values for updatable cursors

    For updatable cursors, which are enabled by default, psqlODBC adds hidden ctid and, for tables with OIDs, oid columns to the query. It copies each value into a 32-byte stack buffer using the length the server sent, without checking it against the buffer size,…

  • Medium 5.9

    psqlODBC stack buffer overflow when quoting long schema and table names

    When psqlODBC quotes a schema or table name into a 128-byte stack buffer, its length check lets it write up to two bytes past the end of the buffer for a long name. The names come from the application's SQL text: the table of a statement the driver parses to …

  • High 7.5

    psqlODBC ODBC escape parser stack buffer overflow

    The psqlODBC parser for ODBC escape sequences in application SQL text writes the argument offsets of a {fn} escape into a fixed 16-entry stack array without a bound and does not initialize the array. An escape with too many arguments overflows the stack, and …

  • High 7.8

    Netpbm before 10.86.51, 11.02.30, and 11.15.08 picttoppm Stack Buffer Overflow via paintPoly

    Netpbm before 10.86.51, 11.x before 11.02.30, and 11.03 before 11.15.08 contains a stack-based buffer overflow in the picttoppm paintPoly() function due to an unbounded polygon point count. Attackers can supply a crafted PICT file with a polygon exceeding 100…

  • High 7.8

    Netpbm before 10.86.51, 11.02.30, and 11.15.08 picttoppm Stack Overflow via scanPoly

    Netpbm before 10.86.51, 11.x before 11.02.30, and 11.03 before 11.15.08 contains a stack-based buffer overflow in picttoppm's scanPoly() function in converter/ppm/picttoppm.c. Attackers can supply a crafted PICT file whose polygon edges produce more than 5000…

  • High 7.3

    VStarcam O-KAM Client DevDll_925.dll FUN_10003EA0 stack-based overflow

    A vulnerability was found in VStarcam O-KAM Client 1.3.3.32. Affected by this vulnerability is the function FUN_10003EA0 in the library DevDll_925.dll. The manipulation results in stack-based buffer overflow. It is possible to launch the attack remotely. The …

  • Medium 4.4

    In display, there is a possible system crash due to a logic error. This could lead to local denial of service if a mali…