# Stop Subdomain Phishing Attacks (@hr.example.com / @login.example.com) with DMARC sp=reject

> Close the #1 enterprise DMARC blind spot where attackers bypass p=none on the apex domain by spoofing arbitrary nonexistent subdomains like @security.example.com.

- **Canonical URL**: https://opslint.dev/dmarc/subdomain-spoofing-protection-sp-reject-policy/
- **Category**: `DMARC`
- **Interactive Workbench**: [Open in Live Workbench](https://opslint.dev/dmarc/#domain=github.com)
- **Normative Specifications**: `RFC 7489 §6.3 ('sp' Requested Mail Receiver Policy for All Subdomains)`, `RFC 7208 §2.4 (Non-Inheritance of Apex SPF to Subdomains)`

## Incident Symptom & Root Cause

**Production Symptom**: While an enterprise spends 6 months auditing legacy printers on @example.com under _dmarc.example.com p=none, phishers bypass detection completely by sending executive wire-fraud emails from From: IT Helpdesk <support@sso-login.example.com> or From: Payroll <ach@finance.example.com>!

**Protocol / Engine Root Cause**: When _dmarc.example.com sets p=none WITHOUT specifying sp=reject, RFC 7489 §6.3 defaults sp= to inherit p= (none) for every single subdomain—including infinite nonexistent random subdomains (*.example.com) that have zero SPF records! Attackers scan Fortune 500 _dmarc records specifically looking for p=none without sp=reject (or worse, p=reject; sp=none;)!

## Remediation Diff (Broken vs Verified Fix)

### Subdomain Spoofing Wide Open During Apex Audit (or Broken sp=none!)

```text
; VULNERABILITY A: Apex p=none with omitted sp= leaves *.example.com wide open to spoofing!
_dmarc.example.com. 3600 IN TXT "v=DMARC1; p=none; rua=mailto:dmarc@example.com"

; VULNERABILITY B: Apex locked to p=reject, YET legacy 'sp=none' left behind forever!
; Attackers simply spoof @secure.example.com or @billing.example.com and sail into inboxes!
_dmarc.example.com. 3600 IN TXT "v=DMARC1; p=reject; sp=none; rua=mailto:dmarc@example.com"
```

### Immediate sp=reject Lockdown + Explicit Overrides ONLY on Known Sending Subdomains

```text
; 1. Lock ALL wildcard/nonexistent subdomains IMMEDIATELY with sp=reject (even while apex is p=none!):
_dmarc.example.com.        3600 IN TXT "v=DMARC1; p=none; sp=reject; rua=mailto:dmarc@example.com"

; 2. If 2 real subdomains actively send unauthenticated legacy mail still being remediated,
; give ONLY those 2 exact subdomains temporary leaf _dmarc records while the rest of *.example.com is protected!
_dmarc.legacy-erp.example.com. 3600 IN TXT "v=DMARC1; p=none; rua=mailto:dmarc@example.com"

; 3. Once apex is ready, enforce p=reject across both apex and all subdomains:
; _dmarc.example.com. 3600 IN TXT "v=DMARC1; p=reject; sp=reject; rua=mailto:dmarc@example.com"
```

## Engineering Deep Dive

Think about the asymmetry between your apex domain (@example.com) and the infinite namespace of *.example.com: on @example.com, dozens of departments may have connected SaaS tools over the last decade, requiring careful rua discovery before flipping p=reject. Across *.example.com, however, 99.9999% of possible strings (@okta-reset.example.com, @ceo-urgent.example.com, @wire-transfer.example.com) do not even exist in DNS! Leaving sp= at none gives phishers an unlimited supply of trusted-looking corporate subdomains!

Setting sp=reject on Day 1 of your DMARC project (v=DMARC1; p=none; sp=reject; rua=mailto:...) shuts down arbitrary subdomain spoofing overnight without touching @example.com mail! What if your company DOES send legitimate mail with visible From: @marketing.example.com or From: @alerts.example.com? Simply check your first week of rua XML reports for any <header_from> ending in .example.com: either authenticate those 2–3 real subdomains properly (custom SPF + DKIM) right away, OR drop a temporary leaf _dmarc.marketing.example.com IN TXT "v=DMARC1; p=none; ..." record on that specific subdomain while keeping sp=reject protecting the infinite remainder!

Wait: does sp=reject break custom Return-Path bounce subdomains (like Return-Path:<id@bounces.example.com>) when the visible header is From: <support@example.com>? NO! DMARC policy discovery (p= vs sp=) ONLY inspects the visible RFC 5322 From: header domain! Because From: is @example.com (the apex!), DMARC evaluates p=, NOT sp=—sp= only triggers when an email's visible From: address itself is on a subdomain (From: user@sub.example.com)!

## When Does p= vs sp= Trigger? (Scenario Breakdown)

| Case / Engine | Protocol Behavior | Production Remediation |
| :--- | :--- | :--- |
| **From: @example.com + Return-Path: @bounces.example.com** (`#sp-apex-from-bounce-sub`) | Governed by apex p= policy (NOT sp=!), because visible From: is the organizational apex. | Safe! Setting sp=reject NEVER breaks bounce subdomains used by apex From: senders. |
| **Spoofed From: @it-helpdesk.example.com (no leaf _dmarc)** (`#sp-random-nonexistent-sub`) | Falls back to _dmarc.example.com and applies sp= policy! | Set sp=reject immediately so nonexistent phishing subdomains are 100% blocked. |
| **From: @legacy.example.com (HAS _dmarc.legacy.example.com)** (`#sp-explicit-leaf-override`) | Uses leaf _dmarc.legacy.example.com's own p= tag; ignores parent sp=reject! | Carve out individual legacy subdomains via leaf _dmarc records while keeping root sp=reject. |
| **_dmarc.example.com has 'p=reject;' (sp= omitted)** (`#sp-omitted-with-p-reject`) | Per RFC 7489 §6.3, omitted sp= automatically inherits p=reject for all subdomains! | Writing explicit 'p=reject; sp=reject;' is self-documenting for ops teams, though 'p=reject;' already enforces both. |

## Frequently Asked Engineering Questions

### If 'p=reject' already implies 'sp=reject' when sp= is omitted, why write 'sp=reject' explicitly?

Two practical reasons: (1) while p= is still 'none' or 'quarantine', explicit 'sp=reject' gives stronger protection to subdomains than the apex; and (2) once p=reject is reached, explicit 'sp=reject' makes subdomain enforcement unmistakable during incident reviews and security compliance audits without forcing engineers to look up RFC 7489 §6.3 defaults.

### Do we also need a wildcard TXT record '*.example.com IN TXT "v=spf1 -all"' alongside sp=reject?

Be VERY careful with DNS wildcards (*.example.com IN TXT)! In DNS (RFC 4592), a wildcard *.example.com ONLY matches names that have ZERO existing records of ANY type (A, AAAA, CNAME, MX)! Any existing host like api.example.com (which has an A record) does NOT match *.example.com! Rely on _dmarc sp=reject (which DOES cover both existing and nonexistent subdomains via RFC 7489 PSL fallback!) plus explicit v=spf1 -all on known non-mail A hosts.

### How do attackers discover if we left sp=none on our domain?

 _dmarc.example.com is public DNS: one dig +short TXT _dmarc.example.com query reveals sp=none in 20 milliseconds.

## Related Problem-Cluster Guides

- [DMARC Organizational Domain Discovery, Public Suffix List (PSL) Fallback, and sp= Tag](https://opslint.dev/dmarc/organizational-domain-public-suffix-fallback-sp-tag/) — How RFC 7489 §3.2 uses the Mozilla Public Suffix List (e.g. .co.uk, .com.au, .github.io) to find organizational _dmarc policies and apply sp= subdomain rules.
- [Protect Parked Domains & Non-Mail Hosts with Null SPF (v=spf1 -all), Null MX, and DMARC Reject](https://opslint.dev/spf/null-spf-v-spf1-minus-all-parked-domains/) — Lock down parked domains, API/CDN subdomains, and defensive lookalike domains in 4 DNS lines using RFC 7208 v=spf1 -all, RFC 7505 Null MX, and DMARC p=reject.
- [DMARC Rollout Playbook: p=none -> quarantine -> reject and How pct= Actually Works](https://opslint.dev/dmarc/gradual-rollout-p-none-quarantine-reject-pct-tag/) — Execute a zero-outage DMARC enforcement rollout from p=none to p=reject, and avoid the dangerous myth that pct=10 on p=reject drops unthrottled messages to None.
- [DMARC Identifier Alignment Explained: SPF Pass + DKIM Pass Can Still Fail DMARC!](https://opslint.dev/dmarc/identifier-alignment-spf-dkim-relaxed-vs-strict/) — Why emails with spf=pass and dkim=pass still bounce with dmarc=fail when Return-Path or DKIM d= domains don't align with From:, plus aspf=r/s and adkim=r/s rules.
