CVE-2026-9541: Squirrel ReadObject heap buffer overflow in Cnut File Handler

CVE-2026-9541 · Severity: medium · CVSS 5.3 · Published 2026-05-26

Squirrel is a lightweight programming language often embedded in applications and games. A security flaw in how it handles compiled bytecode files allows a local attacker to trigger a memory corruption error. This could potentially lead to a program crash or unauthorized code execution on the affected system.

Quick answers

Is CVE-2026-9541 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-9541 being exploited in the wild.
How severe is CVE-2026-9541?
Medium severity, with a CVSS score of 5.3, published 26 May 2026.
Which products and versions are affected?
Alberto Demichelis Squirrel Up to 3.2.
Is there a fix for CVE-2026-9541?
No fixed version is recorded yet. Check the vendor's advisory in the references below. If you run it, Junglewise drafts a mitigation that fits your setup and applies it once you approve, with senior security engineers behind it.
How is CVE-2026-9541 attacked?
It is attacked with local access, in a software library.
Am I affected by CVE-2026-9541?
Check whether anything you run is named in the advisory. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

Technical details

A heap-based buffer overflow exists in the ReadObject function within squirrel/sqobject.cpp of the Squirrel language (up to version 3.2). The vulnerability is caused by improper validation of string lengths read from a bytecode stream. Specifically, the ReadObject function accepts a signed SQInteger for string length without checking for negative values. When a negative length is provided, the GetScratchPad function fails to resize the buffer, but the subsequent SafeRead call passes the negative value to fread. Because fread interprets the signed integer as a large unsigned size_t, it performs an out-of-bounds write to the heap. This can be triggered by loading a malicious .cnut bytecode file via sqstd_loadfile or sq_readclosure.

Affected products

  • Alberto Demichelis Squirrel Up to 3.2

Timeline

  • 2026-04-22: disclosed: Issue reported to the project maintainer on GitHub
  • 2026-05-26: advisory: CVE published by VulDB/NVD

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.