Commit b70264a
Sanitize peer-controlled addresses in cluster debug log lines
The find_leader and _query_leader debug logs interpolated
``node.address`` (and the equivalent ``address`` parameter)
directly via ``%s``. The sibling ``errors.append`` /
``ClusterError`` paths route the same value through
``_sanitize_display_text`` to strip CRLF / control chars /
U+2028 / U+2029 / bidi formatting characters.
The asymmetry meant a hostile peer could inject log lines
into operator log streams via the DEBUG channel even though
the same string was sanitised at every other display
surface. The inline comment at the existing aggregate-error
sanitise sites already commits the module to "sanitise at
every user-facing boundary" — debug logs are an operator-
facing boundary too.
Sanitize:
- ``find_leader`` no-leader / timed-out / transport-error
debug lines.
- ``_query_leader`` malformed-redirect debug lines.
- ``_check_redirect`` policy-rejected debug line.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent c0cc5ad commit b70264a
1 file changed
Lines changed: 21 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
206 | 206 | | |
207 | 207 | | |
208 | 208 | | |
209 | | - | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
210 | 212 | | |
211 | 213 | | |
212 | 214 | | |
| |||
356 | 358 | | |
357 | 359 | | |
358 | 360 | | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
359 | 371 | | |
360 | 372 | | |
361 | | - | |
| 373 | + | |
362 | 374 | | |
363 | 375 | | |
364 | 376 | | |
365 | | - | |
366 | | - | |
367 | | - | |
368 | | - | |
369 | | - | |
370 | | - | |
371 | | - | |
372 | | - | |
373 | | - | |
374 | 377 | | |
375 | 378 | | |
376 | 379 | | |
| 380 | + | |
377 | 381 | | |
378 | 382 | | |
379 | | - | |
| 383 | + | |
380 | 384 | | |
381 | 385 | | |
382 | 386 | | |
383 | 387 | | |
384 | | - | |
| 388 | + | |
385 | 389 | | |
386 | 390 | | |
387 | 391 | | |
388 | 392 | | |
389 | 393 | | |
390 | 394 | | |
| 395 | + | |
391 | 396 | | |
392 | 397 | | |
393 | | - | |
| 398 | + | |
394 | 399 | | |
395 | 400 | | |
396 | 401 | | |
| |||
452 | 457 | | |
453 | 458 | | |
454 | 459 | | |
455 | | - | |
| 460 | + | |
456 | 461 | | |
457 | 462 | | |
458 | 463 | | |
| |||
469 | 474 | | |
470 | 475 | | |
471 | 476 | | |
472 | | - | |
| 477 | + | |
473 | 478 | | |
474 | 479 | | |
475 | 480 | | |
| |||
0 commit comments