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

CVE-2026-107698: FFmpeg SSRF Vulnerability in RTSP Handler

CVE-2026-107698 is a server-side request forgery flaw in FFmpeg that allows malicious RTSP servers to redirect requests to internal network services. This article covers technical details, affected versions, and mitigation.

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-107698 Overview

CVE-2026-107698 is a server-side request forgery (SSRF) vulnerability [CWE-918] in FFmpeg versions before 7.1.4 and 8.0.x before 8.0.2. The flaw resides in the ff_rtsp_connect() function in libavformat/rtsp.c, which follows RTSP 3xx redirects without validating the Location URL. A malicious RTSP server can redirect FFmpeg to internal hosts and ports under alternate schemes, bypassing the -protocol_whitelist restriction. Attackers can abuse this behavior to probe internal network services from any environment that processes untrusted RTSP streams.

Critical Impact

Malicious RTSP endpoints can coerce FFmpeg into issuing requests to internal network services, enabling reconnaissance of otherwise unreachable infrastructure despite protocol allowlisting.

Affected Products

  • FFmpeg versions prior to 7.1.4
  • FFmpeg 8.0.x versions prior to 8.0.2
  • Applications and services embedding libavformat for RTSP stream handling

Discovery Timeline

  • 2026-10-08 - CVE-2026-107698 published to NVD
  • 2026-10-15 - Last updated in NVD database

Technical Details for CVE-2026-107698

Vulnerability Analysis

FFmpeg's RTSP client processes server responses in ff_rtsp_connect() located in libavformat/rtsp.c. When the server returns a 3xx status, the client duplicates the Location header value and reconnects to the new URL. The pre-patch logic performs no scheme validation and no re-check against the user-supplied -protocol_whitelist. Consequently, a redirect from an rtsp:// origin can target file://, http://, tcp://, or other schemes that libavformat understands.

Because RTSP streams are commonly consumed by media processing pipelines, transcoders, and surveillance ingestion services, exploitation requires only that a user or automated workflow process an attacker-controlled URL. The redirect handling runs server-side, allowing the attacker to probe loopback services, cloud metadata endpoints, or internal management interfaces.

Root Cause

The root cause is missing validation in the redirect code path. The original implementation copied reply->location directly into the format context URL without invoking a protocol-check helper. The fix routes the redirect through ff_format_check_set_url() and additionally restricts the proto parser so that only rtsp (and the aliased satip) schemes are accepted when reconnecting.

Attack Vector

An attacker hosts a malicious RTSP server. The target application connects, and the server responds with an HTTP-style 3xx redirect whose Location header references an internal URL such as http://127.0.0.1:8080/admin or http://169.254.169.254/latest/meta-data/. FFmpeg follows the redirect without consulting the protocol allowlist, exposing internal services to the attacker through observable error messages, timing, or exfiltrated content.

c
// Patch: libavformat/rtsp.c - route redirects through ff_format_check_set_url()
    ff_rtsp_close_streams(s);
    ff_rtsp_close_connections(s);
    if (reply->status_code >=300 && reply->status_code < 400 && s->iformat) {
-        char *new_url = av_strdup(reply->location);
-        if (!new_url) {
-            err = AVERROR(ENOMEM);
+        int ret = ff_format_check_set_url(s, reply->location);
+        if (ret < 0) {
+            err = ret;
            goto fail2;
        }
-        ff_format_set_url(s, new_url);
        rt->session_id[0] = '\0';
        av_log(s, AV_LOG_INFO, "Status %d: Redirecting to %s\n",
               reply->status_code,
// Source: https://github.com/FFmpeg/FFmpeg/commit/2326bc5f69c9
c
// Patch: libavformat/rtsp.c - explicit protocol check
    } else if (!strcmp(proto, "satip")) {
        av_strlcpy(proto, "rtsp", sizeof(proto));
        rt->server_type = RTSP_SERVER_SATIP;
-    }
+    } else if (strcmp(proto, "rtsp"))
+        return AVERROR_INVALIDDATA;

    if (*auth) {
        av_strlcpy(rt->auth, auth, sizeof(rt->auth));
// Source: https://github.com/FFmpeg/FFmpeg/commit/7c011995e394

Detection Methods for CVE-2026-107698

Indicators of Compromise

  • FFmpeg log entries containing Status 3xx Redirecting to followed by non-rtsp:// URLs such as http://, file://, or gopher://.
  • Outbound connections from media processing hosts to internal RFC1918 addresses, loopback, or cloud metadata endpoints (169.254.169.254).
  • Unexpected FFmpeg child processes initiating TCP connections to administrative ports (8080, 9200, 6379, 2375).

Detection Strategies

  • Inspect application logs for RTSP redirect events whose Location scheme differs from rtsp or satip.
  • Correlate FFmpeg process execution with network flows targeting internal subnets that media workloads should never contact.
  • Flag RTSP source URLs supplied by untrusted users or captured from external APIs for review before processing.

Monitoring Recommendations

  • Enable verbose FFmpeg logging in processing pipelines and ship logs to a central SIEM for scheme-based alerting.
  • Baseline egress traffic from transcoding hosts and alert on deviations to internal services or metadata IPs.
  • Monitor for libavformat version strings below 7.1.4 or 8.0.2 across build artifacts and container images.

How to Mitigate CVE-2026-107698

Immediate Actions Required

  • Upgrade FFmpeg to 7.1.4, 8.0.2, or later across all systems and container images.
  • Audit applications that embed libavformat and rebuild them against a patched release.
  • Restrict RTSP ingestion to trusted sources until patching is complete.

Patch Information

The FFmpeg project addressed the issue through Pull Request #22292. The relevant fixes are landed in commit 2326bc5f, commit 7c011995, commit ea9e85e5, and commit f9aa8729. Additional context is available in the VulnCheck advisory.

Workarounds

  • Place FFmpeg workers in a network segment that cannot reach internal management or metadata endpoints.
  • Enforce egress firewall rules that deny traffic from transcoding hosts to RFC1918 ranges, loopback, and 169.254.0.0/16.
  • Pre-validate user-supplied stream URLs and reject any input whose host resolves to private or link-local addresses.
bash
# Example egress restriction for FFmpeg processing containers
iptables -A OUTPUT -m owner --uid-owner ffmpeg -d 169.254.169.254 -j REJECT
iptables -A OUTPUT -m owner --uid-owner ffmpeg -d 127.0.0.0/8 -j REJECT
iptables -A OUTPUT -m owner --uid-owner ffmpeg -d 10.0.0.0/8 -j REJECT
iptables -A OUTPUT -m owner --uid-owner ffmpeg -d 172.16.0.0/12 -j REJECT
iptables -A OUTPUT -m owner --uid-owner ffmpeg -d 192.168.0.0/16 -j REJECT

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.