Skip to main content
Vulnerability Database/CVE-2026-108954

CVE-2026-108954: sherpa-onnx Buffer Overflow Vulnerability

CVE-2026-108954 is a buffer overflow flaw in k2-fsa sherpa-onnx affecting the Offline Transducer Greedy Search Decoder. Attackers can exploit this remotely via malformed model packs. This article covers technical details, affected versions, impact, and mitigation strategies.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-108954 Overview

CVE-2026-108954 is a buffer overflow vulnerability in k2-fsa sherpa-onnx versions up to 1.13.8. The flaw resides in the OfflineTransducerGreedySearchDecoder::Decode function within sherpa-onnx/csrc/offline-transducer-greedy-search-decoder.cc. Manipulation of the vocab_size argument triggers the overflow condition. The vulnerability stems from trusting unvalidated model metadata, which can be exploited through a malformed or tampered model pack. The attack can be launched remotely, and a public exploit exists. Normal usage with official model packs that maintain consistent metadata with the joiner is unlikely to reach the vulnerable code path.

Critical Impact

A malformed or tampered ONNX model pack can trigger a buffer overflow in the Offline Transducer Greedy Search Decoder, affecting the confidentiality, integrity, and availability of the host process.

Affected Products

  • k2-fsa sherpa-onnx versions up to and including 1.13.8
  • Offline Transducer Greedy Search Decoder component
  • Applications embedding the sherpa-onnx C++ library for offline speech recognition

Discovery Timeline

  • 2026-10-13 - CVE-2026-108954 published to NVD
  • 2026-10-14 - Last updated in NVD database

Technical Details for CVE-2026-108954

Vulnerability Analysis

The vulnerability exists in the greedy search decoder used for offline transducer-based automatic speech recognition. The Decode method consumes a vocab_size value that originates from model metadata loaded at runtime. The decoder uses this value to perform indexing and memory operations on buffers sized according to the joiner network's actual output dimensions. When metadata declares a vocab_size larger than the joiner's true output tensor, downstream buffer operations exceed the allocated memory region. This condition is classified under [CWE-119] — Improper Restriction of Operations within the Bounds of a Memory Buffer.

Root Cause

The root cause is missing validation between model-supplied metadata and the actual tensor shapes produced by the joiner network. The decoder trusts vocab_size as declared by the model pack without cross-checking it against runtime tensor dimensions. Any divergence between these two values produces an out-of-bounds memory access during greedy decoding.

Attack Vector

An attacker crafts a model pack containing manipulated metadata that overstates vocab_size. The target application loads the malicious or tampered model and invokes offline transducer greedy decoding. The decoder then reads or writes beyond the bounds of the joiner's output buffer. Exploitation requires user interaction, specifically the loading of the attacker-supplied model pack. Applications that accept third-party or user-supplied ONNX model packs are the primary exposure surface. The vulnerability mechanism is described in the public GitHub Issue #3983 and tracked in VulDB CVE-2026-108954.

Detection Methods for CVE-2026-108954

Indicators of Compromise

  • Process crashes or segmentation faults in applications linking sherpa-onnx during offline decoding operations
  • Loading of ONNX model packs from untrusted sources or outside of the official k2-fsa distribution channels
  • Model metadata declaring a vocab_size that does not match the joiner network's output tensor dimensions

Detection Strategies

  • Inventory all applications and services embedding sherpa-onnx and verify the library version against 1.13.8 or earlier
  • Validate loaded model packs by comparing declared vocab_size metadata against the joiner's actual output tensor shape before invoking the decoder
  • Instrument the host process with memory sanitizers such as AddressSanitizer during testing to surface out-of-bounds accesses in OfflineTransducerGreedySearchDecoder::Decode

Monitoring Recommendations

  • Monitor file system paths used to store ONNX model packs for unauthorized writes or replacements
  • Alert on repeated crashes of processes that invoke the sherpa-onnx decoder
  • Track network sources of model downloads and enforce allowlists for trusted model repositories

How to Mitigate CVE-2026-108954

Immediate Actions Required

  • Restrict model pack loading to official k2-fsa sources and verify integrity using cryptographic hashes
  • Treat all third-party or user-supplied ONNX model packs as untrusted input and sandbox the decoding process
  • Review application code that invokes OfflineTransducerGreedySearchDecoder::Decode and add pre-flight validation of vocab_size against the joiner tensor shape

Patch Information

At the time of publication, no fixed version has been identified in the enriched data. Monitor the k2-fsa sherpa-onnx repository and the discussion in GitHub Issue Comment #5871985324 for upstream remediation guidance.

Workarounds

  • Use only official model packs where metadata is guaranteed to be consistent with the joiner network
  • Run sherpa-onnx-based services in isolated processes with minimum required privileges to limit blast radius if the overflow is triggered
  • Add a validation layer that rejects any model pack whose declared vocab_size differs from the joiner's output tensor dimension
bash
# Example integrity verification before loading a model pack
sha256sum model.onnx
# Compare against the official checksum published by the k2-fsa project
# Reject the model pack if the hash does not match

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.