Today’s Lesson
Security for Legal SaaS — Episode 16: Email Security for SaaS
The Weakest Link in Your Security Chain
Email remains the primary attack vector for breaching organisations. The FBI’s IC3 reported $2.9 billion in losses from business email compromise (BEC) in 2023 alone. For legal SaaS platforms that send privileged case updates, court deadline reminders, and magic-link authentication tokens via email, a compromised email channel is a direct path to privilege waiver.
Key stat: 74% of all breaches involve a human element — phishing, pretexting, or credential theft via email. Email is where social engineering meets technical exploitation.
The triad of SPF, DKIM, and DMARC forms the baseline defence for outbound email integrity. Without all three configured correctly, your platform’s emails can be spoofed, your magic links intercepted, and your clients phished using your own domain.
SPF, DKIM, and DMARC — The Authentication Triad
SPF (Sender Policy Framework)
SPF (RFC 7208) publishes a DNS TXT record — DNS being the internet’s address book that translates domain names into IP addresses — listing which IP addresses are authorised to send email on behalf of your domain. Receiving mail servers check the envelope sender against this list.
| SPF Component | Purpose |
|---|---|
v=spf1 | Version identifier |
include:_spf.google.com | Authorise Google Workspace IPs |
include:sendgrid.net | Authorise transactional email provider |
-all | Hard-fail everything else (reject, don’t softfail) |
Critical for legal SaaS: Use -all (hard fail), not ~all (soft fail). Soft fail means spoofed emails from your domain still get delivered — just marked suspicious. Google’s email sender guidelines (2024) require SPF alignment for bulk senders.
DKIM (DomainKeys Identified Mail)
DKIM (RFC 6376) cryptographically signs email headers and body. The sending server attaches a signature using a private key; receivers verify against the public key in your DNS. This proves the email was not modified in transit and genuinely originated from your infrastructure.
For legal SaaS platforms sending transactional email through services like SendGrid, Postmark, or AWS SES, you must configure DKIM signing with your own domain key — not the provider’s default. Postmark’s DKIM guide details the DNS CNAME setup.
DMARC (Domain-based Message Authentication, Reporting, and Conformance)
DMARC (RFC 7489) ties SPF and DKIM together with a policy declaration and reporting mechanism.
| DMARC Tag | Recommended Value | Meaning |
|---|---|---|
p=reject | Production policy | Reject emails failing both SPF and DKIM |
rua=mailto:dmarc@yourdomain.com | Aggregate reports | Receive daily XML reports of authentication results |
ruf=mailto:forensics@yourdomain.com | Forensic reports | Receive per-failure reports (careful — may contain PII) |
pct=100 | Full enforcement | Apply policy to 100% of messages |
aspf=s | Strict SPF alignment | Domain must exactly match (no subdomain) |
Deployment warning: Go from p=none → p=quarantine → p=reject over 4–6 weeks while monitoring aggregate reports. Jumping straight to p=reject without monitoring will block legitimate email you forgot about — marketing tools, CRM integrations, legacy systems. DMARC.org recommends this graduated approach.
Magic-Link Authentication Risks
Magic links — one-time URLs sent via email for passwordless login — are increasingly popular in legal SaaS. But they inherit every vulnerability of the email channel.
Attack Scenarios
| Attack | Mechanism | Impact |
|---|---|---|
| Email account compromise | Attacker with access to inbox clicks magic link | Full account takeover |
| Link interception (MitM) | Corporate email proxies, logging gateways | Token captured before user clicks |
| Link forwarding | User accidentally forwards email containing active link | Unintended third-party access |
| Prefetch/preview | Email security scanners follow links automatically | Token consumed before user can use it |
Auth0’s security guidance on magic links recommends: single-use tokens, short expiry (10 minutes maximum), binding to the originating session, and requiring the user to complete login on the same device/browser that initiated the request.
Hardening Magic Links
- Bind to session — The link only works in the browser session that requested it
- Device fingerprint — Require the same IP range or device characteristics
- Short TTL — 5–10 minutes maximum. OWASP recommends tokens expire within minutes, not hours
- Rate limit — Maximum 3 magic link requests per email per hour
- Notify on use — Send a separate notification when the link is consumed from a new device
Email-Based Account Recovery Attacks
Account recovery via email is the reset button that bypasses every other security control. If an attacker controls the email address associated with an account, they control the account.
Microsoft’s research on account takeover showed that Lapsus$ specifically targeted help desk staff to trigger email-based password resets. For legal SaaS:
- Never rely solely on email for account recovery — Combine with identity verification (security questions, out-of-band confirmation, admin approval)
- Notify all registered channels — When a recovery is initiated, alert via SMS, push notification, and the old email simultaneously
- Cool-down period — After recovery, restrict sensitive operations (downloading documents, changing security settings) for 24 hours
- Recovery audit trail — Log every recovery attempt with IP, user agent, and geolocation
BIMI — Brand Indicators for Message Identification
BIMI (Brand Indicators for Message Identification) displays your verified logo next to emails in supporting clients (Gmail, Apple Mail, Yahoo). It requires p=quarantine or p=reject DMARC policy and a Verified Mark Certificate (VMC) from DigiCert or Entrust.
For legal SaaS, BIMI serves a security purpose beyond branding: it trains recipients to expect your logo. Phishing emails spoofing your domain will not display the logo, providing a visual signal that something is wrong. Google’s BIMI requirements mandate DMARC enforcement as a prerequisite.
Secure Transactional Email Architecture
| Layer | Control | Purpose |
|---|---|---|
| Sending infrastructure | Dedicated IP pool | Reputation isolation from marketing email |
| Authentication | SPF + DKIM + DMARC (p=reject) | Prevent spoofing |
| Transport | TLS enforcement (MTA-STS) | Prevent downgrade attacks |
| Content | No sensitive data in email body | Email is not a secure channel |
| Links | Tokenised, session-bound, short-lived | Prevent interception/replay |
| Monitoring | DMARC aggregate reports + alerting | Detect spoofing attempts |
| Fallback | MTA-STS + DANE | Prevent TLS stripping |
MTA-STS (RFC 8461) publishes a policy requiring TLS for email delivery to your domain — preventing downgrade attacks where an attacker strips encryption from the SMTP (Simple Mail Transfer Protocol) connection.
Architecture principle: Email is a notification channel, never a data transport channel. Case updates should say “You have a new update — log in to view it” rather than including the actual privileged content. OWASP’s transaction authorisation guidance reinforces this: sensitive actions require authenticated confirmation, not email-borne tokens alone.
Legal SaaS-Specific Considerations
- Court notification emails — If your platform sends court deadline reminders, a spoofed “deadline extended” email could cause a lawyer to miss a filing deadline. DMARC
p=rejectprevents this. - Client communication summaries — Never include privileged content in email notifications. A forwarded email or compromised inbox exposes privilege.
- Multi-tenant sender isolation — Each law firm tenant should ideally send from their own subdomain (
firmname.yourplatform.com) with dedicated SPF/DKIM, isolating reputation and preventing cross-tenant spoofing. - Regulatory email retention — Singapore’s PDPA requires organisations to protect personal data in electronic communications. Transactional emails containing client identifiers must be treated as personal data.
Conclusion
Email security for SaaS is not optional — it is foundational. The SPF/DKIM/DMARC triad prevents domain spoofing. Magic links must be session-bound and short-lived. Account recovery must not rely solely on email. And the architecture principle is simple: email notifies, it never transports sensitive data.
Configure DMARC at p=reject. Deploy BIMI. Enforce MTA-STS. Treat every email your platform sends as a potential attack vector if spoofed — because your adversaries already do.
Next episode: Password Hashing Done Right — why storing passwords “encrypted” is almost as bad as storing them in plaintext.