unsloth/studio
danielhanchen eae716675b studio/sandbox: close 7 bypass classes from cross-reviewer round-6 audit
Round-6 sonnet-panel review surfaced seven more concrete bypass
classes. All seven are now closed (629 tests passing, 60 new R6
regression tests):

1. Path traversal under home prefix. `~/../etc/shadow`,
   `~root/../etc/shadow`, `~ubuntu/../../etc/shadow`, and
   `/home/u/../u/.aws/credentials` all slipped because
   `_normalize_path_separators` re-attached the home prefix even
   when `..` had escaped it. Now when the tail of a home-prefixed
   path begins with `..`, the projection is treated as absolute
   (mirroring the runtime resolve when HOME is a single-segment path
   like `/root`). POSIX `~<user>/` tilde-user expansion is
   handled the same way.

2. Pandas / numpy reader keyword arguments. `pd.read_csv(filepath_or_buffer='/etc/shadow')`,
   `pd.read_excel(io=...)`, `np.fromfile(fname=...)` used the actual
   API parameter names that the previous gate's `{"file", "path"}`
   kwarg list missed. The kwarg set is expanded to cover
   `filepath_or_buffer`, `path_or_buf`, `fname`, `filename`, `io`,
   `buf`, `source`, `src` and a few common variants.

3. Bash directory exfil verbs. `cp -r ~/.ssh /tmp/out`, `mv ~/.aws /tmp`,
   `tar czf out.tar.gz ~/.ssh`, `rsync -av ~/.aws/ /tmp/`,
   `zip -r out.zip ~/.ssh` previously slipped because
   `_find_sensitive_paths` only flagged named files, leaving the
   bash side asymmetric to the Python shutil dir-exfil gate. A new
   `_BASH_DIR_EXFIL_RE` matches dir-copy verbs (`cp`, `mv`, `rsync`,
   `tar`, `zip`, `7z`, `scp`, `sftp`, `xz`) followed by a sensitive
   directory. `ls ~/.ssh` and `find ~/.aws -type f` stay allowed.

4. Inner-tree alias walk for eval / exec. `exec("import shutil as sh\nsh.copytree('~/.ssh', dst)")`
   slipped because the inner AST visit did not re-run the
   alias-tracking pre-pass that built `shutil_module_aliases`.
   Extracted both pre-pass loops into helpers (`_run_alias_prepass`,
   already had `_run_string_binding_prepass`) and call both on each
   literal eval / exec payload before the visitor recurses.

5. Chained assignment. `a = b = '/etc/shadow'; open(a).read()`
   slipped because the binding pre-pass only handled
   `len(targets) == 1`. Multi-target Assign nodes now bind every
   Name target to the resolved value.

6. Annotated assignment. `path: str = '/etc/shadow'; open(path)`
   slipped because the binding pre-pass walked `ast.Assign` but
   not `ast.AnnAssign`. Same-shape handler for single Name target.

7. Brace-bomb empty-alt bypass. `cat ~/{,x0,...,x341}/{.ssh/id_rsa,other}`
   exhausts the expansion cap before the empty alt's second-brace
   projection reaches `~/.ssh/id_rsa`. A defensive
   `_SENSITIVE_IN_BRACE_RE` catches sensitive-name fragments inside
   an unexpanded brace group attached to a sensitive root,
   regardless of whether the brace expansion completed. Anchored
   with `(?<=[,{/])` lookbehind and `(?=,|\}|/)` lookahead so
   project-local lookalikes (`./workspace/home/u/{a,b}/...`) stay
   allowed via the `_PATH_TOKEN_START` boundary.

NetworkAndIoVisitor inner-tree pre-pass. The visitor eval / exec
recursion now mirrors SignalEscapeVisitor's call to both
`_run_alias_prepass` and `_run_string_binding_prepass` so it is
independently correct regardless of visitor execution order.

Cumulative bypass closures across rounds 1 through 6: 24 distinct
classes, 629 regression tests, three-OS green.
2026-05-24 15:14:33 +00:00
..
backend studio/sandbox: close 7 bypass classes from cross-reviewer round-6 audit 2026-05-24 15:14:33 +00:00
frontend studio: fix toast close-button click and light-mode hover (#5597) 2026-05-19 00:55:55 -07:00
src-tauri studio: expose launcher capability bits on unauth /api/health (#5486) 2026-05-17 21:29:24 -07:00
__init__.py Final cleanup 2026-03-12 18:28:04 +00:00
install_llama_prebuilt.py tests/studio: lock in Windows GPU detection fix (#5106) with a synthetic CI test (#5376) 2026-05-18 00:06:01 -07:00
install_python_stack.py studio: skip flash-attn install on Blackwell GPUs (sm_100+) (#5420) 2026-05-14 18:13:50 +04:00
LICENSE.AGPL-3.0 Add AGPL-3.0 license to studio folder 2026-03-09 19:36:25 +00:00
setup.bat Final cleanup 2026-03-12 18:28:04 +00:00
setup.ps1 CI: scope GITHUB_TOKEN permissions, add MLX CI, unblock ~60 skipped tests (#5312) 2026-05-11 03:19:13 -07:00
setup.sh Route CPU-only Linux x86_64 to ggml-org/llama.cpp prebuilts (#5302) 2026-05-05 23:22:22 -07:00
Unsloth_Studio_Colab.ipynb studio: add --local to setup.sh + overlay unsloth-zoo from git main (#5252) 2026-05-02 08:51:56 +04:00