Repository navigation
security: verify JoininBox updates before install - #190
Conversation
c1845ff to
3ffeef1
Compare
RonDeBanc
left a comment
There was a problem hiding this comment.
Review: verification hardening vs. loss of PR-testing function
The signature-verification hardening is solid and should merge, but the PR takes the bluntest option on PR testing: it deletes the capability instead of re-routing it, and leaves a dead menu item behind.
What the PR does
| Change | Assessment |
|---|---|
updateJoininBox pr → hard refusal |
🔴 Full removal of in-place PR testing |
Release-tag/default-branch updates gated on verify.git.sh |
✅ Good — fail-closed before copyJoininboxScripts |
verify.git.sh uses --raw + full-fingerprint VALIDSIG match |
✅ Correct fix; short key IDs were spoofable |
Full web-flow fingerprint pinned in build_joininbox.sh |
✅ Correct |
On the lost PR-testing function
Why the removal is defensible: anyone on GitHub can open a PR, and the old flow fetched pull/N/head and copied it into /home/joinmarket, where scripts run with sudo. That's an unauthenticated remote-code-to-root path. Failing closed is the right default.
Why the loss is (partly) unnecessary:
- The menu entry is left dangling.
scripts/menu.update.advanced.shstill offersJBPR "Test a JoininBox pull request"— it prompts the user, asks for confirmation, then always errors out. The PR should remove or repoint that menu item; shipping a guaranteed-failure path is a UX bug. - Safer alternatives exist that preserve testing:
- Check out the PR into a separate non-privileged directory and run from there — never
copyJoininboxScripts, no sudo. That keeps contributor-PR testing possible without the privilege escalation. - Or allow PR install only if the PR head is signed by a trusted key (openoms / web-flow). This restores testing for maintainer-authored PRs but not contributor ones, so it's only a partial fix.
- "Test in an isolated image" is fine advice, but the PR doesn't provide or document that path — it just closes the door.
- Check out the PR into a separate non-privileged directory and run from there — never
- Scope note: JoinMarket PR testing (
JMPR→install.joinmarket.sh -i testPR) is untouched, so only JoininBox's own PR testing is lost.
Minor technical nits (non-blocking)
verifyJoininBoxRefdetects the signer by grepping human-readablegit log --show-signatureoutput — and a commit message could contain the fingerprint string. It's fail-closed (the real auth happens inverify.git.sh'sVALIDSIGcheck), so it's not exploitable, but a%GG/%GK-based check would be cleaner.- For
web-flowdetection it greps the 16-char long key ID rather than the full fingerprint — again safe because enforcement is downstream, but inconsistent with the PR's own "short IDs are not authentication boundaries" message.
Verdict
Directionally reasonable but over-broad on the PR-testing removal: at minimum remove the dead JBPR menu entry, and ideally offer a sandboxed PR-checkout path so testing contributor PRs on real hardware isn't lost for good.
Reviewed by Ron DeBanc (Hermes Agent)
|
Addressed in dddd02c. PR testing is restored — instead of the hard refusal, But it is now gated behind explicit, typed consent:
Signature verification via This keeps the fail-closed default for all silent/automated update paths while letting advanced users test contributor PRs on real hardware when they consciously accept the risk. |
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 (openoms#10) - new: root wildcard deletion in /dev/shm in menu.quickstart.sh (openoms#11) - minor: deprecated apt-key, builder-key import hygiene Map findings to implementation PRs openoms#187-openoms#190 with per-finding status. Add SECURITY.md with private vulnerability reporting, scope, supported-version policy, and coordinated disclosure.
RonDeBanc
left a comment
There was a problem hiding this comment.
Re-review after update (dddd02c1d) — APPROVE
The new commit "feat: restore PR testing behind explicit consent warning" directly addresses both blocking points from my previous review. The loss-of-function concern is resolved.
What changed vs. the previously reviewed version
| Previous concern | Resolution |
|---|---|
🔴 updateJoininBox pr hard-refused — PR testing gone |
✅ Restored, with a stderr warning banner naming the exact PR URL |
🔴 Dead JBPR menu entry (always errored) |
✅ Menu now shows a full security warning and requires typed confirmation: test PR <N> — not a casual Y/N |
| No documented alternative |
Assessment of the new consent flow
- Menu level: the warning spells out all three risk facts (anyone can open a PR, unsigned code, elevated privileges) and requires typing the exact phrase including the PR number — a real informed-consent gate, not a click-through.
- Function level:
updateJoininBox prprints its own warning banner to stderr, so direct CLI callers aren't silent either. Added|| return 1on the fetch/checkout improves error handling. - Verification logic untouched for the trusted paths: tags and default-branch commits still fail closed through
verify.git.shwith full-fingerprintVALIDSIG. The PR path explicitly skips verification with a printed notice — honest about what it is. - Bonus fix: the old code echoed a wrong URL (joinmarket-clientserver release page); the new warning points to the correct joininbox PR URL.
Residual notes (non-blocking)
- The consent gate lives in the menu only — calling
updateJoininBox pr Ndirectly from a shell just warns and proceeds. Acceptable (shell access implies an operator), but adding the same typed check in the function would make it airtight. - The
PRnumberrefspec is always prefixed withpull/, so no git option-injection vector there. String comparisons are properly quoted. ✅ - Earlier nits stand but remain fail-closed and cosmetic: signer detection greps human
git log --show-signatureoutput, and web-flow detection uses the 16-char long ID while enforcement uses the full fingerprint downstream.
Verdict
The update keeps the fail-closed verification hardening where it matters (release tags, default branch) and restores PR testing behind genuine informed consent. The balance between security and testability is now right. LGTM.
Reviewed by Ron DeBanc (Hermes Agent)
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 (openoms#10) - new: root wildcard deletion in /dev/shm in menu.quickstart.sh (openoms#11) - minor: deprecated apt-key, builder-key import hygiene Map findings to implementation PRs openoms#187-openoms#190 with per-finding status. Add SECURITY.md with private vulnerability reporting, scope, supported-version policy, and coordinated disclosure.
dddd02c to
6ebb3e6
Compare
RonDeBanc
left a comment
There was a problem hiding this comment.
Re-review of c27c2781d — APPROVE
The new VALIDSIG matching correctly handles signatures made by a signing subkey. GnuPG's machine-readable record places the actual signing-key fingerprint first and the bound primary-key fingerprint in the final field. Accepting the pinned full fingerprint in either exact position preserves the intended trust boundary while allowing legitimate subkey-signed tags.
Security properties retained:
- the status line is anchored at
^[GNUPG:] VALIDSIG; - the pinned value is still a full fingerprint, not a short key ID;
- the primary-fingerprint alternative is anchored to the final field;
- GnuPG emits
VALIDSIGonly after signature and subkey-binding validation; goodSignaturemust also be true.
All current checks pass, including amd64 and arm64 image builds.
Non-blocking documentation note: the PR description still says PR installation is refused, but the current code restores it behind explicit typed consent. Updating the description would make the final behavior easier to audit.
Reviewed by Ron DeBanc (Hermes Agent)
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 (openoms#10) - new: root wildcard deletion in /dev/shm in menu.quickstart.sh (openoms#11) - minor: deprecated apt-key, builder-key import hygiene Map findings to implementation PRs openoms#187-openoms#190 with per-finding status. Add SECURITY.md with private vulnerability reporting, scope, supported-version policy, and coordinated disclosure.
Address review: instead of hard-refusing PR installs, keep the JBPR
menu functional but gate it behind a typed confirmation
('test PR <number>') with a prominent security warning about
unverified, unsigned code running with elevated privileges.
Signature verification remains enforced for tag and commit updates.
AdamISZ signs JoinMarket tags (e.g. v0.9.12) with a signing subkey, so GnuPG's VALIDSIG record starts with the subkey fingerprint and carries the pinned primary fingerprint as its last field. The strict prefix match rejected valid signatures and failed the amd64 image build. Match the pinned fingerprint either as the signing key or as the primary key (last field). GnuPG only emits VALIDSIG after validating the signature and subkey binding, so both positions authenticate the pinned key.
c27c278 to
f9aa278
Compare
RonDeBanc
left a comment
There was a problem hiding this comment.
Fresh re-review — APPROVE
Re-checked current head 8e9f1ed7f, including the new verified-update Bats coverage. The head is unchanged from the Kimi K3 integration review and merges conflict-free with #191–#194 and #198.
Verified on the combined tree:
- full relevant Bats coverage is green (apart from two pre-existing sudo-dependent suites skipped outside CI);
- #198's repository-wide contracts remain green;
- real GPG commit/tag verification accepts the pinned key and rejects a wrong fingerprint;
- an unsigned commit containing a forged trusted fingerprint in its subject still fails closed;
- no cross-PR regression was found in the update-verification path.
Code verdict: approve. ShellCheck, Bats, spelling and arm64 image build pass. The amd64 image build is still pending and remains the final process gate.
Non-blocking: validate PRnumber as numeric before constructing the unquoted fetch refspec, and update the stale PR description which still says PR testing is refused despite the current explicit-consent flow.
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)
|
Addressed the fresh review notes in
The focused 12-test verified-update suite passes locally; CI has been retriggered. |
RonDeBanc
left a comment
There was a problem hiding this comment.
Fresh re-review — APPROVE
Verified current head 1a0e325cc.
validatePRNumber() closes the previously noted refspec argument-injection issue. Adversarial coverage included empty, signed, whitespace-padded, option-like (--upload-pack=...), slash, newline, shell-metacharacter, leading-zero and very large inputs.
The important ordering is correct: invalid PR input is rejected at the top of updateJoininBox() before changing directory, removing the existing checkout, cloning, or constructing a fetch refspec. A mocked end-to-end run confirmed malicious inputs never invoked git or rm; valid 190 produced exactly:
git fetch origin pull/190/head:pr190
Validation in both the JBPR menu and updateJoininBox() is consistent defense in depth. Decimal-only input is sufficient for this sink: it cannot become an option, split into extra arguments, traverse paths, or inject refspec syntax. Nonexistent numeric PRs fail through the existing checked fetch path.
Tests and verification:
verified-updates.bats+verify.git.bats: 12/12 passed in the Kimi K3 pass- local
verified-updates.bats: 7/7 passed in the verification pass - ShellCheck and
bash -n: clean for the changed code - all current GitHub checks pass, including amd64 and arm64 image builds
Non-blocking follow-up: the sibling JMPR path still interpolates an unvalidated PR number into a JoinMarket fetch refspec. It is outside this PR’s JoininBox scope, but should receive equivalent validation.
Primary review model: Kimi K3 (kimi-k3, Kimi Coding provider)
Verification and GitHub-state model: 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
web-flowVALIDSIGrecord and support bound signing subkeysThis implements the update-authenticity recommendations from #186.
Security impact
The existing updater fetched a moving branch and copied it into
/home/joinmarketwithout calling the repository's signature verifier. Because installed scripts can invoke privileged operations, repository or account compromise could become root compromise on updating nodes. Signed release/default-branch paths now authenticate the selected immutable tag or commit beforecopyJoininboxScriptsruns.Short key IDs are not authentication boundaries.
verify.git.shcapturesgit verify-* --rawoutput and requires an exact full-fingerprintVALIDSIGrecord. It accepts the pinned fingerprint either as the signing key or as the final bound primary-key field, allowing legitimate signing subkeys without weakening the trust boundary.PR-testing compatibility
Advanced PR testing remains available for hardware testing, but the menu clearly states that PR code is unverified and runs with elevated privileges. The operator must type
test PR <number>exactly. Direct callers also receive a warning banner. PR numbers are restricted to decimal digits before any destructive checkout step or fetch refspec construction. Testing untrusted PRs in an isolated image is recommended.Tests
tests/verify.git.bats: commit/tag success, bound subkey, wrong key, failed signature, wrong downloaded keytests/verified-updates.bats: trusted signer selection, unknown signer rejection, typed PR consent, decimal PR validation, full GitHub fingerprint pinbash -n/ ShellCheck / spelling