fix(bazel/http-server): prevent directory traversal bypass in Http Server#3763
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces credential sanitization for child process logs and outputs to prevent token leakage, adds comprehensive tests for this sanitization, and updates the HTTP server's directory traversal check by appending path separators. Feedback on these changes highlights three key issues: first, blindly appending path.sep can cause false-positive directory traversal errors when resolving system root paths; second, converting raw buffer chunks directly to strings without setting 'utf8' encoding can corrupt multi-byte characters; and third, the sanitization regex should use * instead of + for the password group to correctly redact URLs with empty passwords.
08daa58 to
057a2b6
Compare
|
This PR was merged into the repository. The changes were merged into the following branches:
|
This PR resolves a directory traversal weakness in the HttpServer by appending path separators to root and joined paths before comparison. Vulnerability: 7ed5a82a