Commit f542e74
http: guard against response splitting in trailers
Commit 3c293ba ("http: protect against response splitting attacks")
filters out newline characters from HTTP headers but forgot to apply
the same logic to trailing HTTP headers, i.e., headers that come after
the response body. This commit rectifies that.
The expected security impact is low because approximately no one uses
trailing headers. Some HTTP clients can't even parse them.
PR-URL: #2945
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Reviewed-By: Rod Vagg <r@va.gg>1 parent 2084f52 commit f542e74Copy full SHA for f542e74
File tree
Expand file treeCollapse file tree
2 files changed
+22
-9
lines changedOpen diff view settings
Filter options
- lib
- test/parallel
Expand file treeCollapse file tree
2 files changed
+22
-9
lines changedOpen diff view settings
Collapse file
+9-6Lines changed: 9 additions & 6 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
295 | 295 | |
296 | 296 | |
297 | 297 | |
298 | | - |
299 | | - |
300 | | - |
301 | | - |
302 | | - |
| 298 | + |
303 | 299 | |
304 | 300 | |
305 | 301 | |
| ||
481 | 477 | |
482 | 478 | |
483 | 479 | |
| 480 | + |
| 481 | + |
| 482 | + |
| 483 | + |
| 484 | + |
| 485 | + |
| 486 | + |
484 | 487 | |
485 | 488 | |
486 | 489 | |
| ||
496 | 499 | |
497 | 500 | |
498 | 501 | |
499 | | - |
| 502 | + |
500 | 503 | |
501 | 504 | |
502 | 505 | |
|
Collapse file
test/parallel/test-http-header-response-splitting.js
Copy file name to clipboardExpand all lines: test/parallel/test-http-header-response-splitting.js+13-3Lines changed: 13 additions & 3 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
4 | 4 | |
5 | 5 | |
6 | 6 | |
7 | | - |
| 7 | + |
8 | 8 | |
9 | 9 | |
10 | 10 | |
| ||
29 | 29 | |
30 | 30 | |
31 | 31 | |
32 | | - |
| 32 | + |
| 33 | + |
| 34 | + |
| 35 | + |
| 36 | + |
| 37 | + |
| 38 | + |
33 | 39 | |
34 | | - |
| 40 | + |
35 | 41 | |
36 | 42 | |
37 | 43 | |
| ||
70 | 76 | |
71 | 77 | |
72 | 78 | |
| 79 | + |
| 80 | + |
| 81 | + |
| 82 | + |
73 | 83 | |
74 | 84 | |
75 | 85 | |
|
0 commit comments