CVE-2026-2659: 
Homebrew vulnerability analysis and mitigation

Overview

CVE-2026-2659 is a heap buffer underflow (out-of-bounds read) vulnerability in the Squirrel scripting language affecting all versions up to and including 3.2. The flaw resides in the SQFuncState::PopTarget() function within src/squirrel/squirrel/sqfuncstate.cpp and can be triggered by crafting malicious Squirrel scripts with complex nested expressions. It was reported via a GitHub issue on January 22, 2026, and publicly disclosed on February 18, 2026, with no vendor patch available as of the time of writing. The vulnerability carries a CVSS v3.1 base score of 7.8 (High) for local exploitation scenarios (Feedly, GitHub Issue).

Technical details

The root cause is an improper restriction of memory buffer operations (CWE-119 / CWE-125): the SQFuncState::PopTarget() function calls _target_stack.back() without first verifying that the stack is non-empty, allowing an access to index -1 (8 bytes before the allocated heap region). This buffer underflow is triggered when the Squirrel compiler processes deeply nested or complex expressions — such as binary/logical operations inside for loops — causing the internal target stack to become desynchronized, with PopTarget() called one time more than PushTarget(). The call chain observed in ASAN reports follows: ForStatement → Statement → CreateFunction → FunctionStatement → BIN_EXP → BitwiseOrExp → LogicalAndExp → PopTarget. A public proof-of-concept reproducer script is available (GitHub Issue, PoC Repro).

Impact

Successful exploitation causes a heap-buffer-overflow (underflow) read of 8 bytes, resulting in a crash of the Squirrel application (denial of service). While the CVSS v3.1 score reflects potential high confidentiality, integrity, and availability impact in a local context, the CVSS v4.0 assessment and executive analysis indicate the primary practical impact is application crash/denial of service, with no confirmed evidence of arbitrary code execution or sensitive data disclosure in current exploit demonstrations. Applications embedding the Squirrel scripting engine (e.g., game engines or automation tools) that process untrusted scripts are at risk of being crashed by a low-privileged local user (Feedly, GitHub Issue).

Exploitability

A public proof-of-concept exploit script has been disclosed on GitHub and was added to NVD exploit references on February 20, 2026. Exploitation requires local access and low privileges — an attacker must be able to supply a crafted .nut script to the Squirrel interpreter. There is no evidence of in-the-wild exploitation at this time, and the vulnerability is not listed in the CISA KEV catalog. The EPSS score is very low at approximately 0.013%, reflecting limited likelihood of widespread exploitation (Feedly, PoC Repro).

Exploitation steps

  1. Prepare environment: Obtain a build of Squirrel version 3.2 or earlier on a Linux x86_64 system. Optionally build with ASan enabled (-fsanitize=address) to observe the crash clearly.
  2. Craft malicious script: Create a Squirrel (.nut) script that triggers deeply nested expression parsing — specifically, complex binary or logical operations (e.g., bitwise OR, logical AND) inside nested for loops and generator functions, causing the compiler's internal _target_stack to become desynchronized.
  3. Reference PoC: Use or adapt the publicly available reproducer at https://github.com/oneafter/0122/blob/main/i311/repro, which demonstrates the crash using nested generator functions with resume expressions inside for loops.
  4. Execute the script: Run the crafted script with the Squirrel interpreter: ./sq repro
  5. Observe crash: The interpreter crashes in SQFuncState::PopTarget() at sqfuncstate.cpp:290 due to a heap buffer underflow (read of 8 bytes at index -1 of _target_stack), resulting in a denial of service (GitHub Issue, PoC Repro).

Indicators of compromise

  • Process: Unexpected crash or abort of the Squirrel interpreter (sq) or any application embedding the Squirrel engine, particularly with an ABORTING message or segmentation fault.
  • Logs: AddressSanitizer output referencing heap-buffer-overflow in SQFuncState::PopTarget() at sqfuncstate.cpp:290; stack traces involving BIN_EXP, BitwiseOrExp, LogicalAndExp, ForStatement, or CreateFunction in sqcompiler.cpp.
  • File System: Presence of unexpected or externally supplied .nut script files containing deeply nested for loops, generator functions, or complex bitwise/logical expressions.
  • Application: Repeated or targeted crashes of services that embed Squirrel for scripting, especially when processing user-supplied script input (GitHub Issue).

Mitigation and workarounds

No official patch has been released by the Squirrel project maintainer as of the disclosure date, and the project has not responded to the issue report. Recommended mitigations include: (1) restricting local access to Squirrel-based applications to trusted users only using OS-level access controls; (2) avoiding processing of untrusted or user-supplied Squirrel scripts; (3) monitoring the official Squirrel repository for a patch release; and (4) implementing application-level input validation to reject or sandbox untrusted scripts before compilation (Feedly, GitHub Issue).

Community reactions

Red Hat has acknowledged the vulnerability and published a CVE entry, though no Red Hat products are currently listed as affected. The vulnerability was reported responsibly via a GitHub issue by researcher "oneafter" on January 22, 2026, with a detailed ASAN report and reproducer, but the Squirrel project maintainer had not responded as of the disclosure date. Community aggregators such as VulDB, Vulners, and CIRCL have indexed the CVE, and a brief technical write-up was published at infinitsec.net shortly after disclosure (Red Hat CVE, GitHub Issue).

Additional resources

Linux Distribution fix status

Fix availability across major Linux distributions and their releases.

Debian

Affected

sid

squirrel3

Affected

trixie

squirrel3

Affected

Ubuntu

Unknown

bionic (esm-apps)

squirrel3

Unknown

devel

squirrel3

Unknown

focal (esm-apps)

squirrel3

Unknown

jammy

squirrel3

Unknown

jammy (esm-apps)

squirrel3

Unknown

resolute

squirrel3

Unknown

resolute (esm-apps)

squirrel3

Unknown

Source: This report was generated using AI

Related Homebrew vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-112390HIGH8.2
  • Python logoPython
  • open-webui
NoYesOct 19, 2026
CVE-2026-14511MEDIUM6.5
  • IBM WebSphere MQ logoIBM WebSphere MQ
  • cpe:2.3:a:ibm:mq
NoNoOct 19, 2026
CVE-2026-112778MEDIUM6.4
  • NixOS logoNixOS
  • traefik
NoYesOct 19, 2026
CVE-2026-112391MEDIUM6.3
  • Python logoPython
  • nemo-gym
NoYesOct 19, 2026
CVE-2026-111678MEDIUM4.8
  • NixOS logoNixOS
  • antiword
NoNoOct 16, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Additional Wiz resources

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management