fix(security): strip Basic Auth credentials from HTTP request logs and sanitize upload filenames#2469
Open
beejak wants to merge 1 commit intobaptisteArno:mainfrom
Open
Conversation
…d sanitize upload filenames Basic Auth credentials (username/password) extracted from request headers were included in the request object and serialized verbatim into execution logs. Any user with log access — including bot owners reviewing their execution history — could read plaintext passwords. A safeRequest object omitting username/password is now passed to all log entries while the original request (with credentials) is still used for the actual HTTP call. Additionally, user-supplied file names in upload URL generation were used without sanitization. basename() is now applied to strip any directory components before constructing the S3 key and file URL. Some code in this commit was written with assistance from a developer using AI tooling.
|
@beejak is attempting to deploy a commit to the Typebot Team on Vercel. A member of the Team first needs to authorize it. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Two security issues found in the HTTP request block execution path and file upload URL generation.
1. Basic Auth credentials leaked in execution logs (High)
executeHttpRequestBlock.tsextractsusernameandpasswordfrom theAuthorization: Basic ...header into abasicAuthobject and spreads it onto therequestobject. That samerequestobject is then serialized verbatim into every log entry — success, HTTP error, timeout, and unknown error.Anyone with access to bot execution logs (the bot owner, workspace admins, or anyone with log storage access) can read plaintext passwords from any HTTP block that uses Basic Auth.
Before:
After:
2. Unsanitized filename in S3 key construction (Medium)
handleGenerateUploadUrl.tsincorporates the user-suppliedfileNamedirectly into the S3 object key and thefileUrlreturned to the client without any sanitization. While S3 doesn't resolve../as filesystem traversal, the raw filename could contain path separators that produce unexpected key structures or confuse downstream URL parsing.Fix:
basename(fileName)applied before building the key, stripping any directory components.Test plan
headersandurlbut nousername/passwordfields../../../evil.txt— S3 key and returnedfileUrlshould useevil.txtonly🤖 Generated with Claude Code