GHSA-wc45-m6pv-rrf9: Send access limits not enforced on the new Send access endpoints
- Published:
- Fetched:
- Updated:
- Affects:
- dani-garcia vaultwarden
https://github.com/dani-garcia/vaultwarden/security/advisories/GHSA-wc45-m6pv-rrf9 ↗
Send access limits not enforced on the new Send access endpoints ### Summary > **Pre-release only.** The affected code was only on the development branch (and the `:testing` image) between commits `5c5e8e1a` (#7346) and `46ae59ea` (#7472). It was never part of a tagged release: 1.36.0 predates it and 1.37.0 shipped with the fix. The anonymous Send access endpoints introduced by the 2026.6.0 rewrite do not enforce a Send's access limits. Anyone holding a Send link can read a "one-time" (or `max_access_count=N`) Send many more times than allowed, and can keep reading it after the creator disables it or it expires. Meanwhile the creator's access counter under-reports the real number of reads. The `max_access_count`, `expiration_date`, `deletion_date`, and `disabled` guarantees of Send are effectively defeated. ### Details The rewrite split anonymous access into two steps: get a 2-minute `send_access` token (`POST /identity/connect/token`, `grant_type=send_access`), then read the Send with it (`POST /api/sends/access` for text, `POST /api/sends/access/file/` for files). All limit enforcement was moved into token **issuance**. `SendTokens::generate_tokens` (`src/auth/send.rs:82-117`) checks `max_access_count`/`expiration_date`/`deletion_date`/`disabled`/password and does `access_count += 1` **once** (`:116`). The access handlers `process_access` (`src/api/core/sends.rs:516`) and `process_access_file` (`:592`) then re-check **nothing** and **never** increment `access_count`: ```rust // src/api/core/sends.rs:592 (no checks, no increment) async fn process_access_file(send: Send, file_id: SendFileId, host: Host, conn: DbConn, nt: Notify<'_>) -> JsonResult { nt.send_send_update(...).await; Ok(Json(json!({ "url": download_url(&host, &send.uuid, &file_id).await? }))) } // The legacy handlers, retained in the same file (sends.rs:557-585), still check // expiration/deletion/disabled/password and do `send.access_count += 1` on every access. ``` The `send_access` JWT (`BasicJwtClaims`) has no `jti`/nonce, so it is a replayable bearer for its full 2-minute lifetime. Consequences: - `access_count` counts **tokens issued, not reads**, so a `max_access_count=N` Send yields N tokens, each granting unlimited reads in its window, and the creator's `accessCount` shows only N. - A Send **disabled or expired mid-window stays readable** through an already-issued token. ### PoC Create a **File Send** with **Maximum Access Count = 1** in your vault. Set `SEND_ID` (its UUID, from the share link), `FILE_ID` (from `GET /api/sends`), and `VW` (your server), then run: ```python import json, os, base64, uuid, urllib.request, urllib.error, urllib.parse BASE, SEND_ID, FILE_ID = os.environ["VW"], os.environ["SEND_ID"], os.environ["FILE_ID"] def http(method, path, hdr=None, form=None): body = urllib.parse.urlencode(form).encode() if form else None h = {"User-Agent": "vw1"} | (hdr or {}) if form: h["Content-Type"] = "application/x-www-form-urlencoded" try: r = urlli Affected packages: rust:vaultwarden Patched: vaultwarden 1.37.0