Dromas server v0.6.11current client v0.6.12

Security

Dromas is designed so that nobody has to trust its server. Everything that protects a message runs in a client, in this repository, and tests that act as a forging server check most of these protections. The table in Checking the claims yourself says where no test does. This page explains how to check that for yourself, and how to report a case where it fails.

Supported versions

Dromas is pre-v1. Only the latest release and the latest commit on main are supported. A fix is a commit on main, released as the next patch. The protocol can still change until v1. The open issues in this repository and in dromas-server are the work planned before it.

Reporting a vulnerability

Report vulnerabilities privately, using GitHub's private vulnerability reporting. On this repository's Security tab, click Report a vulnerability, or run the following command from a terminal:

gh api repos/dromas-dev/dromas-client/security-advisories/reports \
  -f summary='…' -f description='…'

The following aren't vulnerabilities, but you're welcome to propose a better design in an issue:

What happens next. Reports go to the maintainer. The fix lands in this repository together with the published advisory, which credits the reporter unless the reporter asks otherwise. Answers to reports are best effort, and a fix ships as the next patch.

Checking the claims yourself

Each row of the following table gives a claim in one sentence, the section of PROTOCOL.md that states the whole rule, and, in the Held by column, the code that enforces the claim and then the tests that try to break it, grouped by file. If no test covers a claim, or part of a claim, the row says so. For a claim that isn't part of the protocol, the doc comments of the code that enforces it give the whole rule. For what the claims leave open, see Decided questions. The claims use the terms of PROTOCOL.md §2.3, such as working key, statement, and drain, and an emptying drain is a drain that leaves the mailbox empty.

Claim PROTOCOL.md Held by
Standard cryptography: encryption uses age with ML-KEM-768 and X25519, signatures use Ed25519 or ECDSA P-256, as plain keys or security keys, in SSHSIG format, SHA-384 names each mailbox, and stock tools check the crypto vectors §3.1, §16 protocol/, sshsig/, testdata/vectors/; protocol/stocktools_test.go: TestVectorsByToolsNotOurs (age, ssh-keygen, and openssl; the security-key vectors only where ssh-keygen reads those types); protocol/vectors_test.go: TestVectorMessage, TestVectorSignatures, TestVectorEnvelopes, TestVectorCertificates (a P-256 working key's certificate, its signature with either s); protocol/pass_test.go: TestAP256WorkingKeysPassIsOnePassWithEitherS; sshsig/sshsig_test.go: TestSSHKeygen; protocol/certificate_test.go: TestCertificateAgainstSSHKeygen; sh/sh_test.go: TestWithGoClient (the stock-tools script and a Go mailbox), TestVectorsMessage
Self-certifying addresses: an address is d_ and the base64url SHA-384 hash of its identity document, so a sender that has the correct address doesn't trust any server for the mailbox's keys §4, §15.1 protocol/identity.go; protocol/protocol_test.go: TestParseAddress; protocol/stocktools_test.go: TestVectorsByToolsNotOurs (openssl's SHA-384 of each document); client/forgery_test.go: TestForgeries (an identity that does not hash to the address); sh/messages_test.go: TestScriptChecksTheMailboxItIsServed
Confidentiality: only the recipient can decrypt a message, because the sender's machine encrypts it to the recipient's prekey, and the server never has the plaintext or a private key §9.4, §15 protocol/signed.go, client/send.go, sh/dromas.sh (dr_seal); protocol/vectors_test.go: TestVectorMessage (the sealed layout); client/revokedcerts_test.go: TestASendNamesItsStatement (the body is an age file); sh/messages_test.go: TestScriptSendsAndReads (the script posts no envelope)
Post-quantum confidentiality: a message stays confidential against a quantum computer built later, because every prekey uses ML-KEM-768 with X25519, while signatures remain Ed25519 or P-256 §9.4, §15.10 protocol/prekey.go, testdata/vectors/message/; protocol/vectors_test.go: TestVectorMessage (one mlkem768x25519 stanza), TestAPrekeyOfATypeThisClientLacks; protocol/stocktools_test.go: TestVectorsByToolsNotOurs (stock age decrypts with the hybrid key)
No substituted prekey: a sender encrypts only to a prekey signed by the recipient's identity, or by a working key that the identity certified, so a server can't substitute a prekey of its own §6, §12.2, §15 client/send.go, client/signer.go, sh/dromas.sh; protocol/vectors_test.go: TestVectorBadPrekeys (a statement that its signature does not cover); client/forgery_test.go: TestForgeries (a swapped prekey, an earlier prekey, a stolen working key); client/ask_test.go: TestASenderAsksBeforeItSends, TestNoAnswerAboutARecipientPostsNothing; client/signer_test.go: TestAnIdentityStatementAfterACertificatesIsRefused; sh/sh_test.go: TestVectorsPrekey; sh/messages_test.go: TestScriptChecksTheMailboxItIsServed (a swapped key); sh/revoke_test.go: TestScriptAsksBeforeItPosts, TestScriptAfterAWorkingKeyIsTaken
Sender authentication: a reader accepts a message only with its sender's own valid signature, never because a server vouches for it, and no option skips any of the reader's checks §12.3, §15.4 client/recv.go; client/forgery_test.go: TestAFromTheServerListsIsNotRead, TestAFromTheServerListsDecidesNothing, TestForgeries; client/hostile_test.go: TestMadeUpSendersLeaveNothingInPeers, TestARefusalNeverQuotesTheMessage (each malformed envelope refused); client/crash_test.go: TestADrainKilledAtEachStepOfARefusalKeepsItOnce
User presence: every verifier refuses a security key's signature whose flags don't claim that a user was present, on a signed statement, pass, message, or revocation, and on a certificate §3.2, §15.4 x/crypto's Verify (sshsig/), protocol/certificate.go (certificateForm), sh/dromas.sh (dr_sigform); protocol/skvectors_test.go: TestVectorsSecurityKeyRefusals; sh/sh_test.go: TestVectorsSignatureForm, TestVectorsCertificate, TestTheScriptReadsABlobInItsOneForm. The Go client makes no such signature (client/internal/sign; client/keytype_test.go: TestAMailboxOnASecurityKeyIdentity). The claim proves no hardware: a key in software signs the same way
Recipient binding: the signature covers the recipient, so a recipient that passes a message on to a third mailbox can't present it as one that the sender wrote to that mailbox §9.2, §12.3 check 6, §15 protocol/envelope.go, protocol/signed.go; protocol/vectors_test.go: TestVectorEnvelopes (refuse-to-another-mailbox), TestVectorPlaintexts (refuse-signed-for-another-mailbox); protocol/signer_test.go: TestVerifySignedTakesEitherForm (the namespace); sh/sh_test.go: TestVectorsEnvelope, TestVectorsPlain
Key-compromise impersonation resistance: anyone who steals a mailbox's prekey can decrypt the messages encrypted to that prekey, but can't forge a message to that mailbox, because the sender signs with a different key §15 protocol/signed.go; client/forgery_test.go: TestForgeries (a message in another mailbox's name)
Forward secrecy: each client deletes a prekey at its first recv 7 days after not_after, answered or not, and the Go client a retired one an hour after its successor, at an emptying drain §12.1, §12.4, §15.3 client/rekey.go, sh/dromas.sh (dr_prune); client/renew_test.go: TestAnEmptyingDrainDeletesEveryRetiredPrekeyAnHourAfterTheTake, TestTheOlderRetiredPrekeysGoByTheNewestRetiredOnesTake, TestTheNewestRetiredPrekeyIsKeptWhileTheTakeIsUnknown (where a renewal's answer was lost, the newest retired prekey stays until the next renewal that the server accepts), TestAMailboxReceivedAtItsCadenceDeletesAtTheRenewingCheckIn; client/clock_test.go: TestADrainDeletesARetiredKeyPastItsDeletionTime, TestEveryPrekeyGoesByTheMailboxsClockAtAServerThatRefusesEveryCall, TestAPrekeyPastItsDeletionTimeWithNoServerConfirmingItIsSaid; sh/renew_test.go: TestScriptDeletesARetiredPrekey
Replay protection: while its state file is intact, a reader never accepts a message twice, so a replay or retry within 14 days and an hour of its sent_at is acknowledged, not delivered §12.2, §12.3 checks 8 and 9, §15.9 client/recv.go (seenMsgID), sh/dromas.sh; client/failure_test.go: TestDuplicateRetryIsAckedNotDelivered; client/replay_retry_test.go: TestARetryAfterAStepOfTheHour, TestAStretchedRetryAtClocksAnHonestServerTakes; client/replay_test.go: TestAReplayIsRefusedAfterTheClockStepsBack, TestAHeldMessageAllowedSinceIsNotDeliveredAgain; client/dating_test.go: TestARetryDatedAfreshIsDeliveredOnce, TestAPostIsDatedAtThePost; sh/clock_test.go: TestScriptKeepsItsReplaySetByItsClock
Revocation: a client treats an address or a certificate as revoked only on the identity's own signature, and then permanently rejects every message, statement, and pass that the revocation covers §10, §12.5, §15.5, §15.6 client/revocation.go, protocol/revokedcerts.go, sh/dromas.sh; protocol/revokedcerts_test.go: TestVectorRevokedCertificates, TestAWorkingKeysSignatureWithinTheBoundRevokesNoCertificates (a working key's signature revokes nothing); client/revocation_test.go: TestAServersWordRevokesNothing, TestWhatIsNotARevocationRevokesNothing, TestAMessageFromARevokedSenderIsRefused (after the server hides it), TestAKeptRevocationRefusesAMessageWithNoLookup; client/revokedcerts_test.go: TestRevokeEarlierEndsWhatAnOldWorkingKeySigns, TestOnlyTheIdentitysHighestRevocationCounts; client/signer_test.go: TestARevocationOfCertificatesLeavesTheIdentity; client/ownrevocation_test.go: TestAMailboxThatKeepsItsOwnRevocationSignsNothingMore; client/ask_test.go: TestASenderAsksBeforeItSends, TestAMessageThatWaitedIsSealedAtThePost (a statement under a revoked certificate), TestAskingAtAnyTimeAndARevocationHandedOver; client/remedy_test.go: TestTheRemedyWhenTheRenewalIsRefused; sh/revoke_test.go: TestScriptTakesARevocationOnItsProofAlone, TestScriptUnderItsOwnRevocations, TestScriptReadsARevocationOfCertificates
Size hiding: the client pads every message that it sends, so the server learns a message's size only to within a padding block, and the block size grows with the message size §9.3 protocol/pad.go, client/send.go (seal), sh/dromas.sh (dr_padding); client/pad_test.go: TestSendPadsEveryMessage; sh/sh_test.go: TestPaddingIsTheGoClients
Bounded cost: whatever a hostile server sends, it can cost a mailbox only a bounded amount in each drain, measured in messages, lists, bytes, and time §11.10–§11.12, §12.3; the bounds are the client's own client/recv.go, client/api.go; client/hostile_test.go: TestADrainIsBounded (messages, bytes, lists), TestAFetchIsTheSizeItsListGives; client/resume_test.go: TestNoSizeAServerGivesIsTakenPastTheLargestCiphertext, TestAFetchIsCutWhenItStallsAndNotWhileItMoves; client/draintime_test.go: TestADrainHoldsTheLockForItsTimeAndTheNextGoesOnFromIt; client/stall_internal_test.go: TestAnyOtherCallIsBoundedWhole
Output safety: the client never prints what a sender or a server wrote as its own words, and outputs a message body only inside its envelope, in a line with control and invisible characters escaped §11.3, §11.17; the rest is the client's own client/errors.go, client/recv.go (escapeUnseen), cmd/dromas/output.go; client/hostile_test.go: TestARefusalNeverQuotesTheMessage, TestAnAPIErrorPrintsNoneOfTheServersWords; client/escape_internal_test.go: TestNoControlCharacterReachesALineRaw, TestDefaultIgnorableIsUnicodesDerivation; cmd/dromas/lines_test.go: TestNoLineCarriesAnEnvelopeMemberBesideTheEnvelope; cmd/dromas/transport_test.go: TestTheServersWordsReachNoStdoutLine; cmd/dromas/versions_test.go: TestTheVersionHeadersPrintNoneOfTheServersWords; cmd/dromas/exec_test.go: TestExecGetsTheLineAndItsArgumentsAsGiven (recv --exec gets the line on stdin, through no shell); cmd/dromas/webhook_test.go: TestNoWebhookLineCarriesItsSecrets, TestTheWebhookPostsTheLineWithTheHeaderAndTheSignature (recv --webhook posts the line, and no line or error of recv's, and no dromas status output, quotes its URL, header or secret; dromas config shows the URL, as it shows every setting)
Transport: a pass, and the address that a lookup asks about, never cross a network unencrypted, because both clients use HTTPS, or HTTP only to a loopback IP address, and never follow a redirect §11.1 client/mailbox.go (checkServerURL, followNone), sh/dromas.sh (dr_api); client/transport_test.go: TestARedirectIsNeverFollowed, TestNoCallOfAMailboxFollowsARedirect, TestAServerIsCalledOverHTTPSOrOnThisMachine; client/transport_internal_test.go: TestEveryRequestIsHeldToTheServerRule; cmd/dromas/transport_test.go: TestNoRouteOfACommandFollowsARedirect; sh/sh_test.go: TestBothClientsCallTheSameServers, TestNoCallOfTheScriptFollowsARedirect, TestTheScriptReadsNoCurlrc
Private files: the client makes files owner-only by mode (Windows: access list), rejects a user's own private key open to others, by default such a state file, and lists and kept messages others can write the client's own client/private_*.go (each directory 0700), client/keyfile_*.go (on Unix, a file's owner and mode, never an access list), client/layout.go (judgeFiles, judgeKept); client/private_test.go: TestEveryFileOfAMailboxIsItsOwnersAlone; client/keyfile_unix_test.go: TestAPrivateKeyOthersCanReachIsRefused, TestAKeyFileAnotherUserOwnsIsTheirsToGuard, TestAWorkingKeyOthersCanReachIsRefused; client/judged_test.go: TestEveryPrivateFileIsJudgedBeforeEveryOpen; client/kept_judged_test.go: TestAKeptMessageOthersCanWriteIsRefused, TestTheUnsafeOptionsLeaveTheirFilesUnjudged (the key is refused under both options); sh/files_test.go: TestTheScriptRefusesAMailboxOthersCanReach; sh/messages_test.go: TestScriptInit; on Windows, CI's windows-accounts job (a Guest account is not tested)
Release provenance: this repository's workflow builds each release from a tag that the maintainer signed, after the tests pass, attests every file that checksums.txt names, and signs the checksums (Verify a release) — .github/workflows/release.yml; gh and cosign, which check the attestations and the signature; the tag ruleset and immutable releases, settings of the repository that no test reads

To run the tests, see README.md § Tests, which gives the commands, what the shell client's tests need, and what an ok result for them doesn't tell you.

What isn't tested:

Decided questions

Each entry is a security question that's already decided. Under the entry, where one applies, is what limits the risk or why the design accepts it. The PROTOCOL.md section that the entry names gives the reasoning. The issue that the entry names is where the question was decided, and that issue has the decided label. To list every such issue, run gh issue list -R dromas-dev/dromas-client --label decided --state closed. A report of a decided question isn't a vulnerability, but you're welcome to propose a better design in an issue.

What the server, and anyone who has an address, can see and do

Passes, keys, and revocation

Forward secrecy and signatures

The mailbox's own machine

Senders

Answered only in PROTOCOL.md §15

Where the rest is

This page is SECURITY.md in dromas-client at v0.6.12.