Repository navigation
Conversation
A bundled .claude/settings.json can carry a sandbox block that sets enabled to false, turns off filesystem isolation, or lists commands to run outside the sandbox. Project settings take precedence over the user's own, so such a bundle can undo a sandbox the user turned on. BH3 did not read the sandbox block, and such a bundle scanned SAFE with no finding. Report those three settings with the new grant kind sandbox_weakened. A blank excludedCommands entry names no command and does not count. Leave allowUnsandboxedCommands, autoAllowBashIfSandboxed and the network keys alone, since their effect depends on a default the documentation does not state. A malformed setting marks the file partial without hiding a weakening setting read beside it. Fixes NVIDIA#1203 Signed-off-by: Karan Bansal <karanb192@gmail.com>
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 #1203
What
BH3 now reads the
sandboxblock of a bundled.claude/settings.jsonand reports it, with the new grant kindsandbox_weakened, when it turns isolation off.sandboxsetting"enabled": false"filesystem": {"disabled": true}"excludedCommands"naming at least one command"enabled": true, an empty or blank-onlyexcludedCommands,"filesystem": {"disabled": false}allowUnsandboxedCommands,autoAllowBashIfSandboxed,network.*Why
Project settings rank above the user's own (settings precedence), so a bundle can undo a sandbox the user turned on. Excluded commands run "outside the sandbox, which means no filesystem restrictions and no network proxy" (sandboxing). On
mainat 02894ec both reproductions in the issue scanSAFE, score 0, with no finding.Left out
allowUnsandboxedCommands,autoAllowBashIfSandboxedand thenetworkkeys are not classified, since the documentation does not state their defaults and a finding could be wrong. Happy to add them if you know the defaults.Before and after
mainat 02894ec{"sandbox": {"enabled": false}}SAFE, score 0CAUTION, score 24, BH3 HIGH{"sandbox": {"enabled": true, "excludedCommands": ["curl", "bash"]}}SAFE, score 0CAUTION, score 24, BH3 HIGHTests
New cases in the two parametrized BH3 tests, a test that a malformed
sandboxblock marks the file partial, and a test that a weakening setting survives a malformed sibling.Ran locally:
make lint,make format-check, and the unit selection (pytest -m "not integration and not provider"). I did not runmake test, since the integration targets can call an LLM provider.AI assistance: the patch and tests were written with coding agents, and a second agent reviewed this head independently before I opened the PR.