Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

alpaca mitigations #5061

Draft
wants to merge 11 commits into
base: master
Choose a base branch
from
Draft

Conversation

elliefm
Copy link
Contributor

@elliefm elliefm commented Oct 2, 2024

Adds the following mitigations that prevent Cyrus IMAP servers being used in Application Layer Protocol Confusion (ALPACA) attacks, particularly against web browsers:

  • connection is dropped after excessive consecutive basic syntax errors ("Invalid tag", "Null command", "Unrecognized command")
  • tags cannot contain <> characters (prevents reflecting attacker-supplied HTML content in IMAP responses)
  • tags cannot contain : characters (HTTP request header lines now count as basic syntax errors)
  • the first command's tag cannot be one of the HTTP request methods that accepts a request body (connections from tricked web browsers will look like this)
  • connection is dropped if the first command has an invalid tag, including the first command after STARTTLS is established

Fixes #5046

@elliefm
Copy link
Contributor Author

elliefm commented Oct 2, 2024

(details subject to change after we get some data about what tags IMAP clients in the wild are sending to our servers)

@elliefm
Copy link
Contributor Author

elliefm commented Nov 11, 2024

Needs #5126 to land first

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.

countermeasures to ALPACA attack?
1 participant