Commit cf56327
http2: validate initialWindowSize per HTTP/2 spec
The HTTP/2 spec (RFC 7540) defines SETTINGS_INITIAL_WINDOW_SIZE
maximum as 2^31-1. Values above this must be treated as a
FLOW_CONTROL_ERROR. Previously, Node.js allowed values up to
2^32-1 which caused nghttp2_submit_settings() to return
NGHTTP2_ERR_INVALID_ARGUMENT, triggering an uncatchable
assertion failure and crashing the process.
This change adds proper validation to reject values >= 2^31
with a catchable RangeError before they reach nghttp2.
PR-URL: #61402
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Tim Perry <pimterry@gmail.com>1 parent d8a1cde commit cf56327Copy full SHA for cf56327
3 files changed
+8-3Lines changed: 8 additions & 3 deletions
File tree
Expand file treeCollapse file tree
Open diff view settings
Filter options
- lib/internal/http2
- test/parallel
Expand file treeCollapse file tree
Open diff view settings
Collapse file
+3-2Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
230 | 230 | |
231 | 231 | |
232 | 232 | |
| 233 | + |
233 | 234 | |
234 | 235 | |
235 | 236 | |
| ||
989 | 990 | |
990 | 991 | |
991 | 992 | |
992 | | - |
| 993 | + |
993 | 994 | |
994 | 995 | |
995 | 996 | |
| ||
1014 | 1015 | |
1015 | 1016 | |
1016 | 1017 | |
1017 | | - |
| 1018 | + |
1018 | 1019 | |
1019 | 1020 | |
1020 | 1021 | |
|
Collapse file
test/parallel/test-http2-getpackedsettings.js
Copy file name to clipboardExpand all lines: test/parallel/test-http2-getpackedsettings.js+3-1Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
20 | 20 | |
21 | 21 | |
22 | 22 | |
23 | | - |
| 23 | + |
24 | 24 | |
25 | 25 | |
26 | 26 | |
| ||
42 | 42 | |
43 | 43 | |
44 | 44 | |
| 45 | + |
| 46 | + |
45 | 47 | |
46 | 48 | |
47 | 49 | |
|
Collapse file
test/parallel/test-http2-session-settings.js
Copy file name to clipboardExpand all lines: test/parallel/test-http2-session-settings.js+2Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
133 | 133 | |
134 | 134 | |
135 | 135 | |
| 136 | + |
| 137 | + |
136 | 138 | |
137 | 139 | |
138 | 140 | |
|
0 commit comments