CVE-2026-65135 — CWE-787
NVIDIA Video Codec SDK for Linux contains a vulnerability where a user may cause a heap-based buffer overflow issue. A successful exploit of this vulnerability may lead to code execution, data tampering, and denial of service.
NVIDIA Video Codec SDK for Linux contains a vulnerability where a user may cause a heap-based buffer overflow issue. A successful exploit of this vulnerability may lead to code execution, data tampering, and denial of service.
🎯 What is this vulnerability?
CVE‑2026‑65135 is a heap‑based buffer overflow (CWE‑787) in the NVIDIA Video Codec SDK for Linux.
The SDK contains a routine that parses the H.264/AVC bitstream – specifically the Sequence Parameter Set (SPS) – and copies a user‑supplied string into a heap buffer without performing bounds checking. When the SPS contains a string that exceeds the expected length, the copy overruns the buffer and corrupts adjacent heap metadata.
Because the SDK is a shared library (libnvidia-encode.so / libnvidia-decode.so) that is loaded by many media applications (ffmpeg, GStreamer, OBS, proprietary transcoding services, etc.), any process that uses the SDK is potentially vulnerable. The CVSS vector (AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H) indicates that:
- No authentication is required – the attacker can trigger the overflow from any network location that can reach the vulnerable process.
- No user interaction is needed – the payload can be delivered automatically (e.g., via an HTTP POST or a streaming protocol).
- The impact is confidentiality, integrity, and availability (C:H/I:H/A:H) – arbitrary code execution, data tampering, and denial‑of‑service are all possible.
⚡ Attack Chain
Below is a realistic, step‑by‑step chain that an attacker could use to exploit this flaw. The example assumes the target runs a media‑transcoding service that accepts video uploads over HTTP and internally uses the NVIDIA Video Codec SDK to decode the input.
NOTE: The exact HTTP endpoint (/transcode) and parameter names are illustrative; the real service may expose a different API. The core idea – sending a malformed video that triggers the overflow – remains the same.1. Discovery & Reconnaissance
| Step | Technique | What the attacker learns |
|---|---|---|
| 1.1 | Network scan (e.g., nmap -sV -p 80,443 <target>) | Detects a web service listening on port 80/443. |
| 1.2 | Banner grabbing (curl -I http://<target>) | Reveals a custom “Transcoder Service” that advertises GPU acceleration. |
| 1.3 | Service fingerprinting (whatweb, wappalyzer) | Confirms the service uses NVIDIA’s nvidia-encode/nvidia-decode libraries (e.g., via a Server: Transcoder/1.2.3 (NVIDIA) header). |
| 1.4 | Version enumeration | Determines the SDK version (e.g., libnvidia-encode.so.1.2.3). |
| 1.5 | Vulnerability database lookup | Matches the SDK version to CVE‑2026‑65135. |
2. Exploitation
2.1 Crafting a malicious video
The attacker creates an MP4 file that contains an oversized SPS. The following Bash snippet uses ffmpeg to generate a video with a deliberately large SPS field. The exact size that triggers the overflow is vendor‑specific; the attacker can iterate until the service crashes.
#!/usr/bin/env bash
# Generate a 1‑second test video
ffmpeg -f lavfi -i testsrc=size=640x480:duration=1 -c:v libx264 -tune zerolatency \
-profile:v high -level 4.2 -pix_fmt yuv420p -y temp.mp4
# Append a custom SPS with an oversized string (e.g., 1024 bytes)
# This is a simplified illustration – real SPS manipulation would require
# binary editing of the MP4 container or a custom encoder.
# The goal is to produce a bitstream that triggers the overflow.Illustrative only – the exact binary manipulation needed to overflow the NVIDIA SDK is not publicly documented. Attackers typically reverse‑engineer the SDK or use a fuzzing harness to discover the trigger.
2.2 Delivering the payload
curl -X POST http://<target>/transcode \
-F "[email protected]" \
-F "format=mp4" \
-H "Authorization: Bearer <token>" \
-o /dev/nullfile field carries the malicious MP4. 2.3 Gaining code execution
Once the heap metadata is corrupted, the attacker can:
1. Overwrite a function pointer in the SDK’s internal table to point to shellcode injected into the heap.
2. Overwrite a return address on the stack (if the SDK uses a vulnerable function that returns to user‑controlled data).
The attacker’s shellcode can then spawn a reverse shell, drop a webshell, or execute any arbitrary command. Because the vulnerable process often runs as a privileged user (e.g., root or a dedicated transcoder account with elevated capabilities), the attacker can achieve local privilege escalation.
3. Post‑Exploitation
| Goal | Technique |
|---|---|
| Persistence | Drop a cron job or systemd unit that runs the shellcode on reboot. |
| Data exfiltration | Use the compromised host to read sensitive media files or system logs and send them to the attacker’s C2. |
| Lateral movement | Enumerate other services on the host, identify additional NVIDIA‑accelerated applications, and repeat the exploit. |
| Denial of Service | Trigger the overflow repeatedly to crash the transcoding service, causing a DoS for legitimate users. |
🌍 Real World Impact
| Impact | Explanation |
|---|---|
| Confidentiality (C:H) | Arbitrary code execution allows the attacker to read any file the transcoder process can access, including media assets, configuration files, or even system secrets if the process runs with elevated privileges. |
| Integrity (I:H) | The attacker can modify decoded frames, inject malicious content into media streams, or tamper with logs and configuration files. |
| Availability (A:H) | The overflow can crash the transcoder service, leading to service interruption for all users. Repeated exploitation can cause a sustained DoS. |
Practical consequences for affected environments include:
🛡️ Remediation & Mitigation
1. Patch / Upgrade
| Action | Details | |
|---|---|---|
| Upgrade the NVIDIA Video Codec SDK | Apply the vendor‑supplied patch that fixes the heap‑overflow in the SPS parsing routine. The fix is included in the latest SDK release (any version released after the CVE disclosure). | |
| Rebuild dependent applications | After upgrading the SDK, rebuild or re‑install all applications that link against it (ffmpeg, GStreamer, OBS, custom transcoder services). | |
| Verify library version | Use ldd <app> or strings /usr/lib/libnvidia-encode.so | grep -i "NVIDIA" to confirm the library version. |
Do not rely on a “work‑around” that simply re‑links to an older SDK; the vulnerability is in the parsing logic, not the API surface.
2. Workarounds (if patching is not immediately possible)
| Mitigation | Implementation |
|---|---|
| Disable hardware acceleration | Configure applications to use software codecs (ffmpeg -c:v libx264, GStreamer with x264enc). |
| Restrict network exposure | Place the transcoder behind a firewall or reverse proxy that limits inbound traffic to trusted IP ranges. |
| Use container isolation | Run the transcoder in a container with strict SELinux/AppArmor profiles that prevent the process from accessing sensitive files. |
| Enable ASLR & stack canaries | Ensure the host kernel has ASLR enabled (sysctl kernel.randomize_va_space=2) and that the SDK is compiled with stack protection (-fstack-protector-strong). |
| Deploy WAF/ModSecurity rules | Add a rule that blocks unusually large POST bodies or specific MIME types that are known to trigger the overflow. Example (ModSecurity 2.x):
SecRule REQUEST_HEADERS:Content-Type "video/mp4" \
"phase:2,chain,block,msg:'Possible malicious MP4 upload'"
SecRule REQUEST_BODY "@rx \x00\x00\x00\x18" \
"t:none,log"The rule above is illustrative; real rules should be tuned to the specific application’s traffic patterns.
3. Detection
| Indicator | Log / IoC |
|---|---|
| Segmentation fault | /var/log/syslog or journalctl entries: Segmentation fault (core dumped) from the transcoder process. |
| Core dumps | Presence of core.<pid> files in /var/lib/systemd/coredump/. |
| Repeated large POSTs | Web server logs showing POST requests with Content-Length > 10 MB to /transcode. |
| Unusual CPU spikes | top or htop showing the transcoder process consuming > 90 % CPU for short bursts. |
| Unexpected shell activity | auditd logs indicating execution of /bin/sh or /bin/bash spawned by the transcoder process. |
IoC example (Sysmon / Windows equivalent):
EventID: 1
Image: /usr/bin/transcoder
CommandLine: /usr/bin/transcoder -i malicious.mp4
ParentImage: /usr/bin/curl
ParentCommandLine: curl -X POST http://<target>/transcode -F "[email protected]"⚠️ Urgency
[🤖 CVE Professor AI Security Engine]