CVE-2026-79516: stb out-of-bounds write in stbsp_vsnprintf

CVE-2026-79516 · Severity: medium · CVSS 4 · Published 2026-09-09

stb is a popular single-file C library collection used in games, graphics tools, and other performance-critical applications. A buffer overflow vulnerability in its sprintf implementation allows attackers to write a null byte one position before a caller-provided buffer, corrupting adjacent memory and potentially causing application crashes or code execution.

Technologies: Nothings Stb. Vendors: Nothings.

Quick answers

Is CVE-2026-79516 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-79516 being exploited in the wild.
How severe is CVE-2026-79516?
Medium severity, with a CVSS score of 4, published 9 September 2026.
Which products and versions are affected?
Nothings Stb commit 31c1ad3 and prior.
Is there a fix for CVE-2026-79516?
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-79516 attacked?
It is attacked with local access, in a software library.
Am I affected by CVE-2026-79516?
Check whether you run Nothings Stb at an affected version. 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

An out-of-bounds write vulnerability exists in stbsp_vsnprintf() (stb_sprintf.h) when called with count=0 and a non-NULL buffer. The null-termination logic computes a negative offset (l = -1), writing buf[-1] = 0. The root cause is missing bounds validation: when count=0, the internal callback clamps output to 0 bytes, but the subsequent null-terminator write does not account for this edge case. Attack vector requires calling stbsp_snprintf() with adversarial count and buffer parameters; no network reachability or authentication is required. An attacker can corrupt heap or stack memory adjacent to the target buffer. A patch is pending; workarounds include validating count > 0 before calling stbsp_snprintf().

Affected products

  • nothings stb commit 31c1ad3 and prior

Timeline

  • 2026-06-06: disclosed: Issue reported on GitHub #1963
  • 2026-09-09: advisory: CVE-2026-79516 published

References

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