Repository navigation
fix(security): confine start_security_scan paths to the workspace - #4850
Open
mangeshraut712 wants to merge 8 commits into
Open
mangeshraut712 wants to merge 8 commits into
mangeshraut712 wants to merge 8 commits into
Conversation
mangeshraut712
requested review from
a team,
awsbyron,
jigar-lab,
jzgithub28 and
ljainiaz
as code owners
October 25, 2026 21:41
Contributor
Author
|
Quick ping — this one is green and ready for review when you have a moment. It confines |
Contributor
Author
|
Friendly bump — CI is green and this is ready for review when you have a minute. Happy to adjust anything. |
Contributor
Author
|
Still green — ready for merge when convenient. |
Contributor
Author
|
@ljainiaz @jigar-lab @jzgithub28 @awsbyron CI is green and the contributor statement check is passing. It confines |
Contributor
Author
|
CI is green. Confines start_security_scan paths to the workspace. Please review and merge when you can. |
mangeshraut712
force-pushed
the
fix/security-scan-workspace-bound
branch
from
October 27, 2026 14:36
4455510 to
a0c79f2
Compare
This branch has not been deployed
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.
Fixes #4811
Summary
Changes
start_security_scanaccepted any path, so../or an absolute path could point a scan (and the source upload) outside the workspace. This resolves the requested path and requires it to sit insideWORKSPACE_ROOT, or the server's working directory when that isn't set. A workspace at the filesystem root is refused, since it can't constrain anything. The check runs before S3 bucket setup or the scanner is invoked. Symlinks that resolve outside the workspace are rejected the same way (realpath).User experience
Before: a scan request could reference files anywhere on the host. After: paths outside the workspace are rejected with a clear error and nothing is uploaded.
Checklist
Tests: tool-level cases for
../traversal, absolute paths outside the workspace, symlink escape, filesystem-root workspace refusal, and cwd-fallback escape.uv run pytest -q(86 passed intests/test_server.py),ruff check, andpyrightare clean.Is this a breaking change? (Y/N) N, unless someone relied on scanning paths outside the workspace.
Acknowledgment
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the project license.