CVE-2026-121949

Symfony: HtmlSanitizer Does Not URL-Sanitize srcset and imagesrcset: Media Scheme and Host Allow-List Bypass

Published Nov 5, 2026 CVSS 4.0 · 2.3 Low EPSS < 1% KEV · Not listed
Description
The Symfony HtmlSanitizer component does not apply the media URL policy to the srcset and imagesrcset attributes, allowing values that point to hosts or schemes not permitted by allowMediaSchemes() or allowMediaHosts() to bypass it, so that browsers load images from disallowed hosts in Symfony versions 6.1.x prior to 6.4.50, 7.x prior to 7.4.23, and 8.x prior to 8.1.11.The srcset attribute on img and source elements and the imagesrcset attribute on link elements are allowed by the sanitizer, but their URL candidates are never validated, so their values are kept verbatim while the same URL in src is dropped. The fixes for CVE-2026-45753 and CVE-2026-48761 extended the same attribute list but did not cover these two attributes. For example, with allowMediaSchemes(['https']) and allowMediaHosts(['trusted.example']), <img srcset="https://evil.example/a.png 1x"> survives sanitization, and the browser fetches the selected candidate as it would fetch src. Candidates with a scheme forbidden by the configuration, such as http, are kept as well.
Any application that sanitizes untrusted HTML and relies on the media schemes and hosts allowlists to restrict where images can be loaded from is affected. A single crafted value is enough to make the browser of a user viewing the sanitized content send a request to an attacker-controlled host, which can be used to track viewers or log their IP addresses. No authentication is needed if the application accepts HTML from unauthenticated users.

Analysis

AI-generated

Technical impact

The Symfony HtmlSanitizer component improperly handles URL validation for the srcset and imagesrcset attributes. When user‑supplied HTML containing these attributes is processed, the sanitizer does not apply the configured media scheme or host allow‑list checks, retaining any specified URLs that would otherwise be rejected. Consequently, a browser rendering the sanitized content will request images from arbitrary hosts, enabling an attacker to collect viewer IP addresses or monitor traffic. The flaw can be triggered by a single crafted value in untrusted HTML and does not require authentication.

Affected Systems

Impact extends to installations of the Symfony framework released by sensiolabs. Vulnerable releases include Symfony 6.1.x prior to 6.4.50, Symfony 7.x prior to 7.4.23, and Symfony 8.x prior to 8.1.11. Any application that calls the HtmlSanitizer component to sanitize input from users—authenticated or unauthenticated—runs the risk of exposing its visitors to external media requests.

Risk and Exploitability

The CVSS score of 2.3 indicates low overall severity, and the EPSS score is not available while the vulnerability is not listed in the CISA KEV catalog. Nevertheless, exploitation is straightforward: it requires only submitting crafted HTML to the sanitizer. Because no authentication is needed, the risk is present even for public forms. Although the impact is limited to user‑initiated requests, the vulnerability can compromise user privacy through unsolicited external traffic.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade Symfony to at least 6.4.50, 7.4.23, or 8.1.11.
  • Configure allowMediaSchemes and allowMediaHosts to limit media sources to trusted hosts.
  • If an upgrade is delayed, strip the srcset and imagesrcset attributes from user‑supplied HTML before passing it to the sanitizer.

Generated by OpenCVE AI on November 5, 2026 at 20:28 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
Metrics cvssV3_1

{'score': 5.4, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N'}

Type Values Removed Values Added
Description The Symfony HtmlSanitizer component does not apply the media URL policy to the srcset and imagesrcset attributes, allowing values that point to hosts or schemes not permitted by allowMediaSchemes() or allowMediaHosts() to bypass it, so that browsers load images from disallowed hosts in Symfony versions 6.1.x prior to 6.4.50, 7.x prior to 7.4.23, and 8.x prior to 8.1.11.The srcset attribute on img and source elements and the imagesrcset attribute on link elements are allowed by the sanitizer, but their URL candidates are never validated, so their values are kept verbatim while the same URL in src is dropped. The fixes for CVE-2026-45753 and CVE-2026-48761 extended the same attribute list but did not cover these two attributes. For example, with allowMediaSchemes(['https']) and allowMediaHosts(['trusted.example']), <img srcset="https://evil.example/a.png 1x"> survives sanitization, and the browser fetches the selected candidate as it would fetch src. Candidates with a scheme forbidden by the configuration, such as http, are kept as well. Any application that sanitizes untrusted HTML and relies on the media schemes and hosts allowlists to restrict where images can be loaded from is affected. A single crafted value is enough to make the browser of a user viewing the sanitized content send a request to an attacker-controlled host, which can be used to track viewers or log their IP addresses. No authentication is needed if the application accepts HTML from unauthenticated users.
Title Symfony: HtmlSanitizer Does Not URL-Sanitize srcset and imagesrcset: Media Scheme and Host Allow-List Bypass
First Time appeared Sensiolabs
Sensiolabs symfony
Weaknesses CWE-1023
CWE-184
CPEs cpe:2.3:a:sensiolabs:symfony:*:*:*:*:*:*:*:*
Vendors & Products Sensiolabs
Sensiolabs symfony
References
Metrics cvssV4_0

{'score': 2.3, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N'}

Weaknesses
  • CWE-1023

    Incomplete Comparison with Missing Factors

  • CWE-184

    Incomplete List of Disallowed Inputs

Sources

Status
PUBLISHED
Assigner
Checkmarx
Published
Updated
Nov 5, 2026, 7:59 PM
Reserved
Nov 4, 2026, 12:43 PM
Status
Awaiting Analysis
Published
Nov 5, 2026, 6:17 PM
Modified
Nov 6, 2026, 9:40 PM
Severity
Moderate
Public date
Nov 5, 2026, 5:46 PM