Stb Vorbis.cApplication · Nothings

CVE-2023-45677

HIGH · 7.8 CVSS v3.1 Published 2023-10-21
Mitigation only
No fix yet — a mitigation exists. There is no fixed release. A documented workaround reduces exposure in the meantime.
See remediation →
81/100
Remediation priority · High
No privileges

Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.

NVD · unedited
stb_vorbis is a single file MIT licensed library for processing ogg vorbis files. A crafted file may trigger out of bounds write in `f->vendor[len] = (char)'\0';`. The root cause is that if `len` read in `start_decoder` is a negative number and `setup_malloc` successfully allocates memory in that case, but memory write is done with a negative index `len`. Similarly if len is INT_MAX the integer overflow len+1 happens in `f->vendor = (char*)setup_malloc(f, sizeof(char) * (len+1));` and `f->comment_list[i] = (char*)setup_malloc(f, sizeof(char) * (len+1));`. This issue may lead to code execution.

Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.

dbcve analysis · high confidence

stb_vorbis library contains an out-of-bounds write vulnerability in the `start_decoder` function where a negative `len` value from a crafted Ogg Vorbis file is used as an array index when writing the null terminator to `f->vendor[len]`. Additionally, when `len` is INT_MAX, an integer overflow occurs in the malloc size calculation `(len+1)`, leading to undersized allocations and subsequent out-of-bounds writes. This can enable code execution.

MitigationValidate that `len` values read from Ogg Vorbis files are non-negative and will not cause integer overflow when calculating `len+1` for memory allocation. Ensure all index calculations use proper bounds checking before memory access.

Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.

Affected products & versions What the vendor confirmedThe version ranges the vendor confirmed as vulnerable. If your version sits inside a range here, treat yourself as exposed until you have upgraded.

NVD · CPE data
Stb Vorbis.cApplication
Affected:= 1.22

CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.

From the vector
Attack vector
Local
Complexity
Low
Privileges
None
User interaction
Required
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.

dbcve checks

Work through these to decide whether this CVE applies to you.

  1. Locate stb_vorbis.c in your codebase
    Search for files named 'stb_vorbis.c' or 'stb_vorbis.h' in your project directories. Check source code repositories or bundled third-party libraries.
    Affected if The file exists and its version is 1.22 (look for version comments like '#define STB_VORBIS_VERSION 1.22' or similar version identifiers)
  2. Identify if your application processes Ogg Vorbis audio files
    Search your codebase for calls to stb_vorbis functions such as stb_vorbis_open_filename, stb_vorbis_open_memory, stb_vorbis_decode_filename, or stb_vorbis_decode_frame. Look for file input handling of .ogg or .vorbis extensions.
    Affected if Your application loads Ogg Vorbis files using stb_vorbis functions
  3. Check if untrusted Ogg Vorbis files can be processed
    Review your application's data flow to determine if Ogg Vorbis files come from untrusted sources such as user uploads, network requests, or external APIs. Inspect the file opening code paths.
    Affected if Ogg Vorbis files from untrusted sources are processed without prior validation
  4. Verify the vulnerable start_decoder code pattern exists
    Open stb_vorbis.c and locate the start_decoder function. Search for 'vendor' variable usage and array indexing patterns like 'f->vendor[len]' where len is read from file input without proper bounds validation.
    Affected if The code reads a length value from the Ogg Vorbis file and uses it directly as an array index without validating it is non-negative and less than INT_MAX

Your environment is affected if you use stb_vorbis.c version 1.22 and process Ogg Vorbis files from untrusted sources without validating the vendor string length field.

Generated from the published advisory. Verify against your own configuration.

Check your environment

Paste your version and any relevant configuration and it will be compared against the affected criteria above. Do not include secrets or credentials.

AI-assisted, checked against the advisory. Informational, not a guarantee.

Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.

dbcve · scoped
Mitigation available No clean upgrade yet — mitigate in the meantime
Mitigation

Validate that `len` values read from Ogg Vorbis files are non-negative and will not cause integer overflow when calculating `len+1` for memory allocation. Ensure all index calculations use proper bounds checking before memory access.

Recommended fix High confidence

stb_vorbis v1.23 or later

  1. 1. Locate the stb_vorbis.c file in your project codebase
  2. 2. Check the current version identifier at the top of the file (typically in a comment near the license header)
  3. 3. Identify if the version is 1.22 or earlier by looking for the version string (e.g., "stb_vorbis v1.22" or similar)
  4. 4. Download the latest version of stb_vorbis.c from the official repository at https://github.com/nothings/stb
  5. 5. Replace the existing stb_vorbis.c with the newer version
  6. 6. Recompile your project to incorporate the fixed library
  7. 7. Test that audio decoding functionality still works correctly with your application
Caveat stb_vorbis is a single-file library with no external dependencies; upgrading should not introduce breaking changes as the API remains compatible

Generated from the published advisory — verify against the referenced sources before acting.

Fix this in Stb Vorbis.c Scoped from the published advisory
  • Consultation4.0 h
  • Implementation6.0 h
  • Testing6.0 h
  • Review / QA3.0 h
19.0 hours of engineering $3,320
Get help mitigating

An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $5,312.

Scan for this in your stack

Free · runs locally
dbcve dependency scanner

Check whether your project pulls in CVE-2023-45677 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.

References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.

Primary sources

Practitioner notes

Contributed

Peer-ranked notes from engineers who’ve handled CVE-2023-45677 in production — separate from our analysis above.

No notes yet

Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.

What this is

A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.

What belongs here
  • Verified mitigations, workarounds, and config changes
  • Version or environment caveats, and links to real fixes
  • No weaponised exploit code, or anything meant to cause harm
  • No spam, self-promotion, credentials, or personal data