Commit 65b54f1
fix(main): address medium-severity security findings (#15)
* fix(main): address medium-severity security findings
- Bound HTTP response reads to 1 MB via io.LimitReader to prevent unbounded memory allocation
- Replace configInitialized bool with sync.Once to eliminate potential data race
- Warn when client secret is passed via CLI flag as it may be visible in process listings
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* ci(workflows): remove non-existent make generate step
The lint job referenced `make generate` which has no corresponding
Makefile target, causing CI to fail.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix(main): return explicit error on oversized responses
Address Copilot review feedback:
- Fix comment from "1 MB" to "1 MiB" (1<<20 is a mebibyte)
- Read maxResponseSize+1 bytes and return a clear "response too large"
error instead of silently truncating (which caused confusing JSON
parse errors)
- Extract readResponseBody helper to deduplicate the pattern
- Add tests for readResponseBody (within limit, at limit, exceeds limit)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent 9bc1791 commit 65b54f1
3 files changed
Lines changed: 80 additions & 24 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | 35 | | |
40 | 36 | | |
41 | 37 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
| |||
55 | 56 | | |
56 | 57 | | |
57 | 58 | | |
| 59 | + | |
58 | 60 | | |
59 | 61 | | |
60 | 62 | | |
| |||
96 | 98 | | |
97 | 99 | | |
98 | 100 | | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
| 101 | + | |
| 102 | + | |
103 | 103 | | |
| 104 | + | |
104 | 105 | | |
105 | 106 | | |
106 | 107 | | |
107 | 108 | | |
108 | 109 | | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
109 | 116 | | |
110 | 117 | | |
111 | 118 | | |
| |||
262 | 269 | | |
263 | 270 | | |
264 | 271 | | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
265 | 291 | | |
266 | 292 | | |
267 | 293 | | |
| |||
341 | 367 | | |
342 | 368 | | |
343 | 369 | | |
344 | | - | |
| 370 | + | |
345 | 371 | | |
346 | 372 | | |
347 | 373 | | |
| |||
405 | 431 | | |
406 | 432 | | |
407 | 433 | | |
408 | | - | |
| 434 | + | |
409 | 435 | | |
410 | 436 | | |
411 | 437 | | |
| |||
472 | 498 | | |
473 | 499 | | |
474 | 500 | | |
475 | | - | |
| 501 | + | |
476 | 502 | | |
477 | 503 | | |
478 | 504 | | |
| |||
531 | 557 | | |
532 | 558 | | |
533 | 559 | | |
534 | | - | |
| 560 | + | |
535 | 561 | | |
536 | 562 | | |
537 | 563 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
4 | 6 | | |
5 | 7 | | |
6 | 8 | | |
| |||
276 | 278 | | |
277 | 279 | | |
278 | 280 | | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
279 | 313 | | |
280 | 314 | | |
281 | 315 | | |
| |||
0 commit comments