Skip to content

fix(api): sanitize every legacy alias log field with sanitizeLogParam - #1438

Merged
scttbnsn merged 2 commits into
dev/v1.8from
fix/v1.8-legacy-alias-log-sanitize
Oct 20, 2026
Merged

scttbnsn merged 2 commits into
dev/v1.8from
fix/v1.8-legacy-alias-log-sanitize

Conversation

@scttbnsn

@scttbnsn scttbnsn commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

CodeQL alert 3157 (js/drydock-log-injection) blocks the rc.3 sync to main. The removed-API-path log line used a local cleaner CodeQL doesn't recognise and wrote req.method and req.ip raw, so all four fields now go through sanitizeLogParam, with a test for control characters and ANSI in method and IP.

Second commit updates the backend's transitive follow-redirects from 1.16.0 to 1.16.1 for GHSA-8r9p-f939-6h3c, which the pre-push qlty scan started failing on today. Both are in the rc.3 changelog section.

🔒 Security

  • Sanitize path, user agent, HTTP method, and remote IP with sanitizeLogParam.
  • Prevent control-character and ANSI-sequence injection in legacy API alias logs.
  • Address CodeQL alert 3157.

✨ Added

  • Test method and remote IP sanitization.

  • Test 200-character path truncation.

  • follow-redirects update and changelog entry were not verified in the inspected files.

  • Test execution results are unavailable.

@vercel

vercel Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
drydock-website Ready Ready Preview Oct 20, 2026 6:23pm UTC
drydockdemo-website Ready Ready Preview Oct 20, 2026 6:23pm UTC

@coderabbitai

coderabbitai Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: CodesWhat/drydock/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 49dc98ae-b2f3-49c1-9289-c1ed1c30ec3c
📥 Commits

Reviewing files that changed from the base of the PR and between ddc8eee and a2d91a7.

⛔ Files ignored due to path filters: 2
  • CHANGELOG.md is excluded by !CHANGELOG.md
  • app/package-lock.json is excluded by !**/package-lock.json, !**/package-lock.json
📒 Files selected for processing: 2
  • app/api/legacy-alias-diagnostics.test.ts
  • app/api/legacy-alias-diagnostics.ts

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

📝 Walkthrough

Legacy API alias diagnostics now use the shared sanitizeLogParam helper for the path, user agent, HTTP method, and remote IP. Tests cover path truncation and removal of newlines, carriage returns, and ANSI escape sequences.

Priority: ⬇️ Low

Change: Bug fix

Merge Risk: ⚪ Minimal · up to a2d91

No actionable merge-blocking risk was identified in this change.

Pre-merge checks: Passed 2
Check name Status Explanation
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches: 💡 1
🛠️ Fix failing CI checks: 💡
  • Commit to this branch
  • Create a new PR
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Oct 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@scttbnsn
scttbnsn merged commit a5c275a into dev/v1.8 Oct 20, 2026
@scttbnsn
scttbnsn deleted the fix/v1.8-legacy-alias-log-sanitize branch October 20, 2026 18:57

This branch was successfully deployed

2 active deployments
Preview – drydock-website — a2d91a74 Deployed Oct 20, 2026 by vercel[bot]
Preview – drydockdemo-website — a2d91a74 Deployed Oct 20, 2026 by vercel[bot]
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.

1 participant