# Atomic Server: Unauthenticated `/setup` invite grants write access to the entire Drive

Atomic Server's unauthenticated /setup invite grants any caller write access to the entire Drive root, enabling full takeover of fresh deployments.

- Payout: Research
- Severity: critical
- Program: Atomic Server
- Found by: luuhung1217
- Disclosed: 2026-11-18
- CVE: CVE-2026-69157
- Write-up quality: 7/10
- Original: https://github.com/advisories/GHSA-pfwx-xjp4-qxcj
- Library page: https://bugbountylibrary.com/r/ghsa%3AGHSA-pfwx-xjp4-qxcj
- Tags: area:oss domain:oss domain:web impact:integrity impact:privesc kind:research platform:ghsa sev:critical tech:rust technique:source-review vuln:access-control vuln:auth-bypass vuln:race-condition

**Target:** HTTP endpoint /setup invite redemption on atomic-server
**Root cause:** The /setup invite is provisioned with write=true on the Drive root and usagesLeft=1, and invite redemption discards the redeemer's identity (for_agent: _), so mere possession of the URL grants write. No operator authentication or one-time secret is required.
**Steps:**
1. GET /setup with Accept: application/ad+json to confirm invite/write=true, invite/target=Drive root, usagesLeft=1.
2. Generate an ed25519 keypair and send `GET /setup?public-key=q2UkizMX0Go4mHwW2BXepqkzpP5FHlagEft8M32t0EM%3D` with Accept: application/ad+json.
3. Observe 200 with Redirect invite/redirectAgent pointing to the newly created agent URL.
4. GET / and confirm the attacker agent appears in the Drive root's write array.
5. Sign a JCS-canonical Commit with the attacker key and `POST /commit` to edit the Drive root (200).
**How found:** Code review of server/src/appstate.rs and server/src/plugins/invite.rs: noticed the /setup invite targets the Drive root with write=true and that construct_invite_redirect destructures `for_agent: _`, discarding redeemer identity; also spotted the inverted expiry check and non-atomic usagesLeft decrement.
**Exploitation:** Unauthenticated network attacker fetches /setup, extracts the invite, redeems it with their own public key, and is added to the Drive root write array. They then sign commits with their key and POST /commit to read/modify/delete any resource, create Agents, and reconfigure permissions — full takeover on a fresh deployment.
**Escalation:** With Drive write, attacker can read the server root private key and impersonate root (reported separately as a larger chain).
**Insight:** Look for bootstrap/setup invites that are auto-provisioned with broad rights and whose redemption path ignores the redeemer identity — a `for_agent: _` destructure is a strong tell that possession of the URL is the only auth. Also audit single-use counters for read-check-decrement TOCTOU and expiry comparisons for inverted operators.

## Proof of concept (copied exactly from the original report)

**Unauthenticated /setup invite redemption with attacker public key**

```
GET /setup?public-key=q2UkizMX0Go4mHwW2BXepqkzpP5FHlagEft8M32t0EM%3D HTTP/1.1
Host: localhost:9883
Accept: application/ad+json
```

