All Projects

ID Status Summary Opened by
 569 Closed Critical: Incomplete Fix of FS#558 Allows Unauthenticat ...anondgr Task Description

## Description

A vulnerability exists in alwaysdata's outbound SMTP relay (`smtp-edusync.alwaysdata.net`, banner `smtpout1.paris1.alwaysdata.com`, Exim 4.98.2) and in the authenticated submission service (`smtp-<account>.alwaysdata.net:465`).

During testing it was observed that the sender-domain protection introduced to fix  FS#558  ("Cross-customer mail spoofing via unauthenticated internal SMTP relay") — which explicitly documented *"Part F — Staff impersonation accepted (`MAIL FROM:admin@alwaysdata.com`)"* — only rejects the literal string `alwaysdata.net`. It does not reject the alwaysdata staff/brand domain `alwaysdata.com` or any `*.alwaysdata.net` subdomain. Those senders are accepted with no authentication on the relay, and the platform then adds its own DKIM signature (`d=alwaysdata.net`) before delivering the message.

An attacker can exploit this by opening a session to the relay, issuing `MAIL FROM:admin@alwaysdata.com` (or `billing@alwaysdata.com`, `admin@mail.alwaysdata.net`, `admin@sub.alwaysdata.net`), and completing `DATA` — the message is accepted and delivered to the recipient's INBOX on alwaysdata-hosted mailboxes.

The root cause appears to be that the fix matches an exact domain string (`alwaysdata.net`) instead of the DNS/DMARC organizational boundary (the whole `.alwaysdata.net` tree and the `.alwaysdata.com` staff domain).

## Steps to Reproduce

1. From any host, open a TCP connection to `smtp-edusync.alwaysdata.net:587` (no authentication required).
2. Read the banner: `220 smtpout1.paris1.alwaysdata.com ESMTP Exim 4.98.2`.
3. Send `EHLO <anything>.alwaysdata.net`.
4. Attempt a staff/brand sender without authenticating:

  1. `MAIL FROM:admin@alwaysdata.net` → `250 OK`, then `DATA` → `550 You are not allowed to send messages from this address` (this is the *only* blocked form).
  2. `MAIL FROM:admin@alwaysdata.com` → `250 OK`; `MAIL FROM:billing@alwaysdata.com` → `250 OK`; `MAIL FROM:admin@mail.alwaysdata.net` → `250 OK`; `MAIL FROM:admin@sub.alwaysdata.net` → `250 OK`.

5. Send `RCPT TO:<your-own-alwaysdata-mailbox>` → `250 Accepted`.
6. Send `DATA`, then a message whose `From:` header matches the spoofed staff address, and finish with `.`.
7. Observe the relay responds `250 OK id=1xXcxZ-…` and the message is delivered.
8. Log in to the recipient mailbox (IMAP `imap-<account>.alwaysdata.net:993`) and read the message — it is present in INBOX.
9. Inspect the headers: the message carries `Return-Path: admin@alwaysdata.com`, a platform `DKIM-Signature` with `d=alwaysdata.net`, and `X-alwaysdata-Spam-Report` containing `DMARC_POLICY_QUARANTINE` (inbound alwaysdata.com, score 1.50) — yet it was delivered to INBOX and not quarantined.

The same envelope spoof (`MAIL FROM:admin@alwaysdata.com`) also succeeds on the authenticated submission service `smtp-<account>.alwaysdata.net:465` after logging in with an ordinary mailbox, reaching `DATA` with `250 OK`.

### Expected Result

The relay and submission service should reject any sender whose domain is controlled by alwaysdata but is not owned by the authenticated (or, on the unauthenticated relay, authorized) user — i.e. all of `alwaysdata.net`, `*.alwaysdata.net`, `alwaysdata.com`, and `*.alwaysdata.com`. The  FS#558  fix should cover the whole alwaysdata-controlled namespace, not one literal string.

### Actual Result

Only the exact string `alwaysdata.net` (and case/suffix-normalized variants of it) is rejected. The staff domain `alwaysdata.com` and every `*.alwaysdata.net` subdomain are accepted without authentication, signed with DKIM `d=alwaysdata.net` by the platform, and delivered to alwaysdata-hosted recipients' INBOX without quarantine.

## Potential Impact

### Technical Impact

- Integrity / Authenticity: Mail that purports to originate from alwaysdata staff/brand addresses (`@alwaysdata.com`, `@*.alwaysdata.net`) is accepted by alwaysdata's own infrastructure and injected into mailboxes. The platform's own DKIM signature (`d=alwaysdata.net`) is attached, lending the forged message additional legitimacy.
- Authorization: A sender is able to use an identity (alwaysdata's brand/staff domain) that it does not own, on an unauthenticated relay.

### Business Impact

- Phishing / fraud: Attackers can send invoice, password-reset, or support-themed phishing from addresses that appear to be official alwaysdata staff, both to alwaysdata customers and to third parties.
- Brand reputation: The From domain (`alwaysdata.com`) is the organization's primary brand domain; abuse from it damages trust and can lead to domain-reputation and deliverability problems.
- Incomplete remediation risk: Because this is the same class as the previously accepted  FS#558  (and  FS#481 ), it represents a regression/incomplete fix rather than a new pattern, so it will continue to be exploited until closed at the organizational-domain level.

### Realistic Attack Scenario

An attacker connects to `smtp-edusync.alwaysdata.net:587`, sends `MAIL FROM:billing@alwaysdata.com` with a `From: alwaysdata Billing billing@alwaysdata.com` header and a body containing a payment/credential-harvesting link, and targets an alwaysdata customer's mailbox. The message is accepted without authentication, DKIM-signed by the platform, and delivered to the victim's INBOX, where it appears to come from an official alwaysdata billing address.

## Recommendation

- Enforce sender binding using the organizational domain (eTLD+1) or an explicit allow-list of alwaysdata-owned domains, instead of matching the literal string `alwaysdata.net`.
- Reject, in both the unauthenticated relay and the authenticated submission path, any envelope sender whose domain is alwaysdata-controlled (`alwaysdata.net`, `*.alwaysdata.net`, `alwaysdata.com`, `*.alwaysdata.com`) unless that domain is owned by the authenticated account.
- Apply the same check to the `From:` header, not only the envelope.
- Ensure inbound filtering honors DMARC subdomain policy (`sp=quarantine`) and inherits the organizational-domain DMARC record for `*.alwaysdata.net` (currently reported as `DMARC_NA`, score 0, and delivered to INBOX).

## Additional Information

### Evidence

- Relay banner: `220 smtpout1.paris1.alwaysdata.com ESMTP Exim 4.98.2` (`smtp-edusync.alwaysdata.net:587`).
- Raw transcript (unauthenticated relay, envelope sender spoof):

  1. `MAIL FROM:admin@alwaysdata.net` → `250 OK` … `DATA` → `550 You are not allowed to send messages from this address`
  2. `MAIL FROM:admin@alwaysdata.com` → `250 OK` … `DATA` → `250 OK id=1xXcxZ-…`
  3. `MAIL FROM:billing@alwaysdata.com` → `250 OK` … `DATA` → `250 OK id=1xXcxa-…`
  4. `MAIL FROM:admin@mail.alwaysdata.net` → `250 OK` … `DATA` → `250 OK id=1xXcxb-…`
  5. `MAIL FROM:admin@sub.alwaysdata.net` → `250 OK` … `DATA` → `250 OK id=1xXcxd-…`

- Authenticated submission (`smtp-<account>.alwaysdata.net:465`): `MAIL FROM:admin@alwaysdata.com` → `250 OK` … `DATA` → `250 OK`; `MAIL FROM:ceo@alwaysdata.net` → `DATA` → `550`.
- Delivered message headers (received in INBOX):

  1. `From: admin@alwaysdata.com`, `Return-Path: admin@alwaysdata.com`, `DKIM-Signature: d=alwaysdata.net`
  2. `X-alwaysdata-Spam-Report: 1.50 DMARC_POLICY_QUARANTINE [alwaysdata.com : No valid SPF, DKIM not aligned (strict), quarantine]`
  3. Subdomain case: `X-alwaysdata-Spam-Report: 0.00 DMARC_NA [mail.alwaysdata.net] - No DMARC record` (delivered to INBOX).

### References

- Related alwaysdata reports:  FS#558  (Cross-customer mail spoofing via unauthenticated internal SMTP relay — accepted/fixed),  FS#481  (earlier sender-authentication fix).
- CWE-290 (Authentication Bypass by Spoofing), CWE-20 (Improper Input Validation); MITRE ATT&CK T1566.002 (Phishing: Spearphishing Link).

Showing tasks 1 - 1 of 1 Page 1 of 1

Available keyboard shortcuts

Tasklist

Task Details

Task Editing