Skip to content

fix(ASV-4361): close five log-redaction and dispatch findings - #64

Merged
2k-joker merged 2 commits into
mainfrom
fix/asv-4361
Jul 17, 2026
Merged

2k-joker merged 2 commits into
mainfrom
fix/asv-4361

Conversation

@2k-joker

@2k-joker 2k-joker commented Jul 17, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Fixes all five findings in the ASV-4361 code-audit and bug-bounty epic. Four touch LogRedactor; one touches Request dispatch.

Ticket Severity Fix
ASV-4364 Low Replace a filtered key's Hash/Array value with redactor_string instead of serializing and truncating it, which leaked the leading and trailing bytes of nested secrets.
ASV-4362 Medium Recurse unfiltered hash values through the shared redact dispatcher so content/regex filters run against string values inside JSON bodies and headers, not only top-level strings.
ASV-4092 Low Substitute with gsub's block form so a filter's replacement stays literal. The string form expanded backreferences (\1, \&), re-emitting the secret in plaintext.
ASV-4090 Low Skip nil captures from zero-width groups instead of concatenating nil and raising TypeError, which silently dropped audit-log entries in production.
ASV-4091 Low Dispatch the validated sym_method rather than the caller's raw object. send resolves a non-Symbol argument via to_str, so an object with divergent to_sym/to_str bypassed the HTTP-method allow-list.

Testing

  • Added specs for each finding: nested-collection redaction, content filters on hash values, literal backreference handling, empty-capture safety, and the to_sym/to_str dispatch guard.
  • bundle exec rspec — 122 examples, 0 failures.
  • bundle exec rubocop — no offenses.

Ran /simplify, /code-review, and /security-review over the diff. /simplify and /code-review surfaced a dispatcher-duplication cleanup and redundant regex recompilation, both applied. /security-review found no new vulnerabilities.

🤖 Generated with Claude Code

2k-joker and others added 2 commits July 17, 2026 09:28
Address the httpigeon code-audit and bug-bounty epic:

- ASV-4364: replace filtered Hash/Array values wholesale so partial
  redaction no longer leaks fragments of nested secrets.
- ASV-4362: recurse unfiltered hash values through the shared dispatcher
  so content/regex filters catch secrets in JSON bodies and headers, not
  just top-level strings.
- ASV-4092: substitute with gsub's block form so replacements stay
  literal instead of expanding backreferences (\1, \&) that re-emit the
  secret.
- ASV-4090: skip nil captures from zero-width groups instead of
  concatenating nil and raising TypeError, which dropped log entries.
- ASV-4091: dispatch the validated symbol, not the caller's object, so a
  to_sym/to_str divergence can no longer bypass the method allow-list.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Line coverage sat at 94.47% on main, below the 95% gate; the release-PR
job skips unit-test, so main drifted under unnoticed. Add a spec for the
middleware's rescue path, which logs a request that raises before
re-raising — the audit-log path ASV-4090 protects. Coverage now 95.16%.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@2k-joker
2k-joker merged commit ef56054 into main Jul 17, 2026
3 checks passed
@2k-joker
2k-joker deleted the fix/asv-4361 branch July 17, 2026 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants