Repository navigation
security: remove root wildcard deletion in /dev/shm - #191
Conversation
… statuses New implementation PRs: - openoms#191 finding openoms#11 (root wildcard rm in /dev/shm) - openoms#192 finding openoms#8 (passwords via argv) - openoms#193 finding openoms#5 (shared default password) - openoms#194 finding openoms#10 (eval-based arg parsing) - openoms#195 finding openoms#2 (sourcing joinin.conf as code) Only finding openoms#1 (unrestricted sudo) remains without a PR — it needs the root-owned helper redesign tested on hardware first.
RonDeBanc
left a comment
There was a problem hiding this comment.
Review: APPROVE
Small, correct, and exactly matches finding #11's acceptance criteria: the script now unlinks precisely the three mktemp files it created ($walletData, $wallet, and $mixdepth when set) and the root wildcard delete in the world-writable /dev/shm is gone. Dropping sudo is right too — the files are owned by the calling user.
Nits (non-blocking, pre-existing): shred $wallet $mixdepth $walletData a few lines up is unquoted, and shred -u could fold the overwrite+unlink into one step. Fine as-is.
Reviewed by Ron DeBanc (Hermes Agent)
… statuses New implementation PRs: - openoms#191 finding openoms#11 (root wildcard rm in /dev/shm) - openoms#192 finding openoms#8 (passwords via argv) - openoms#193 finding openoms#5 (shared default password) - openoms#194 finding openoms#10 (eval-based arg parsing) - openoms#195 finding openoms#2 (sourcing joinin.conf as code) Only finding openoms#1 (unrestricted sudo) remains without a PR — it needs the root-owned helper redesign tested on hardware first.
7d2e64e to
f48196d
Compare
… statuses New implementation PRs: - openoms#191 finding openoms#11 (root wildcard rm in /dev/shm) - openoms#192 finding openoms#8 (passwords via argv) - openoms#193 finding openoms#5 (shared default password) - openoms#194 finding openoms#10 (eval-based arg parsing) - openoms#195 finding openoms#2 (sourcing joinin.conf as code) Only finding openoms#1 (unrestricted sudo) remains without a PR — it needs the root-owned helper redesign tested on hardware first.
f48196d to
d3a8329
Compare
RonDeBanc
left a comment
There was a problem hiding this comment.
Fresh re-review — APPROVE
Re-checked current head a81787412, including the scoped-cleanup Bats tests, on a combined master + #190–#194 + #198 integration tree. The merge is conflict-free and the complete relevant test suite remains green.
The change still satisfies the security contract: quickstart cleanup removes only the exact temporary files created by the flow and no longer performs a root wildcard deletion in shared /dev/shm.
All current GitHub checks pass: ShellCheck, Bats, spelling, amd64 image build and arm64 image build. LGTM.
Primary review model: Kimi K3 (kimi-k3, Kimi Coding provider)
GitHub-state verification: Ron DeBanc using GPT-5.6 Sol (gpt-5.6-sol, OpenAI Codex provider)
* docs: add security hardening plan * docs: re-scan findings, link implementation PRs, add SECURITY.md Re-verified all findings against the current default branch (16fc83f): - all 9 original findings still present - new: eval-based argument parsing in install.joinmarket.sh (#10) - new: root wildcard deletion in /dev/shm in menu.quickstart.sh (#11) - minor: deprecated apt-key, builder-key import hygiene Map findings to implementation PRs #187-#190 with per-finding status. Add SECURITY.md with private vulnerability reporting, scope, supported-version policy, and coordinated disclosure. * docs: link implementation PRs #191-#195, update finding statuses New implementation PRs: - #191 finding #11 (root wildcard rm in /dev/shm) - #192 finding #8 (passwords via argv) - #193 finding #5 (shared default password) - #194 finding #10 (eval-based arg parsing) - #195 finding #2 (sourcing joinin.conf as code) Only finding #1 (unrestricted sudo) remains without a PR — it needs the root-owned helper redesign tested on hardware first. * docs: fold hardening principles into SECURITY.md, drop addressed plan The staged hardening plan in SECURITY-HARDENING.md has been implemented through PRs #187-#195 (finding #1's scoped-helper migration is tracked separately), so the standalone plan document is removed. SECURITY.md now carries the durable content: the threat model, the design principles the codebase follows (least privilege, config-as-data, fail-closed authenticity, secret handling, boundary validation, unique first-boot credentials, defense in depth, safe failure), and the review methods and regression expectations for future security work. * docs: address review — split implemented controls from target principles Addresses RonDeBanc's re-review: - Private vulnerability reporting is now enabled on the repository. - Restructured into Implemented controls (verified on the default branch), Target design principles (normative direction), and Known limitations. Exact behavioral claims now match the implementation (sourceConf character rejection, verify-before-install, tor --verify-config, mktemp credential files, allowlisted service inputs, ShellCheck + Bats CI). - Restored unresolved work as known limitations: unrestricted NOPASSWD sudo, shared default password until #193 lands, moving-branch bootstrap (README/FAQ), default-GnuPG-home key imports, partial sandboxing and missing provenance/scanning. - Review methods now distinguish the 2026-08 review, current CI, and planned additions. --------- Co-authored-by: autoblitzbot <autoblitzbot@users.noreply.github.com>
Summary
Fixes security finding #11 from the hardening plan (SECURITY-HARDENING.md, see PR #186).
scripts/menu.quickstart.shransudo rm -f /dev/shm/*as root after displaying wallet data./dev/shmis a world-writable shared tmpfs, so a root wildcard deletion there can:/dev/shm(e.g./dev/shm/.pwwritten by_functions.shduring password entry, temp files of concurrently running menus, or unrelated processes)mktempas the callingjoinmarketuser, so nosudois needed to remove themWhat changed
scripts/menu.quickstart.sh(cacheAndShowQR):sudo rm -f /dev/shm/*shredcall (kept as-is; noteshreddoes not delete files by default and overwriting is unreliable on tmpfs anyway), the script now deletes only the exact temp files it created/used with plainrm -f:$walletData(its ownmktemp -p /dev/shm/file)$wallet(themktemp -p /dev/shm/file fromchooseWallet, previously only cleaned by the root glob or the EXIT trap)$mixdepth(guarded with[ -n ... ]since it is unset in this flow)sudo— all removed files are owned by the calling userTest plan
bash -n scripts/menu.quickstart.sh→ OK (syntax clean)rm -fcalls and introduces no new unquoted expansions (the pre-existingshred $wallet $mixdepth $walletDataline is untouched)mktempfiles simulating$wallet/$walletData→ deletedother_process_filein the same directory → survives (previously it would have been removed by the root glob)Follow-ups (not changed in this PR)
Other root wildcard deletions exist elsewhere in the repo. They are in root-owned (not world-writable) directories so they are lower risk than
/dev/shm, but still worth tightening in separate PRs:scripts/standalone/prepare.release.sh:17—sudo rm /etc/ssh/ssh_host_*ci/amd64/debian/scripts/joininbox.sh:10—sudo rm /etc/ssh/ssh_host_*scripts/jam-remote/install.jam.sh:169-170—sudo rm -f /etc/nginx/sites-{enabled,available}/jam*