Skip to content

fix(security): batch 1 — issues #488-#492#501

Merged
chaliy merged 2 commits intomainfrom
claude/batch-issue-processing-EdJOm
Mar 3, 2026
Merged

fix(security): batch 1 — issues #488-#492#501
chaliy merged 2 commits intomainfrom
claude/batch-issue-processing-EdJOm

Conversation

@chaliy
Copy link
Contributor

@chaliy chaliy commented Mar 3, 2026

Summary

Fixes 5 security issues from the 2026-03 audit (batch 1 of 3):

Changes

  • Added is_internal_variable() guards to all builtin variable insertion paths
  • Extended is_internal_variable() with _ARRAY_READ_ and _EVAL_CMD
  • Filtered internal markers from set and declare -p output
  • Replaced native arithmetic operators with wrapping_* variants in compound assignment
  • Added depth tracking to lexer read_command_subst_into()
  • Un-ignored 12 security regression tests that now pass

Test plan

  • All 12 security audit regression tests pass
  • Full test suite passes (cargo test --all-features)
  • cargo fmt --check clean
  • cargo clippy --all-targets --all-features -- -D warnings clean

Closes #488, closes #489, closes #490, closes #491, closes #492

claude added 2 commits March 3, 2026 02:31
- #488: Add is_internal_variable() guard to declare/readonly/local/export
  builtins that previously bypassed the check via direct HashMap insert
  (TM-INJ-012 to TM-INJ-015)

- #489: Add _ARRAY_READ_ and _EVAL_CMD to is_internal_variable() check,
  preventing arbitrary array creation via marker prefix injection
  (TM-INJ-016)

- #490: Filter internal marker variables from set and declare -p output,
  preventing information disclosure of nameref/readonly/case markers
  (TM-INF-017)

- #491: Replace native +/-/* operators with wrapping variants in compound
  assignment paths; clamp shift amounts to 0..63 in <<=/>>=; add
  i64::MIN/-1 overflow protection for / and % (TM-DOS-043)

- #492: Add depth tracking to lexer read_command_subst_into() to prevent
  stack overflow from deeply nested $() in double-quoted strings
  (TM-DOS-044)

Closes #488, closes #489, closes #490, closes #491, closes #492
Fixes cargo-vet audit failure for ipnet version bump.
@chaliy chaliy merged commit 06dfa05 into main Mar 3, 2026
17 checks passed
@chaliy chaliy deleted the claude/batch-issue-processing-EdJOm branch March 3, 2026 02:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment