CCyberwiki

Phishing

Phishing
ClassAuthentication
Also known asSpearphishing (targeted), smishing (by text message)
MITRE ATT&CKT1566 Phishing, tactic Initial Access
Typical severityHigh
AffectsUsers and staff who sign in with a password, an SMS code or an authenticator-app code

Phishing is a message written to make a person hand over a password or other secret, open a malicious file or install software for the attacker; every form of it is social engineering delivered over an electronic channel.1 Aimed at the accounts of a web application, it usually arrives as a link to a copy of the sign-in page on a domain the attacker controls, which is how staff at Twilio and Cloudflare were targeted in July 2022. NIST's digital identity guidelines treat that copy as an impostor verifier and ignore how the user reached it: a link in an email and a search result are the same case.2

Description

The message reaches its target as a malicious attachment, as a malicious link, through a third-party service such as a social network, or in a voice call. A campaign aimed at one person, company or industry is called spearphishing; untargeted ones go out as mass spam.1 Some messages ask the reader to phone a number, and the person who answers steers them to a website or talks them into installing remote management software.1

Two variants go after OAuth 2.0 tokens. In consent phishing the link opens an authorization request for a malicious application, and a user who approves it gives that application access tokens to call APIs in the user's name. Device code phishing uses the flow built for devices without a browser: the victim types a code on an authorization page, and the device token it produces goes to the attacker.3 Forged sender addresses are the subject of Email spoofing.1

Mechanism

A fake sign-in page passes each username and password to the attacker the moment they are submitted. When the real site then asks for a second factor, the copy asks for one too.4 The user reads a TOTP code from an authenticator app, or an SMS code, and types it into the copy, and the attacker enters it on the real page before it expires. Nothing in a hand-typed code ties it to the session it was issued for, so a relay can pass it on; NIST does not count OTP or out-of-band codes as phishing-resistant.2 Reverse-proxy phishing kits that automate the relay are covered in Multi-factor authentication.

The address of the copy is picked to survive a glance. Common choices are a domain built from look-alike characters (an IDN homograph), a hostname written as a number, and text placed before an @ sign, which the browser ignores, as in https://example.com@203.0.113.10. Each of them makes the domain hard to check by eye.3

An open redirect on the real site removes the need for a look-alike domain. If example.com/go?url= forwards to any address, a link that starts with the genuine domain can end on the attacker's page, and the unchanged server name makes the link look more trustworthy.5

Notable incidents

In mid-July 2022 attackers sent hundreds of text messages to current and former Twilio employees, posing as the IT department and linking to fake Okta sign-in pages on domains such as twilio-sso.com and twilio-okta.com. Some employees entered their credentials, and the attackers used them to reach internal administrative tools and customer data. Twilio's final report counted 209 affected customers out of more than 270,000 and 93 users of its Authy app, whose accounts had extra devices registered by the attackers. Twilio then issued FIDO2 security keys to every employee.6

On 20 July 2022, starting at 22:50 UTC, at least 76 Cloudflare employees received texts within one minute linking to cloudflare-okta.com, a domain registered less than 40 minutes earlier. The page copied the Okta sign-in form, relayed each submitted password to the attacker over Telegram at once, and asked for a TOTP code. Three employees entered their credentials. Every Cloudflare employee signs in with a FIDO2 security key, and the attacker's attempts with the correct passwords stopped at the key. The company reset the three accounts and their active sessions, scanned their devices, and had the hosting provider and the registrar take down the server and the domain.4

Prevention

Phishing-resistant sign-in

NIST calls a protocol phishing-resistant authentication when it keeps secrets and authenticator outputs from an impostor without relying on the user to notice anything. That takes cryptographic authentication by one of two methods, channel binding or verifier name binding.2 The Web Authentication API (WebAuthn), used by passkeys and hardware security keys, works this way. The server sends a random challenge of at least 16 bytes; an authenticator in the browser, the operating system or a USB key signs it with a private key; the server checks the signature. Because the signature depends on the origin of the website, one made on a fake domain cannot sign in to the real one.7 At NIST's middle assurance level, AAL2, an application must offer such an option, and at the highest, AAL3, it must use one.2

Redirects

A redirect target should not come from user input. Where a route has to send the user on after sign-in, the request carries a short name and the server maps it to a fixed path:8

// Express: the request names a destination, the server picks the path
const NEXT = { dashboard: "/dashboard", billing: "/settings/billing" };
res.redirect(NEXT[req.query.next] ?? "/dashboard");

Email domain

SPF, DKIM and DMARC records let receiving mail servers filter forged messages. SPF lets them check the sender domain and DKIM the integrity of the message, while DMARC states the domain's policy for both.1 The records are covered in Email authentication (SPF, DKIM and DMARC).

Prompt for a coding agent

Find every place in this project that redirects the user to an address taken from the request: query parameters such as next, url, redirect or returnTo, form fields, cookies and headers. Replace each with a fixed map from short names to paths inside this app, with a default path for anything not in the map. Do not accept full URLs or paths that start with //. List each file and line you changed.

In SecFlash

SecFlash reports a live open redirect as SF-SEC-606 and a redirect built from request input in the code as SF-SEC-742, both on the Security page. On the Email and domain page, SF-EML-202 lists registered domains that look like the app's domain, and SF-EML-101, SF-EML-102 and SF-EML-103 report a missing SPF record, a missing DMARC record and a DMARC policy that still delivers forged mail. SF-CLD-529 on the Cloud page names Supabase members who sign in with a password alone.

See also

References

  1. a b c d e "Phishing, Technique T1566". MITRE ATT&CK. Version 2.8.
  2. a b c d "NIST SP 800-63B-4, Digital Identity Guidelines: Authentication and Authenticator Management". NIST (2025).
  3. a b "Phishing: Spearphishing Link, Sub-technique T1566.002". MITRE ATT&CK.
  4. a b Cloudflare (9 August 2022). "The mechanics of a sophisticated phishing scam and how we stopped it". Cloudflare Blog.
  5. back "CWE-601: URL Redirection to Untrusted Site ('Open Redirect')". Common Weakness Enumeration. MITRE.
  6. back Twilio (August 2022, final update 27 October 2022). "Incident Report: Employee and Customer Account Compromise". Twilio Blog.
  7. back "Web Authentication API". MDN Web Docs. Mozilla.
  8. back "Unvalidated Redirects and Forwards Cheat Sheet". OWASP Cheat Sheet Series.