fix(cron): skip NUL-bearing remote fallback content in lifecycle guard - #80005
fix(cron): skip NUL-bearing remote fallback content in lifecycle guard#8000533hodl wants to merge 1 commit into
Conversation
|
Closing as superseded by #80258, which fixes this whole bug class architecturally rather than per-callsite: path candidates are sanitized once at the ingestion boundary (NUL/empty/unexpandable tokens rejected before any OS call), text from any Your report and fix targeted a real member of this class — thank you. The per-callsite patches kept leaving sibling frames exposed (#76762 → #77703 → #77780 → #78256 each crashed one frame away from the previous fix), which is why we went with the boundary fix instead of merging the fragments individually. #80258 carries regression tests for the NUL-path, binary-callback, oversized-read, unset-HOME, and walk-crash cases plus an adversarial never-raises sweep. |
Summary
Harden the reusable gateway-lifecycle guard against NUL-bearing remote fallback content:
ValueErrorcrashes.Why
Upstream #77703 fixed the
terminal_toolpath (its_read_script_in_envpre-filters binary output); this diff sits on top of that work. However, the reusablecontains_gateway_lifecycle_command_or_referenced_scriptAPI accepts an arbitraryread_remote_scriptcallback and can be called directly. Raw NUL-bearing fallback bytes were still treated as shell text, so a binary containing lifecycle-looking strings could false-block a benign command. This makes the guard itself robust regardless of caller pre-filtering.Validation
pytest tests/hermes_cli/test_gateway_restart_loop.py -q -o 'addopts='— 86 passed, including two new regressions:git diff --checkclean.