Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
d5a31e7
[experiment] python
AlexandreYang Apr 11, 2026
b4649e7
feat(builtins): add python builtin using gpython (Python 3.4)
AlexandreYang Apr 11, 2026
897491c
test(python): add comprehensive scenario tests for python builtin
AlexandreYang Apr 11, 2026
ed14463
test(python): add comprehensive scenario tests for gpython features, …
AlexandreYang Apr 11, 2026
db70723
feat(python): re-implement python builtin with custom pure-Go interpr…
AlexandreYang Apr 11, 2026
2fb7a38
Fix CI failures: gofmt, compliance, data race in pyruntime
AlexandreYang Apr 11, 2026
b688bdf
feat(python): block host environment access; fix callObject data race
AlexandreYang Apr 11, 2026
2736bec
fix(python): route os.listdir/stat/path.exists through AllowedPaths s…
AlexandreYang Apr 11, 2026
e4e5f8d
fix(pyruntime): add bounds checks for integer conversions flagged by …
AlexandreYang Apr 11, 2026
f5235f8
feat(python): remove os.getcwd and os.path.expanduser to block host p…
AlexandreYang Apr 11, 2026
6787523
fix(analysis): remove os.Getwd/UserHomeDir from allowlist, add math.M…
AlexandreYang Apr 11, 2026
6ac03b1
docs: replace Python 3.4 references with Python 3 in SHELL_FEATURES.md
AlexandreYang Apr 11, 2026
0010b10
refactor(python): move interpreter from builtins/internal/pyruntime t…
AlexandreYang Apr 12, 2026
9198cb8
revert: cosmetic changes to analysis files
AlexandreYang Apr 12, 2026
fe0adcd
[iter 1] fix(python): address P1/P2/P3 security and correctness revie…
AlexandreYang Apr 12, 2026
1e48364
[iter 2] fix(python): address self-review findings — OOM limits, big-…
AlexandreYang Apr 12, 2026
d5a640f
[iter 3] Fix bitwise big-int truncation, write() on read-only files, …
AlexandreYang Apr 13, 2026
ccdfb67
[iter 4] Fix drainGenerator infinite loop, defaultdict stub, and modu…
AlexandreYang Apr 13, 2026
c3266c3
[iter 4] fix(python): remove context.Background fallback in drainGene…
AlexandreYang Apr 13, 2026
65656cf
[iter 5] Fix bytes(n)/bytearray(n) OOM, generator goroutine leak, inp…
AlexandreYang Apr 13, 2026
96c650e
[iter 1] fix(python): address security review comments — exponentiati…
AlexandreYang Apr 13, 2026
9921440
[iter 2] fix(python): address review comments — drainIter cap, genera…
AlexandreYang Apr 13, 2026
33786a9
[iter 3] fix(python): address codex review comments — correctness fixes
AlexandreYang Apr 13, 2026
ef38545
[iter 4] fix(python): address generator deadlock, iterator bounds, an…
AlexandreYang Apr 13, 2026
e935676
[iter 5] Address review comments: docs and sandbox test coverage
AlexandreYang Apr 13, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions SHELL_FEATURES.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Blocked features are rejected before execution with exit code 2.
- ✅ `ping [-c N] [-W DURATION] [-i DURATION] [-q] [-4|-6] [-h] HOST` — send ICMP echo requests to a network host and report round-trip statistics; `-f` (flood), `-b` (broadcast), `-s` (packet size), `-I` (interface), `-p` (pattern), and `-R` (record route) are blocked; count/wait/interval are clamped to safe ranges with a warning; multicast, unspecified (`0.0.0.0`/`::`), and broadcast addresses (IPv4 last-octet `.255`) are rejected — note: directed broadcasts on non-standard subnets (e.g. `.127` on a `/25`) are not blocked without subnet-mask knowledge
- ✅ `ps [-e|-A] [-f] [-p PIDLIST]` — report process status; default shows current-session processes; `-e`/`-A` shows all; `-f` adds UID/PPID/STIME columns; `-p` selects by PID list
- ✅ `printf FORMAT [ARGUMENT]...` — format and print data to stdout; supports `%s`, `%b`, `%c`, `%d`, `%i`, `%o`, `%u`, `%x`, `%X`, `%e`, `%E`, `%f`, `%F`, `%g`, `%G`, `%%`; format reuse for excess arguments; `%n` rejected (security risk); `-v` rejected
- ✅ `python [-c CODE] [-h] [SCRIPT | -] [ARG ...]` — execute Python 3 source code using the gpython pure-Go interpreter (no CPython required); `-c CODE` runs inline code; a positional `SCRIPT` argument runs a file (via AllowedPaths sandbox); `-` reads from stdin; security sandbox removes all OS exec/write/spawn functions, replaces `open()` with a read-only AllowedPaths-aware version, and blocks `tempfile`/`glob` modules; source files and stdin are capped at 1 MiB; stdlib includes `math`, `string`, `sys`, `os` (read-only), `binascii`, `json` (dumps only; loads raises ValueError), `collections` (OrderedDict, Counter, deque, defaultdict — defaultdict default_factory raises NotImplementedError if provided); blocked modules: `subprocess`, `socket`, `ctypes`, `tempfile`, `glob`, `threading`, `multiprocessing`, `asyncio`, `re` (raises ImportError on import); known limitation: `import os.path` raises ImportError — use `from os import path` instead
- ✅ `sed [-n] [-e SCRIPT] [-E|-r] [SCRIPT] [FILE]...` — stream editor for filtering and transforming text; uses RE2 regex engine; `-i`/`-f` rejected; `e`/`w`/`W`/`r`/`R` commands blocked
- ✅ `strings [-a] [-n MIN] [-t o|d|x] [-o] [-f] [-s SEP] [FILE]...` — print printable character sequences in files (default min length 4); offsets via `-t`/`-o`; filename prefix via `-f`; custom separator via `-s`
- ✅ `tail [-n N|-c N] [-q|-v] [-z] [FILE]...` — output the last part of files (default: last 10 lines); supports `+N` offset mode; `-f`/`--follow` is rejected
Expand Down
210 changes: 196 additions & 14 deletions analysis/symbols_builtins.go

Large diffs are not rendered by default.

Loading
Loading