Skip to content

fix(sandbox): prevent URLs in bash commands from being flagged as unsafe paths#1468

Open
alumpzs wants to merge 2 commits intobytedance:mainfrom
alumpzs:fix/sandbox-url-false-positive
Open

fix(sandbox): prevent URLs in bash commands from being flagged as unsafe paths#1468
alumpzs wants to merge 2 commits intobytedance:mainfrom
alumpzs:fix/sandbox-url-false-positive

Conversation

@alumpzs
Copy link
Copy Markdown

@alumpzs alumpzs commented Mar 27, 2026

The absolute path regex falsely matched URL path components (e.g. //example.com from https://...) as local filesystem paths, causing skill invocations with domainUrl parameters to fail with "Unsafe absolute paths" errors.

Fix: before running the absolute-path regex, strip URLs that use whitelisted schemes (https, http, ftp, s3, gs, data) from the command string. The URL pattern uses a word-boundary lookbehind to avoid substring matches (e.g. tftp, ahttps) and is case-insensitive. Dangerous protocols like file://, gopher://, dict:// are intentionally excluded from the whitelist so they remain subject to path validation.

…afe paths

The absolute path regex falsely matched URL path components (e.g.
//example.com from https://...) as local filesystem paths,
causing skill invocations with domainUrl parameters to fail with
"Unsafe absolute paths" errors.

Fix: before running the absolute-path regex, strip URLs that use
whitelisted schemes (https, http, ftp, s3, gs, data) from the command
string. The URL pattern uses a word-boundary lookbehind to avoid
substring matches (e.g. tftp, ahttps) and is case-insensitive.
Dangerous protocols like file://, gopher://, dict:// are intentionally
excluded from the whitelist so they remain subject to path validation.
@alumpzs alumpzs changed the title fix(sandbox): prevent URLs in bash commands from being flagged as uns… fix(sandbox): prevent URLs in bash commands from being flagged as unsafe paths Mar 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant