Commit 95db544
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 <cjihrig@gmail.com>1 parent c6a7c3d commit 95db544
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 | | |
| |||
287 | 305 | | |
288 | 306 | | |
289 | 307 | | |
290 | | - | |
291 | | - | |
| 308 | + | |
| 309 | + | |
292 | 310 | | |
293 | 311 | | |
294 | 312 | | |
| |||
297 | 315 | | |
298 | 316 | | |
299 | 317 | | |
300 | | - | |
| 318 | + | |
301 | 319 | | |
302 | 320 | | |
303 | 321 | | |
| |||
314 | 332 | | |
315 | 333 | | |
316 | 334 | | |
317 | | - | |
| 335 | + | |
318 | 336 | | |
319 | 337 | | |
320 | 338 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| 73 | + | |
73 | 74 | | |
74 | 75 | | |
75 | 76 | | |
| |||
0 commit comments