Skip to content
Laskyr

symfony/symfony security advisory

CVE-2026-121949: HtmlSanitizer Does Not URL-Sanitize srcset and imagesrcset: Media Scheme and Host Allow-List Bypass in symfony/symfony

CVE-2026-121949 is a medium-severity security vulnerability in the PHP package symfony/symfony (CVSS 5.4), published 5 November 2026. It is fixed in 6.4.50, 7.4.23 and 8.1.11, one per release line; earlier versions on each line are affected. It can be exploited without an account.

published 2026-11-05 · updated 2026-11-06

5.4 Medium CVSS 3.1

Fixed in symfony/symfony 6.4.50, 7.4.23 and 8.1.11

This security issue affects symfony/symfony in 3 release lines: >= 6.1.0, < 6.4.50; >= 7.0.0, < 7.4.23; >= 8.0.0, < 8.1.11. Upgrade to the fixed version for your release line (6.4.50, 7.4.23 and 8.1.11). The newest release, 8.2.0, is not affected.

Affected versions
>= 6.1.0, < 6.4.50
>= 7.0.0, < 7.4.23
>= 8.0.0, < 8.1.11
Fixed in
6.4.50, 7.4.23, 8.1.11
Newest release
8.2.0
Type
Security issue
CWE-184, CWE-1023
Exploited in the wild
Not on the CISA KEV list
checked 2026-11-29

Is your symfony/symfony version affected?

Run composer show symfony/symfony in your project, then enter the version. We check it against this and every other known symfony/symfony advisory.

Who can exploit CVE-2026-121949

Your app is only exposed if it uses the affected part of symfony/symfony. The advisory below says which part that is. If you are not sure, upgrade anyway: it costs less than finding out.

Technical details

CVSS 3.1 breakdown

Attack vector
Network (remote)
Attack complexity
Low
Privileges required
None
User interaction
Required
Scope
Unchanged
Confidentiality impact
Low
Integrity impact
Low
Availability impact
None

CVSS vector (scored by CISA ADP): CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N

How to fix CVE-2026-121949 in symfony/symfony

  1. Find the installed version: composer show symfony/symfony. If you never required it yourself, composer why symfony/symfony shows which package pulls it in.
  2. Update it: composer update symfony/symfony --with-all-dependencies. You need the fixed version for your release line (6.4.50, 7.4.23 and 8.1.11).
  3. If Composer will not go that high, your composer.json constraint is holding it back. Widen it (for example "symfony/symfony": "^8.1.11" if you can take that version), or upgrade the package that requires it.
  4. Run composer audit. It reads the same advisory data and should no longer list CVE-2026-121949.
  5. Commit composer.lock and deploy it. On the server, run composer install --no-dev from the lock file, not composer update.

If you cannot upgrade yet

General hardening for this kind of issue while the upgrade waits. None of it replaces the fix.

Is your project exposed to CVE-2026-121949?

Check the one package here, or check everything your project installs at once.

  1. Check symfony/symfony Enter your installed version and compare it with every known symfony/symfony advisory. Check my version
  2. Check your whole composer.lock The free checker compares every locked package with the same advisory data composer audit uses. Check composer.lock

The CVE-2026-121949 advisory

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.

Description from the CVE record, via the NVD entry for CVE-2026-121949. Advisory title: “HtmlSanitizer Does Not URL-Sanitize srcset and imagesrcset: Media Scheme and Host Allow-List Bypass”.

References

Other symfony/symfony advisories

Related

Need help patching or upgrading? Laskyr does PHP and Laravel security fixes and upgrades. Tell us what you run and we reply with a plan and a price.

Ask about a fix

Where this data comes from

First hour checklist

If the site was just hacked, read the emergency kit before you delete files. The page is free. Email is optional.

Read the emergency kit

The box is optional and does not affect the kit. Privacy policy.