You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(api): sanitize every legacy alias log field with sanitizeLogParam - #1438
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.
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: 2
Check name
Status
Explanation
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
path, user agent, HTTP method, and remote IP withsanitizeLogParam.✨ Added
Test method and remote IP sanitization.
Test 200-character path truncation.
follow-redirectsupdate and changelog entry were not verified in the inspected files.Test execution results are unavailable.