Commit 909cb59
committed
bug symfony#59269 [Security/Csrf] Trust "Referer" at the same level as "Origin" (nicolas-grekas)
This PR was merged into the 7.2 branch.
Discussion
----------
[Security/Csrf] Trust "Referer" at the same level as "Origin"
| Q | A
| ------------- | ---
| Branch? | 7.2
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Issues | symfony/demo#1542
| License | MIT
As hinted by `@GromNaN` in symfony/demo#1542 (comment), there are proxies that mess up with the `Origin` header, but forward a valid `Referer` header. Since both headers have the same level of trust, I'm proposing to trust them both equally. At the moment, `Origin` overrides `Referer`. With this PR, we check both and accept if just `Referer` matches.
Commits
-------
6cd974b [Security/Csrf] Trust "Referer" at the same level as "Origin"File tree
2 files changed
+28
-2
lines changed- src/Symfony/Component/Security/Csrf
- Tests
2 files changed
+28
-2
lines changedLines changed: 14 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
227 | 227 | | |
228 | 228 | | |
229 | 229 | | |
230 | | - | |
| 230 | + | |
| 231 | + | |
231 | 232 | | |
232 | | - | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
233 | 245 | | |
234 | 246 | | |
235 | 247 | | |
| |||
Lines changed: 14 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
103 | 117 | | |
104 | 118 | | |
105 | 119 | | |
| |||
0 commit comments