fix(yq): reject YAML aliases before parsing - #2280
Merged
chaliy merged 1 commit intoAug 7, 2026
Merged
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
bashkit | 5d3221c | Commit Preview URL | Aug 07 2026, 09:23 AM |
chaliy
force-pushed
the
2026-08-07-propose-fix-for-yq-yaml-alias-vulnerability
branch
from
August 7, 2026 09:22
2309e34 to
5d3221c
Compare
chaliy
deleted the
2026-08-07-propose-fix-for-yq-yaml-alias-vulnerability
branch
August 7, 2026 09:32
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.
Motivation
serde_yaml_ngand amplifying memory/CPU before Bashkit's budget/deadline/output limits apply.Description
reject_yaml_aliases(input: &str)called fromparse_yaml_documentsto detect and reject alias tokens (*) before deserialization while preserving*inside quoted, single-quoted, multiline-quoted, and block scalar content. (crates/bashkit/src/builtins/yq.rs)token_starts_atandis_block_scalar_headerhelpers to avoid false positives and to treat block scalar headers correctly. (crates/bashkit/src/builtins/yq.rs)yaml_aliases_are_rejected_before_expansionthat verifies aliases fail closed and that legitimate scalar asterisks remain valid. (crates/bashkit/tests/integration/yq_integration_tests.rs)crates/bashkit/docs/yq.md,knowledge/operations/limitations.md,knowledge/security/threat-model.md)Testing
cargo fmt --all -- --checksucceeded,just check-okfsucceeded, andjust check-doc-linkssucceeded.cargo test -p bashkit --no-default-features --features jq --test integration yq_integration_tests::yaml_aliases_are_rejected_before_expansion -- --exactfailed to complete because the workspace currently has unrelated compilation errors incrates/bashkit/src/builtins/archive.rs(type mismatches), so the new test could not be executed to completion in this environment.Codex Task