Releases: dbohdan/starlark-python
Releases · dbohdan/starlark-python
v0.6.0
v0.5.0
This release improves the interpreter's resource accounting and error normalization. It is the result of a security review by Claude Fable 5 and Claude Opus 4.8. The sandbox boundary (no access to filesystem, network, or subprocesses and no introspection escape) was also reviewed. The review found no problems with it.
-
Fixes:
- Limited integer magnitude. Starlark integers are now capped at
MAX_INT_BITS = 2^19bits (approximately 158k decimal digits). - Large integers are now charged against the heap counter by bit length.
float,bool, andNoneremain uncharged. - Narrowed the error handler for argument binding so a genuine internal
TypeErrorraised inside a builtin is no longer mislabeled as an argument error. - Replaced leaked Python exceptions with
EvalError:- Added a guarded for the
%cstring-format conversion:'%c' % 1114112and oversized values now raise anEvalErrorinstead of leaking a PythonValueError/OverflowError. This matches thechr()builtin. - Limited structural recursion in value comparison. Code like
x == x,x in [x], andsorted([x, x])on a deeply nested value constructed at runtime will now raise anEvalErrorinstead of leaking aRecursionError. - Stringifying an oversized integer (via
str,repr,%s,%d, orfoo.format()) now raises anEvalErrorinstead of leaking CPython'sValueErroroverint_max_str_digits. - Changed builtin dispatch to normalize unexpected Python exceptions to
EvalError. Resource-limit exceptions still propagate as-is.MemoryErroris deliberately re-raised because it is an error of the host environment.
- Added a guarded for the
- Limited integer magnitude. Starlark integers are now capped at
-
Documentation:
- Documented the new limits in
security/threat-model.mdand the README. - Marked the two 2026-05-05 security reviews superseded. They predated resource limiting.
- Documented the new limits in
v0.4.0
v0.3.0
- Features:
- Added new character and codepoint manipulation methods/functions:
chr(),ord(),str.elem_ords(),str.codepoints(), andstr.codepoint_ords(). - REPL improvements:
- Added support for evaluating statements.
- Added
readlineintegration.
- Added new character and codepoint manipulation methods/functions:
- Fixes:
- Fixed lexer exceptions on invalid integer formats (e.g.,
0x). - Added a check to catch
floatvalue overflow.
- Fixed lexer exceptions on invalid integer formats (e.g.,
- Integrated Hypothesis for property-based testing.
- Optimized zipapp size.