Commit c76b831
committed
[ext/session] Validate session.cookie_samesite against allowed values
Add OnUpdateSessionSameSite() INI handler that enforces the SameSite
whitelist (Strict, Lax, None, or empty string), rejecting any other
value with E_WARNING. Previously OnUpdateSessionStr() accepted arbitrary
strings including CRLF sequences, which were appended verbatim into the
Set-Cookie header. The php_setcookie() function has a TODO comment for
the same gap; this addresses it at the INI layer.1 parent 5e45c17 commit c76b831
File tree
2 files changed
+49
-1
lines changed- ext/session
- tests
2 files changed
+49
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
733 | 733 | | |
734 | 734 | | |
735 | 735 | | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
736 | 753 | | |
737 | 754 | | |
738 | 755 | | |
| |||
904 | 921 | | |
905 | 922 | | |
906 | 923 | | |
907 | | - | |
| 924 | + | |
908 | 925 | | |
909 | 926 | | |
910 | 927 | | |
| |||
Lines changed: 31 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
0 commit comments