The cryptography was the part that held

This is a self-assessment. Every finding below comes from the project’s own reviews and tests. No outside party has audited vault-share.

vault-share is an end-to-end encrypted file sharing service. The browser encrypts a file before upload, and the key travels only in the part of the link after the #, which browsers never send. In a project like this, the cryptography is the obvious place to look for security bugs. The findings log holds 70 entries, and none of the five rated High involves a cipher, a key derivation or a nonce. Four are about the lifecycle of an upload: what happens when it races a delete, a retry, a timeout or another upload. The fifth came from cleanup when the database and the storage disagreed. A second group of findings had a common shape, a limit that was checked before an attempt and counted after it, which concurrent requests could slip past.

How the findings were found

The log records the source of each finding. Most came from reviews of milestones M2 to M7 or from an adversarial re-check of the fixes for earlier findings. Others came from a pass against the OWASP Top 10:2025 using black-box and browser test scripts, a production readiness review and a code review, two from a simplification review, one from a second implementation of the share format, one from an end-to-end test, and one came up while fixing another finding. Fixes such as those for F26, F38 and F39 record tests or measurements from before and after.

Four High findings in the upload path

  • F1, orphaned ciphertext. The upload handler published the blob before marking the record. If the record had been deleted or purged in between, the blob stayed on disk with nothing pointing to it, outside every cleanup rule. Each repetition could leak up to the file size limit.
  • F2, concurrent uploads replaced acknowledged content. A second PUT with the same owner token overwrote the stored blob, and a bad body on a late PUT deleted the blob of an earlier successful one.
  • F3, long uploads stored but not acknowledged. Only the read deadline was extended for large bodies. The server’s 60-second write timeout cut the connection before the reply reached the client, which then retried and ran straight into F2.
  • F26, concurrent uploads to one file. Nothing stopped an owner from running many uploads to one record at once. The S3 store buffered each in memory, and 40 uploads to one record took the server from 18 to 341 MiB. On disk, six uploads to one 64 MiB record held 360 MiB, beyond a quota that counted records only. After the fix a file takes one upload at a time, so six uploads to one record left one temp file and five 409 replies. The S3 store now streams each body instead of buffering it, and ten uploads to ten records moved the server from 19 to 20 MiB; streaming caps files on S3 at 5 GiB.

F2 and F3 are connected: the timeout in F3 caused retries, and through F2 those retries could replace or delete data the server had already acknowledged.

The fifth High finding

F47 came from a later production readiness review. It involves no cryptography either, and it has nothing to do with uploads. vaultd created its database when the file was missing, and the cleanup at startup then deleted every stored object that had no record, as an orphan. A lost or replaced data volume, a restore that left the database out, or a second instance pointed at the same bucket therefore emptied the storage within seconds: 300 blobs on disk and 30 objects in an S3 bucket in the reproduction. No request can trigger it, but the loss is every shared file. vaultd now refuses to start when the database is new and the storage already holds content, runs its first cleanup an hour after the start, and deletes at most 100 objects in one run (D032). An existing database pointed at another instance’s storage still loses that content, 100 objects an hour, so the bucket must belong to vaultd alone.

Limits that were checked before they were counted

Two later findings, F38 and F39, came from rate limits and lockouts that each looked correct when read on their own.

The second sign-in step read its ticket, checked the code, and only then counted a failure. The account’s lockout was asked before the check and told after it. Codes sent at the same moment all passed both gates before any failure was recorded, which gave an attacker who already knew the password many more guesses at the second factor. In a test, 40 wrong codes on one ticket had 7 to 20 of them checked, where the ticket allows 5. For sign-ins, 50 wrong sign-ins sent at once from 50 addresses were all checked where the account allows 20, and 20 bad download signatures at once had 11 to 14 checked where 5 should lock the client out of the file.

The fix reverses the order. A lockout now admits an attempt before it is checked, and refuses one while the failures already counted plus the attempts in flight could reach the limit. A ticket gives up an attempt in the same statement that reads its count. The tests send the attempts at once and failed before the fix. Afterwards at most 5 codes are checked, whether they arrive on one ticket or over eight, and exactly 20 sign-ins from many addresses, 5 from one client and 5 signatures.

This is counting code with no cryptography in it, and it sets how many guesses an attacker gets against a six-digit code.

Why the cryptography held up

The cryptographic design deliberately avoided anything new. D002 restricts the project to the browser’s Web Crypto API and mature libraries, on the grounds that hand-written primitives are error-prone. D012 adopts an existing format as well: files are encrypted in the record format of RFC 8188, the aes128gcm content encoding, which Firefox Send also used. Keeping that layout lets the RFC’s section 3.1 test vector run against this implementation unchanged, with the RFC’s 128-bit key; files themselves use a 256-bit key. The section 3.2 vector carries a key id, which vault-share rejects, so it runs only with the key id removed. Where vault-share differs from Firefox Send, it is stricter. Among other differences, it rejects unexpected header values, which Firefox Send ignores, and an empty file still produces a final record, so a stream cut after its header fails to decrypt instead of producing an empty file.

The only finding filed under Cryptographic Failures (A04:2025), F20, was a mismatch between the documents and the code. The specification said the server stores only a verifier of the download authentication key. It actually stores the key itself, as Firefox Send does, so a copy of the database could sign download challenges and spend download counts. It still could not decrypt anything, since that needs the secret in the link. The documents were corrected. An asymmetric verifier would close the gap, at the cost of a protocol change.

Limits

  • Self-assessed. The findings come from the project’s own milestone reviews, adversarial re-checks of fixes, a test pass against the OWASP Top 10:2025, a production readiness review and a code review. No external audit has been done, and an outside reviewer may well find problems of a different kind, cryptographic ones included.
  • Severity is the project’s own. Each rating follows the impact on the project’s own threat model. A different model would rank some of them differently.
  • No cryptographic weakness found. One finding, F70 (Low), was at a key derivation’s input: a share password typed in another Unicode form did not open its link. That none was found does not show that none exists. The RFC test vectors show the record format is implemented as specified; they say nothing about side channels or about how the keys are used beyond the file format.
  • Scanner results say little here. gosec, govulncheck, npm audit and Semgrep report 0 issues on the source at commit a277b92; govulncheck on the Caddy binary reports 4 advisories, accepted as F22. Nothing here shows whether the scanners would have caught the findings above.
  • Known gaps remain. A compromised server can serve JavaScript that steals keys, as with most web-based encryption tools, and the server sees each file’s size and access times.

When this does not hold

The pattern depends on two choices made at the start: standard primitives, and an existing, reviewed format with test vectors. A project that designs its own record format, manages nonces by hand, or composes primitives into a new protocol moves the risk back into the cryptography, and review effort should follow it there.

It also depends on the kind of server. vault-share’s server never sees plaintext, so most of its work is storage bookkeeping, under concurrency or when the database and the storage disagree, and that is where its High findings were. A service whose core logic is cryptographic, such as a key server or a signing service, will have a different distribution.

For a project shaped like this one, I would spend most review time on the upload state machine, the retry paths, any cleanup that deletes what the database does not list, and any limit that is checked in one place and counted in another. A borrowed, reviewed format keeps the cipher code small and testable, which makes those parts the most likely to be wrong.