unsloth/studio/backend/core
danielhanchen 7f8c4d7a8f Harden sandbox classifier: brace expansion, prefixed/nested shell reads, unbound MRO gadget
- Model bash brace expansion (comma lists) before the block and read scans, so a payload such
  as {touch,/tmp/x} or {python3,-c} '...' is seen as the writer / interpreter bash actually
  runs. Only unquoted groups with a top-level comma expand; {} (find -exec), ${VAR} parameter
  expansion, numeric {1..5} sequences and quoted braces are left intact, and expansion is
  bounded.
- Resolve the reader / command word in the shell-string sensitive-read scan past leading
  VAR=value assignments and command wrappers (env / nice / timeout / ...), flag a VAR=value
  whose value is a sensitive path, and recursively scan a nested bash -c '<payload>' shell, so
  a read hidden behind a normal command-prefix form is caught. The classifier and terminal
  scanners now share one _scan_command_string_for_reads with a strict_traversal knob (strict
  for os.system shell strings, lenient .. for benign in-tree terminal navigation).
- Treat unbound MRO / getattribute access on a guarded file class as the same recovery gadget
  as io.FileIO.__mro__: type.mro(io.FileIO), type.__getattribute__(io.FileIO, '__mro__') /
  object.__getattribute__(..., 'mro'), and getattr(io.FileIO, '__mro__') are blocked.

Adds TestRound25Bypasses plus terminal brace / prefixed-read regression tests.
2026-07-10 04:41:56 +00:00
..
data_recipe Studio: harden background consumer loops and streaming paths against silent UI freezes (#6653) 2026-06-26 03:31:33 -07:00
export Studio: multi-select export formats, portable FP8/INT8, GGUF LoRA, and source parity (#6767) 2026-07-03 08:25:10 -07:00
inference Harden sandbox classifier: brace expansion, prefixed/nested shell reads, unbound MRO gadget 2026-07-10 04:41:56 +00:00
rag Run the malware gate on the RAG embedding model before it loads (#6887) 2026-07-07 04:30:21 -07:00
training Add MLX backend support for CLI unsloth train (#6709) 2026-07-08 03:25:26 -07:00
__init__.py Reduce and tighten code comments and docstrings repo-wide (#6095) 2026-06-08 23:09:51 -07:00
_torchao_stub.py Reduce and tighten code comments and docstrings repo-wide (#6095) 2026-06-08 23:09:51 -07:00
import_guards.py Studio: self-heal unsloth namespace shadows; clearer failed-load messages (#6532) 2026-06-21 22:43:31 -07:00
tool_healing.py Studio: parse Mistral [TOOL_CALLS] and rehearsal tool-call shapes (#5704) 2026-07-06 18:52:13 -07:00