fix(security): clear CodeQL residual #11/#7/#1/#3#66
Merged
Conversation
Rebuild data: image URLs via charset copy so img.src never receives the original tainted string; update SetExecHook tests to match script bodies on stdin after bash -s migration. Co-authored-by: Cursor <cursoragent@cursor.com>
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
Clear the four CodeQL alerts that remained open on
mainafter PR #55 by fixing sinks (not dismissing/suppressing):server/internal/sandbox/ssh.gosess.Start/Runon barestringsafeCmd;run/runInput/openTerminalonly accept validated argv;render()re-validates+quotes at sink;ExecvianewSafeCmd; scripts viaExecScript(bash/sh-s+ stdin) so bodies never reach Start/Runengine.goint32(n)inSetAutoRetryMaxautoRetryMax→atomic.Int64; onlyn<0→0; no MaxInt32 product clamp; boundary testschat_view.jsimg.src = urlafter boolean checksanitizeImageURLreturns safe string; only return value assigned toimg.srcAlso:
safe_image_urlMIME whitelist tightened (png/jpeg/gif/webp; reject svg+xml);node --testhooked intoci-sandbox(static-jsjob). Does not regress #55 TOFU /quoteShellPath/ host-key pinning.Test plan
go test ./internal/sandbox/(includesTestNewSafeCmdRejectsMetacharacters,TestExecRejectsUnvalidatedArgv)go test ./internal/engine/ -run TestSetAutoRetryMaxInt64Boundsnode --test sandbox-gateway/sandbox/web/static/js/ui/safe_image_url_test.jsci-server,ci-sandbox(incl.static-js),securityCodeQL analyzeAcceptance (page verification)
mainand wait for Security / CodeQL onmain.Made with Cursor