Skip to content

fix(inbound): trust only the topmost receiver authentication header - #71

Merged
kerdofficial merged 1 commit into
mainfrom
fix/inbound-auth-results
Oct 23, 2026
Merged

kerdofficial merged 1 commit into
mainfrom
fix/inbound-auth-results

Conversation

@kerdofficial

@kerdofficial kerdofficial commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

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 report pass. 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 unauthenticated label. 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

  • The PR title follows conventional commits
  • The PR does one thing
  • pnpm check passes locally
  • Every affected surface is covered (service, docs)

Proof: 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).

@kerdofficial
kerdofficial force-pushed the fix/inbound-auth-results branch from 58405aa to 205c65f Compare October 22, 2026 19:53
@kerdofficial
kerdofficial changed the base branch from main to fix/windows-system-tar October 22, 2026 19:53
@kerdofficial kerdofficial mentioned this pull request Oct 22, 2026
4 tasks done
@github-actions github-actions Bot added size:M and removed size:S labels Oct 22, 2026
Base automatically changed from fix/windows-system-tar to main October 23, 2026 02:15
@kerdofficial
kerdofficial force-pushed the fix/inbound-auth-results branch from 205c65f to e3925b2 Compare October 23, 2026 02:15
@github-actions github-actions Bot added size:S and removed size:M labels Oct 23, 2026
@kerdofficial
kerdofficial merged commit 08e6e02 into main Oct 23, 2026
5 checks passed
@kerdofficial
kerdofficial deleted the fix/inbound-auth-results branch October 23, 2026 02:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant