unsloth/studio/backend/core
Michael Han fa4693685f Studio: close third-round sandbox guard review gaps
Runtime guard (sitecustomize):
- Keep the network guard active when a sandbox child deletes
  UNSLOTH_STUDIO_SANDBOXED but still loads this shim from the sandbox_site dir
  on PYTHONPATH. Bypass runs under bypass_site (guard short-circuits on
  __name__), so an absent flag with sandbox_site loaded is tampering, not
  bypass. Regression test spawns a real deleted-flag child.

Terminal startup-guard (hard block in _bash_exec):
- A here-doc piped into a consumer (cat <<'PY' | python) keeps the post-delimiter
  pipeline so the body is scanned as that python's stdin program.
- Process substitution: recurse into <(...)/>(...) inner commands, and fail
  closed when python reads its program from one (python <(printf ...)).

render_html network gate (auto-approve path):
- Module re-exports (export * from 'https://...', export {a} from '/mod.js')
  are gated like static imports; relative specifiers stay static.
- A reassigned computed-key alias (var k='src'; img[k]=URL; var k='title') is
  position-dependent, so it is dropped from the flat alias map and fails closed
  on a network-looking assigned value.

Adds blocked + safe regression cases for each.

Not addressed: the spoofed-trusted-httpx-frame P1 (exec(compile(payload,
httpx.__file__,'exec'), httpx.__dict__)). Same same-interpreter forgeability
class already flagged for a below-the-Python-layer redesign; a frame check
keyed on caller-suppliable co_filename cannot close it robustly.
2026-07-21 23:26:35 -07:00
..
data_recipe Replace standalone Studio wording with Unsloth (#7221) 2026-07-19 00:47:04 -07:00
export Studio: quiet noisy logs, log real progress, and speed up Windows/macOS dataset prep (#7087) 2026-07-15 06:49:52 -07:00
inference Studio: close third-round sandbox guard review gaps 2026-07-21 23:26:35 -07:00
rag Studio: Data settings tab, uploaded files manager, quant pinning, and chat image preview fix (#7029) 2026-07-20 04:57:44 -07:00
training Fix resume training crash recovery and MLX checkpoints (#6796) 2026-07-21 02:34:58 -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: Inkling support fixes (#7153) 2026-07-15 11:22:38 -07:00