Repository navigation
fix(inbound): trust only the topmost receiver authentication header - #71
Merged
Merged
Conversation
4 tasks done
kerdofficial
force-pushed
the
fix/inbound-auth-results
branch
from
October 22, 2026 19:53
58405aa to
205c65f
Compare
Merged
4 tasks done
kerdofficial
force-pushed
the
fix/inbound-auth-results
branch
from
October 23, 2026 02:15
205c65f to
e3925b2
Compare
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.
What changed
When trusted authserv-ids are configured, which the Cloudflare puller does with
mx.cloudflare.net, Inbot now evaluates only the topmost Authentication-Results header carrying a trusted id. Headers below it are ignored, even when they claim the same id and reportpass. A malformed top trusted header now fails closed instead of being skipped.Why
Before this change, a passing trusted-id header anywhere in the message was enough to skip the
unauthenticatedlabel. A sender could add such a header lower in the header block. This narrows the boundary but does not remove it: the label is still only as trustworthy as the receiver. If Cloudflare does not prepend its own header, or does not strip a sender-supplied header with its id, a forged header at the top still counts. Whether Cloudflare strips such headers is unknown.Checklist
pnpm checkpasses locallyProof: new inbound tests parse synthetic raw messages and assert both header wire order and the resulting label. A forged lower pass under a failing top header stays
unauthenticated. The inbound suite passed (79 tests).