fix(login): answer a decoy under external delivery with nothing to mail - #322
Merged
Merged
Conversation
Under external delivery the decoy responders for an OTP send and a magic link request fabricated a delivery block for shape parity, addressed to the decoy's synthetic @example.invalid email. The SDK mailed it, the domain never resolves, and the adopter's provider retried for fourteen hours and then bounced it against the adopter's sending identity. Every sign-in attempt for an unknown address was a guaranteed bounce on traffic the adopter does not control. The block is only readable with a service token, so omitting it discloses nothing to a stranger, and the SDK already sends nothing when it is absent. The magic link responder still runs the redirect check for its refusal and discards the URL. decoyOtpFor had no other reason to exist and is removed. Closes #321
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #321.
Under external delivery, the decoy responders for an OTP send and a magic link request fabricated a
deliveryblock for shape parity, addressed to the decoy's synthetic@example.invalidemail. The SDK mailed it, because mailing whatever it is handed is its job in that mode. The domain never resolves, so SES retried for fourteen hours and then bounced it against the adopter's sending identity. Every sign-in attempt for an unknown address was a guaranteed bounce on traffic the adopter does not control. RoxTarget took seven of them overnight from one person trying an address with no account.What changes
src/controllers/decoyResponders.ts:respondOtpSentanddecoyRequestMagicLinkno longer readcanReturnExternalDeliveryor build adeliveryblock. A decoy answers{ message, token }and{ message }whatever the header says. The magic link responder still callsresolveMagicLinkUrlso a disallowed redirect gets the same400a real account gets; it discards the URL now, with a comment saying the call is made for its refusal. The file's header comment gains a third invariant, "No delivery block", with the reason.src/services/decoyPrincipal.ts:decoyOtpForand its HKDF label are removed. Its own doc said it existed only to fill the block.deliverAuthMessagealready returns early whendeliveryis absent, so no SDK change is needed for the send to stop.Docs
docs/security-posture.md, "What is still observable": the external delivery bullet now says a decoy answers with no block, what the fabrication used to cost, and where the remaining timing difference sits.Not in this PR
An
@example.invalidguard in the SDK'sdeliverAuthMessagewould protect adopters who lag behind this release. It belongs inseamless-auth-serverand couples the SDK to a detail of the decoy's construction, so it is left as a follow-up there if wanted. RoxTarget keeps bouncing until this ships androxtarget-prod-authmoves off v0.14.0.Test plan
npm run typecheck,npm run lint,npm run format:check,npm run check:changeset-bump,npm run buildnpm run test:run: 1477 passing. Three new cases indecoyContinuation.spec.tsdrive external delivery for real (header plus a minted service token) against/otp/generate-email-otp,/otp/generate-login-email-otpand/magic-linkand assert nodeliverykey. Run against the old responder they fail with the block present.