Commit 20d9ec5
Merge commit from fork
* fix: trim horizontal tabs (HTAB) in multi-entry X-Forwarded-For parser
RFC 7230 §3.2.3 defines OWS as *( SP / HTAB ). The multi-entry parser
only recognized SP (0x20) but not HTAB (0x09), leaving tab characters
preserved in returned address strings. This allowed security-control
evasion via exact-string-match bypasses when the header has 2+ comma-
separated values.
The single-entry fast path was unaffected because it uses JavaScript's
built-in .trim(), which already strips tabs.
Fixes GHSA-2849-m2w7-xm8f.
* test: cover HTAB (tab) OWS trimming
Ref: GHSA-2849-m2w7-xm8f
---------
Co-authored-by: Ulises Gascon <ulisesgascongonzalez@gmail.com>1 parent 1b45df7 commit 20d9ec5
2 files changed
Lines changed: 25 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
117 | 141 | | |
118 | 142 | | |
119 | 143 | | |
| |||
0 commit comments