Target: tempus-ex/hello-video-codec (Rust) — BitstreamWriter::write_bits
Crate name: hello-video-codec (import as hello_video_codec)
File/Function: src/bitstream.rs → BitstreamWriter::write_bits(u64, usize)
Version tested: 0.1.0
Commit tested: 3e9551c699311ea12ad7f2fce9562fbc990d524c (describe: 3e9551c)
Environment: Kali Linux
rustc --version: rustc 1.89.0 (29483883e 2025-08-04)cargo --version: cargo 1.89.0 (c24e10642 2025-06-23) Affected range: ≤ 0.1.0 (at least commit 3e9551c reproduces)
Impact: Integrity (silent output corruption)
CWE: CWE-20 (Improper Input Validation), CWE-682 (Incorrect Calculation)
CVSS v3.1 (proposed):
AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N≈ 7.5 High (if processing is automatic)AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N≈ 6.8 Medium–High (if manual upload required)
An untrusted bit-length derived from user-controlled input (e.g., file name or EXIF) is passed to BitstreamWriter::write_bits without bounds checking.
When len is large (e.g., 130), the writer’s internal state becomes inconsistent, producing silent and persistent corruption in the output stream.
This breaks downstream consumers (analytics, archives, pipelines) — a clear Integrity impact.
- Poison downstream data by submitting a crafted media file whose name/metadata encodes a large
len. - Systems that process the file using the vulnerable writer will silently generate invalid bytes, yet continue to operate “normally.”
- Consequences: corrupted archives, polluted analytics/ML inputs, evasion of content filters that rely on correctly derived outputs.
# Install Rust (if needed)
curl --proto '=https' --tlsv1.2 -sSf https://rustup.rs | sh -s -- -y
source "$HOME/.cargo/env"
# Clone target repo
git clone https://github.com/tempus-ex/hello-video-codec
cd hello-video-codec
Best,
Ali Firas (The Smart Shadow)