Skip to content

v2.0.0 — protocol v2 security release

Choose a tag to compare

@HMAKT99 HMAKT99 released this 26 Oct 02:36
· 16 commits to main since this release
c4c746f

⚠️ Breaking security release

Upgrade from 1.x as soon as possible. In 1.x, the PAM module trusted any "success" reply on a socket the user owned. Any process running as your user could get sudo without a password or your phone (#38).

In 2.0.0 the PAM module verifies your phone's signature itself. The daemon is no longer trusted to approve anything.

What changed

  • PAM verifies the phone's signature over a fresh challenge that binds the nonce, Mac identity, user, service, PID and expiry, using keys an administrator enrolled.
  • Privileged files moved to /Library/Security/TouchBridge, with checks on ownership, permissions, symlinks and ACLs. Old hooks are removed before modules are replaced.
  • Pairing pins the Mac identity through the QR code and authenticates the key exchange.
  • Unpair cancels pending approvals and removes signing capability. Auto-lock follows verified phone connections.
  • Simulator, web, Watch and Android modes can no longer approve sudo. The Authorization Plugin is disabled until it gets a v2 verifier.

Thanks to @zhixuli0406 for the work in #39.

Upgrade

The phone app and the Mac must both be on v2, and you must re-pair.

On Homebrew 7 or later, trust the tap once first. Otherwise brew refuses to load the cask with Refusing to load cask ... from untrusted tap:

brew trust HMAKT99/touchbridge
brew update && brew upgrade --cask touchbridge
  1. Rebuild and install the iPhone app from companion/.
  2. Pair again and compare the Mac and phone fingerprints on both screens.
  3. Enroll the phone as an administrator:
    sudo /Library/Security/TouchBridge/touchbridge-trust enroll <UID> <DEVICE_ID> <MAC_KEY> <PHONE_KEY>
  4. Activate the sudo hook:
    sudo bash /Library/Security/TouchBridge/patch-pam.sh

sudo keeps asking for your password until you enroll. Full steps are in docs/setup.md.

Known limitations

  • The touchbridged daemon is Apple Silicon only, as in 1.x.
  • On-device acceptance testing is still tracked in #38.

Full changelog: CHANGELOG.md