Commit 84bdd8d
net.http: h2 server — reject NUL/CR/LF octets in request field values
RFC 9113 §8.2.1: a field value MUST NOT contain NUL (0x00), LF (0x0a), or CR
(0x0d). The new request validation checked field names but not values, so a value
with an embedded CR/LF was accepted and passed through into req.header — a
malformed request and, if the request were forwarded to an HTTP/1.x peer, a
header-injection / request-smuggling vector. Reject such values (and the same
octets in pseudo-header values) as a stream error.
Found by a requirements-driven review pass (RFC §8.2.1) — not covered by the
h2spec suite. Adds a unit test (CR/LF in a field value -> RST_STREAM).
Co-Authored-By: WOZCODE <contact@withwoz.com>1 parent 51c8732 commit 84bdd8d
2 files changed
Lines changed: 30 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
46 | 59 | | |
47 | 60 | | |
48 | | - | |
49 | | - | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
50 | 64 | | |
51 | 65 | | |
52 | 66 | | |
53 | 67 | | |
54 | 68 | | |
55 | 69 | | |
56 | 70 | | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
57 | 74 | | |
58 | 75 | | |
59 | 76 | | |
| |||
79 | 96 | | |
80 | 97 | | |
81 | 98 | | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
82 | 102 | | |
83 | 103 | | |
84 | 104 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
433 | 433 | | |
434 | 434 | | |
435 | 435 | | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
436 | 444 | | |
437 | 445 | | |
438 | 446 | | |
| |||
0 commit comments