fix: sanitize declarative post-install output - #846
Open
rustytrees wants to merge 1 commit into
Open
Conversation
Pipe declarative run-step stdout and stderr through the same terminal sanitizer used by the native DSL. This prevents formula-controlled OSC 52 and other active terminal sequences from reaching the user by default. Keep JSON stdout suppression and the explicit raw-output opt-out intact, and add a regression that captures the bytes emitted by a hostile run step.
Owner
|
@rustytrees Thanks for the contribution! One small request: could you please instruct your agent to follow the PR template provided in the repository for PRs? It helps keep the PRs consistent and easier to review. Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Declarative run-step stdout and stderr now pass through the existing terminal sanitizer. The Ruby-like DSL and declarative execution paths share the same child-pump implementation. JSON stdout suppression and
MALT_ALLOW_RAW_POST_INSTALL=1keep their existing behavior.A formula controls both the executable and arguments for a declarative run step. Before this change, the child inherited the terminal directly and could emit OSC 52 clipboard writes or other active terminal controls. The regression runs a keg-local echo helper with an OSC 52 payload. Before the fix, the captured stream still contained byte
0x1b. After the fix, the visible text remains but the escape sequence is removed.Related Issue
Closes #848.
Notes for Reviewers
The PoC run exited 1 with 2,424 of 2,425 tests passing. Verification after the fix completed with:
zig build: 8 of 8 steps succeededzig build test-one: 2,425 passedzig build test-bin: 331 of 331 steps succeededzig build test: 331 of 331 steps succeeded; 5,060 tests passed and 3 skippedThe first full-suite attempt inherited HTTPS connections opened before a local firewall correction and was stopped with exit 130. A fresh run after the correction completed with the results above.