Commit 482459e
debugger: validate sec-websocket-accept response header
This addresses a TODO to validate that the sec-websocket-accept header
in the WebSocket handshake response is valid. To do this we need to
append the WebSocket GUID to the original key sent in sec-websocket-key,
sha1 hash it, and then compare the base64 encoding with the value sent
in the sec-websocket-accept response header.
If they don't match, an error is thrown.
PR-URL: #39357
Refs: nodejs/node-inspect#93
Reviewed-By: Colin Ihrig <[email protected]>1 parent 43d28f5 commit 482459e
File tree
2 files changed
+23
-4
lines changed- lib/internal/debugger
- src
2 files changed
+23
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
38 | 43 | | |
39 | 44 | | |
40 | 45 | | |
41 | 46 | | |
42 | 47 | | |
43 | 48 | | |
44 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
45 | 63 | | |
46 | 64 | | |
47 | 65 | | |
| |||
292 | 310 | | |
293 | 311 | | |
294 | 312 | | |
295 | | - | |
296 | | - | |
| 313 | + | |
| 314 | + | |
297 | 315 | | |
298 | 316 | | |
299 | 317 | | |
| |||
302 | 320 | | |
303 | 321 | | |
304 | 322 | | |
305 | | - | |
| 323 | + | |
306 | 324 | | |
307 | 325 | | |
308 | 326 | | |
| |||
319 | 337 | | |
320 | 338 | | |
321 | 339 | | |
322 | | - | |
| 340 | + | |
323 | 341 | | |
324 | 342 | | |
325 | 343 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| 74 | + | |
74 | 75 | | |
75 | 76 | | |
76 | 77 | | |
| |||
0 commit comments