security: constrain standalone application payloads - #520
Conversation
|
Multi-angle review of this PR (fixed runtime allowlist replacing recursive copy_tree, addresses #510). This is a security-boundary change so I pushed hard on it — four findings, ranked by severity; the third was confirmed by a live repro, not just static reading: 1. The 2. TOCTOU gap between 3. 4. The fixed six-file payload allowlist is hand-duplicated in two places inside this same file, and again against |
|
Addressed in commit 26f0aef: a single packaged payload manifest now feeds both project generation and standalone packaging. All required and optional payloads are staged through the same symlink checks and pre/post-copy digest verification; the unguarded README/VERSION recopy is gone, and destination containment uses filesystem identity. Vendor and launcher suites pass (45 tests), including forced leaf/parent symlink swaps and case-aliased containment. |
|
Follow-up: hosted ShellCheck found an unused local in the new race-test fixture. Removed in c093973; |
|
Confirmed fixed under active adversarial re-testing, not just reading the diff — this was the security-sensitive one so I pushed hard on it:
All four hold under adversarial testing. |
Summary
Replace recursive application-tree copying with a fixed runtime allowlist and explicit
--includesupport for files underassets/orconfig/. Reject symlink/special payload entries and destinations inside the application source tree, and document the distribution boundary.Issue
Fixes #510
Validation
bats tests/vendor.bats— passed (7 tests).bats --filter standalone tests/vendor.bats— passed (2 tests).shfmt -d -ln bash -i 4 -sr scripts/vendor, andgit diff --check— passed.Docs Impact
Documents the default allowlist, explicit optional assets, safe path rules, and external output-directory requirement.
Security Notes
Default packaging no longer traverses arbitrary application files; local markers, repository metadata, tests, and stale output are excluded.