Skip to content

fix: address audit findings from PR #611 - #653

Merged
shrinedogg merged 1 commit into
polarsquad:mainfrom
lmilbaum:fix/pr-611-audit-fixes
Oct 23, 2026
Merged

shrinedogg merged 1 commit into
polarsquad:mainfrom
lmilbaum:fix/pr-611-audit-fixes

Conversation

@lmilbaum

Copy link
Copy Markdown
Collaborator

Summary

  • Fixes local ZARF shadowing in verify-package.sh that silently ignored a caller-supplied ZARF env var (MEDIUM)
  • Re-injects AIRGAP_VERIFY_WORKFLOW_REF in the real-zarf test harness so branch-dispatch real-zarf mode testing works correctly (MEDIUM)
  • Replaces rmdir "$STAGING" with rm -rf "$STAGING" to prevent a set -e abort leaving phase=cutover with deploy never run (LOW)
  • Adds explicit catch-all to apply() state machine rejecting unknown/corrupted phases with a clear error (LOW/NOTE)
  • Replaces bare sync with sync "$STAGING/$ACTIVE_NAME" to limit filesystem flush scope (NOTE)
  • Documents the TOCTOU limitation in acquire_lock and the unknown-state refusal in docs/airgap.md
  • Adds 4 new stub-mode scenarios to test-airgap-update-rollback.py exercising each fix

Audit findings identified in the #611 review by @shrinedogg.

🤖 Generated with Claude Code

- verify-package.sh: fix `local ZARF` shadowing so caller's ZARF override is respected
- update-package.sh: replace bare `sync` with `sync "$STAGING/$ACTIVE_NAME"`
- update-package.sh: replace `rmdir "$STAGING"` with `rm -rf "$STAGING"` after swap
- update-package.sh: reject unknown/corrupted state phases in apply() (explicit allowlist)
- update-package.sh: document TOCTOU limitation in acquire_lock comment
- test-airgap-update-rollback.py: re-inject AIRGAP_VERIFY_WORKFLOW_REF in real-zarf mode
- test-airgap-update-rollback.py: add 4 new stub scenarios covering the fixes
- docs/airgap.md: note race-free limitation and unknown-state apply refusal

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
@lmilbaum lmilbaum self-assigned this Oct 22, 2026
@lmilbaum
lmilbaum marked this pull request as ready for review October 22, 2026 12:40
@lmilbaum
lmilbaum requested a review from shrinedogg October 22, 2026 12:40
@shrinedogg
shrinedogg merged commit 07130a7 into polarsquad:main Oct 23, 2026
8 checks passed
@lmilbaum
lmilbaum deleted the fix/pr-611-audit-fixes branch October 23, 2026 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants