CVE-2021-41267: Webcache Poisoning via X-Forwarded-Prefix and sub-request

Description

When a Symfony application is running behind a proxy or a load-balancer, you can tell Symfony to look for the X-Forwarded-* HTTP headers. HTTP headers that are not part of the "trusted_headers" allowed list are ignored and protect you from "Cache poisoning" attacks.

In Symfony 5.2, we've added support for the X-Forwarded-Prefix header, but this header was accessible in sub-requests, even if it was not part of the "trusted_headers" allowed list. An attacker could leverage this opportunity to forge requests containing a X-Forwarded-Prefix HTTP header, leading to a web cache poisoning issue.

Resolution

Symfony now ensures that the X-Forwarded-Prefix HTTP header is not forwarded to sub-requests when it is not trusted.

The patch for this issue is available here for branch 5.3.

Credits

We would like to thank Soner Sayakci for reporting the issue and Jérémy Derussé for fixing the issue.

                Sponsor the Symfony project.

https://symfony.com/blog/cve-2021-41267-webcache-poisoning-via-x-forwarded-prefix-and-sub-request?utm_source=Symfony%20Blog%20Feed&utm_medium=feed

Created 3y | Nov 24, 2021, 9:20:08 AM


Login to add comment

Other posts in this group

Symfony meetup: Join Nicolas Grekas in Tunis on April 12th!

Nous sommes heureux de vous annoncer le retour des meetups Symfony à Tunis !🎉 Rejoignez dès maintenant le groupe "Symfony User group Tunis" pour suivre les actualités et futurs meetup de la communauté

Apr 2, 2025, 7:10:06 AM | Symfony
A Week of Symfony #952 (March 24–30, 2025)

This week, Symfony 6.4.20 and 7.2.5 maintenance versions were released. In addition, Symfony successfully celebrated the SymfonyLive Paris 2025 conference and continued preparations for next week's Sy

Mar 30, 2025, 9:30:09 AM | Symfony
Symfony 6.4.20 released

Symfony 6.4.20 has just been released. Here is the list of the most important changes since 6.4.19:

bug #60054 [Form] Use duplicate_preferred_choices to set value of ChoiceType (@aleho)

bug #5985

Mar 28, 2025, 3:40:28 PM | Symfony
Symfony 7.2.5 released

Symfony 7.2.5 has just been released. Here is the list of the most important changes since 7.2.4:

bug #60054 [Form] Use duplicate_preferred_choices to set value of ChoiceType (@aleho)

bug #60026

Mar 28, 2025, 3:40:27 PM | Symfony
SymfonyLive Berlin 2025 starts in a week!

SymfonyLive Berlin 2025 is almost here! Join us next week for an exciting event filled with fresh talks, inspiring speakers, and everything you need to make the most of this incredible gatheri

Mar 26, 2025, 8:10:11 AM | Symfony
New Core Team Member, Symfony CLI

After announcing the Symfony UX Core Team and adding more core team members earlier this year, I'm back again with a great addition to the Symfony Core Team. I'm very excited to announce that Tugdual

Mar 24, 2025, 4:40:18 PM | Symfony
A Week of Symfony #951 (March 17–23, 2025)

This week, the upcoming Symfony 7.3 version updated its default configuration to exclude container extensions, entities and messenger messages when registering services, and made some changes related

Mar 23, 2025, 10:40:03 AM | Symfony