Conversation
Closes projectbluefin#1170. install-opentabletdriver fetched its release tarball through `curl -s` (no -f, no verification) and piped it straight into a root `sudo cp` of udev rules, then installed a user systemd unit from a moving flathub branch ref — also via `curl -s`, so an HTTP error page would have been written verbatim into $HOME/.config/systemd/user and enabled. A compromised upstream release asset or flathub packaging repo meant root-installed udev rules (RUN+= code execution) and session-level code execution. - Pin the release to v0.6.7 and verify the tarball with sha256sum before extraction; all fetches now use `curl -fsSL`. - Pin the flathub opentabletdriver.service fetch to commit 1a2a2083b8ed831df3b8b6ae3ddfe7dc21d02e01 and sha256-verify the unit before enabling it. - Make the install branch fail fast (`set -euo pipefail`) so a failed download or checksum mismatch aborts before anything is copied as root or enabled; gum's confirm/uninstall/Ctrl-C semantics are kept. - The tarball now downloads to a file and verifies before extraction, which also removes the old regex's ambiguity (it matched both the linux-x64 binary and simple tarballs and streamed both into one tar). - Add a Renovate custom regex manager so the pinned OTD_RELEASE tag stays current; the two sha256 pins are documented as manual updates in the same PR (checksum gate fails closed until then). Tests: extend tests/test_apps_just.bats — pinned-URL, sha256-gate, tampered-payload (fails closed before udev/flatpak/unit), HTTP-error (fail-closed), unit-fetched-from-pinned-commit, and sha256-before- enable ordering assertions; curl mock honours -f/-o; uninstall branch assertions unchanged. Pins are mirrored as constants in the test file and must move with the recipe. Verified the recipe end-to-end against the real upstream assets (tarball and unit both verify OK) and docs/skills and TESTING.md are updated in the same PR per AGENTS.md. Hive-Run: projectbluefin#1170 Hive-Plan: issue#1170/recommendation Hive-Spec: sec-check#1170 Assisted-by: openrouter/z-ai/glm-5.3-flash via Hive Signed-off-by: mendezr <mendezr@users.noreply.github.com>
castrojo
left a comment
There was a problem hiding this comment.
LGTM. Excellent supply-chain fix pinning and verifying OpenTabletDriver release and service checksums, paired with Renovate regex tracking and comprehensive BATS tests.
There was a problem hiding this comment.
Reviewed at a0d64d7. ujust install-opentabletdriver now downloads a pinned OpenTabletDriver release and a pinned systemd unit, checks both with sha256, and stops on any failed download.
What I checked:
- Read the full diff (recipe, Renovate rule, tests, docs).
- The pins match upstream. The v0.6.7
opentabletdriver-0.6.7_linux-x64_simple.tar.gzasset hashes toab3ecfed…2265, and GitHub's own asset digest agrees. The unit at flathub commit1a2a208hashes toef2f5c45…260a, and its bytes are identical to that repo's current HEAD. v0.6.7 is the latest release. - Inside the tarball the rule is at
opentabletdriver-Simple/70-opentabletdriver.rules, so after--strip-components=1it is at the path the recipe copies from. - Locally:
bats tests/test_apps_just.batspasses 25/25. The Renovate regex matchesv0.6.7inapps.just, andrenovate-config-validatoraccepts.github/renovate.json5. - Mutation: deleting the tarball
sha256sum -cline makes the tampered-tarball test fail. - CI at this head: Build, Unit Tests (which runs
test_apps_just.bats) and Validate PR succeeded. The job that runs the PR E2E suite was skipped.
|
(Optional follow-up to my approval. Not blocking.)
|
There was a problem hiding this comment.
Looks correct to me — I independently verified the pins against upstream.
- Fetched
https://github.com/OpenTabletDriver/OpenTabletDriver/releases/download/v0.6.7/opentabletdriver-0.6.7_linux-x64_simple.tar.gz: sha256 isab3ecfed…d2265, matchingOTD_TARBALL_SHA256atapps.just:41.v0.6.7is also the currentreleases/latest, so the pin loses nothing today. - The tarball's only top-level dir is
opentabletdriver-Simple/, containing70-opentabletdriver.rulesat its root — so after--strip-components=1the new path${OTD_TMPDIR}/70-opentabletdriver.rules(apps.just:50) is right, and the oldetc/udev/rules.d/…path onmaindid not exist in this package at all. - Fetched the flathub unit at commit
1a2a2083…: sha256 isef2f5c45…1260a, matchingOTD_SERVICE_SHA256atapps.just:61. set -euo pipefail+curl -f+sha256sum -c -means a bad payload aborts before thesudo cp,flatpak installandsystemctl enableatapps.just:50,55,64— fail-closed as described.
One low-severity note, not a blocker: on a checksum or fetch failure set -e exits before rm -rf "${OTD_TMPDIR}" (apps.just:52), so the mktemp dir and the rejected tarball are left in /tmp. Harmless, but a trap 'rm -rf "${OTD_TMPDIR}"' EXIT right after the mktemp -d would tidy it.
Confidence: 5/5 (safe)
— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
bluefin-common PR
What does this change?
ujust install-opentabletdrivernow pins its upstream release tag and sha256-verifies the tarball withsha256sum -c -before extracting anything (including the root-installed udev rule), fetches the flathubopentabletdriver.serviceunit from a pinned commit (also sha256-verified) instead of the movingrefs/heads/masterbranch, and runs the install branch withset -euo pipefailso any failed fetch aborts before anything is copied as root or enabled. A Renovate custom regex manager keeps the pinned tag current.Why?
Closes #1170. The recipe previously streamed an unverified "latest" release tarball through
curl -sinto a rootsudo cpof udev rules, and installed an auto-enabled user service unit from a moving branch ref — both fetched withcurl -s(no-f), so an HTTP error page would have been written verbatim into system/user files. A compromised upstream asset or flathub packaging repo meant root-installed udev rules (RUN+=code execution) and session-level code execution.Behavior note: the recipe now installs the pinned
v0.6.7release rather than always tracking latest. Updates arrive via Renovate PRs (tag only) — the two sha256 pins are not Renovate-managed and must be bumped manually in the same PR as documented indocs/skills/ci-tooling/references/renovate-and-tools.md; the checksum gate fails closed until they are.Also verified the rewritten recipe end-to-end against the real upstream assets (tarball and unit both verify
: OK, exit 0).Test coverage
tests/test_apps_just.batsextends the existinginstall-opentabletdriversuite (#1064) with:api.github.comlatest lookup, norefs/heads/fetch)systemctl enablecurlHTTP-error run: fails closed before anything is installed (proves the-fflag is load-bearing)-f/-o; uninstall-branch andcncfassertions unchangedPR pipeline
Checklist
fix:,feat:,docs:,ci:,refactor:, etc.)just checkpassespre-commitunavailable in this environment; ran end-of-file/trailing-whitespace/doc-links/skill-index/frontmatter/skill-catalog checks individually — all green)docs/skills/skill-improvement.md) —docs/skills/ci-tooling/references/renovate-and-tools.md+docs/TESTING.mdAGENTS.md/docs/SKILL.md/docs/skills/links remain validgh run list --repo projectbluefin/common --limit 5(checked post-push)AI attribution
AI-authored commit carries an
Assisted-by:trailer (model noted honestly; the Copilot co-author pair from the template would be a false attribution for this run).— hive: backend=pi model=openrouter/z-ai/glm-5.3-flash
🐝 Hive Agent:
contributor| SHA:a0d64d7