safe_eval: other unbounded ops can still build huge values (str.ljust, **, big-int)
Author: KrishP147Created Sep 23, 2026Updated Sep 23, 2026
Follow-up from #7473 (sequence-repetition DoS in `safe_eval`, fixed in the PR for that issue).
While fixing #7473, found other ways to build arbitrarily large values through both `safe_eval` implementations (`core/framework/graph/safe_eval.py` and `core/framework/graph/code_sandbox.py`) that are still unbounded:
- `'a'.ljust(10**8)` succeeds — string-padding methods aren't bounded.
- `` / big-int exponentiation (e.g. `210**9`) is unbounded in both evaluators.
- The sandbox's only real backstop is its execution timeout, which appears to use `signal`-based alarms — those likely don't work on Windows, so on that platform there may be no timeout protection at all for a runaway computation.
Not fixed as part of #7473 since it's a distinct set of operations/root causes, but flagging since it's the same vulnerability class (unbounded resource consumption in "safe" eval).
Generated with Claude Code
Source: aden-hive/hive