Skip to content

feat: add enforce_outer_from_key_alignment config for bots using addresses as identity#8433

Draft
hpk42 wants to merge 1 commit into
link2xt/lnxsrknwkmnqfrom
hpk/outer-from-alignment
Draft

feat: add enforce_outer_from_key_alignment config for bots using addresses as identity#8433
hpk42 wants to merge 1 commit into
link2xt/lnxsrknwkmnqfrom
hpk/outer-from-alignment

Conversation

@hpk42

@hpk42 hpk42 commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

this is meant for merging into #8382 to resolve the remaining loginbot vulnerability:

If the alignment option is enabled (default is disabled) the processing of encrypted messages changes:

  • the outer From address must be listed as a relay address in the signing key, otherwise the message is trashed,

  • the sender contact keeps the outer From address instead of adopting the one from the encrypted part.

Otherwise an attacker sending from their own relay-enforced address, with their own unmodified key, puts the victim's address into the encrypted From header and the contact address becomes the victim's.

Arguably a fix: Autocrypt headers from the encrypted part are now accepted without comparing their address to the outer From, so that a newly added relay address is imported from the message before the check.

@hpk42

hpk42 commented Jul 20, 2026

Copy link
Copy Markdown
Contributor Author

seems #8382 needs rebasing to avoid the cargo deny failures that main doesn't have but not sure it's a good idea to do it here in the PR to that #8382.

…esses as identity

If enabled (default is disabled) the processing of encrypted messages changes:

- the outer From address must be listed as a relay address in the signing key,
  otherwise the message is trashed,

- the sender contact keeps the outer From address instead of adopting
  the one from the encrypted part.

Otherwise an attacker sending from their own relay-enforced address,
with their own unmodified key, puts the victim's address into the
encrypted From header and the contact address becomes the victim's.

Arguably a fix: Autocrypt headers from the encrypted part are now accepted without
comparing their address to the outer From, so that a newly added relay address
is imported from the message before the check.
@hpk42
hpk42 force-pushed the hpk/outer-from-alignment branch from 198d98e to 285e8b0 Compare July 20, 2026 11:41
@hpk42
hpk42 marked this pull request as draft July 20, 2026 15:44

@iequidoo iequidoo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commit message: feat: add enforce_outer_from_key_alignment config **needed** for bots using addresses as identity. Otherwise it's not clear whether this config only works in presense of Config::Bot (actually not)

Comment thread src/config.rs
/// Only the outer From is enforced by the sender's relay,
/// so only it can be used as an identity.
#[strum(props(default = "0"))]
EnforceOuterFromKeyAlignment,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For me it looks like UseOuterFromAsContactAddr would be a better naming:

  • It's what actually happens if the outer From differs from the inner one, but is still aligned with sender's key.
  • Actually, alignment with the key is just an additional check which protects from the server changing the outer From to any address. The bot (or bot's server) still needs to check somehow (using DKIM i guess) that the outer From is actually owned by one who scanned the invite link.
  • Alignment of the outer From with the key isn't checked if the outer From is the same as the inner one, and without reading the doc comment above it's not clear.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants