Independent analysis by NHI Mgmt GroupSource article: Abnormal AI, “How HTML and JavaScript Fuel Modern Phishing: 3 Real-World Examples” (July 2, 2025)

TL;DR: Attackers are using delayed redirects, iframe loading tricks, XOR obfuscation, and legitimate infrastructure such as Amazon SES to make phishing emails look normal while evading static detection, according to Abnormal AI. The lesson is that email security now depends on behavioral analysis and authentication context, not link filtering alone.


At a glance

What this is: NHI Mgmt Group's analysis, drawing on Abnormal AI's blog post: HTML and JavaScript phishing uses delayed execution, iframe manipulation, and obfuscation to bypass static email defenses and appear trustworthy.

Why it matters: Email security teams need to account for message behaviour, sender authenticity, and rendered content, because phishing controls focused only on URLs and signatures miss attacks that execute after delivery.


Context

HTML and JavaScript phishing is email-borne deception that embeds active code or rendered content inside the message or attachment so the malicious action happens after the initial scan. In this article, the security gap is not delivery alone, but the fact that static email controls often inspect content before the malicious behaviour appears.

For identity and access teams, the relevance sits in trust signals. Attackers combine sender spoofing, legitimate infrastructure, and authentication pass conditions to make phishing look credible, which means human identity controls, email authentication, and message inspection now have to work together rather than as separate layers.


Key questions

Q: How should security teams detect phishing emails that hide behaviour behind HTML and JavaScript?

A: Use behaviour-aware inspection that executes the attachment, waits for delayed redirects, and evaluates iframe loading and script deobfuscation. Static scanning alone misses attacks that only become malicious after a timeout or browser interaction. Security teams should combine sandboxing, URL analysis, and sender context so the decision is based on what the message does, not only what it contains.

Q: Why do valid SPF and DKIM checks not make a phishing email safe?

A: SPF and DKIM only tell you that the message was authenticated at the transmission layer. Attackers can still use legitimate sending services, reply-to mismatches, sender impersonation, and malicious HTML or JavaScript to deliver a harmful message that passes those checks.

Q: What are the signs that a phishing email is hiding malicious JavaScript?

A: Look for delayed redirects, obfuscated strings, unexpected iframe loading, encoded payloads, and attachment names that mimic legitimate files. If the message depends on browser behaviour after open, the content is likely designed to evade static inspection rather than to communicate normally.

Q: How should security teams handle phishing that arrives through trusted email infrastructure?

A: Treat trusted infrastructure as a delivery path, not a guarantee of legitimacy. Security teams should inspect the full message path, apply post-delivery analysis where needed, and correlate sender trust with content risk, user interaction, and domain reputation. If the control model assumes trusted transport equals safe mail, attackers can bypass it without stealing credentials.


Technical breakdown

Delayed execution defeats static scanning windows

Static scanners are built to inspect content at receipt time, but HTML phishing can defer malicious behaviour until after that window closes. A three-second JavaScript delay or a much longer iframe loading sequence means the message looks harmless during inspection and only becomes active later. The same pattern lets attackers hide redirects, stage a fake login, or keep the victim on a benign-looking page long enough to lower suspicion. The control failure is not simply bad filtering, but a timing mismatch between how email gateways inspect content and how malicious code waits to execute.

Practical implication: email teams need detonation and dynamic analysis that observes rendered behaviour, not just static message content.

Obfuscation hides malicious logic inside normal-looking HTML

Attackers use XOR encoding, hex strings, indirect execution, and decoy variables to make the payload hard to read and harder to signature-match. In one campaign, the code triggered through legitimate API behaviour rather than obvious eval-style execution, which is exactly why simple pattern matching misses it. The point of the obfuscation is not only to conceal the final destination, but to break the assumptions used by static content filters and sandbox rules that rely on recognisable malicious code paths.

Practical implication: detection logic should look for encoded payloads, indirect execution patterns, and suspicious HTML/JavaScript combinations in attachments.

Authentication signals can be staged to look trustworthy

Phishing is more convincing when the message passes SPF and DKIM or appears to come from familiar infrastructure such as Amazon SES. That does not mean the sender is trustworthy, only that the transmission layer authenticated a domain or service, not the intent of the message. Attackers exploit this gap by pairing valid authentication with self-spoofing, reply-to mismatches, and brand impersonation. The result is a message that looks formally legitimate while still delivering a malicious payload, which weakens any security model that treats authentication pass results as proof of safety.

Practical implication: correlate SPF, DKIM, reply-to, sender reputation, and message behaviour before treating an email as trustworthy.


Threat narrative

Attacker objective: The attacker wants the recipient to trust the message long enough to click through to a phishing destination or follow a fraudulent workflow.

  1. Entry occurs through an HTML email attachment or message that appears to be a voicemail, meeting invite, or payment notice and entices the user to open it.
  2. Credential or trust abuse happens when the sender uses self-spoofing, reply-to mismatches, or legitimate services such as Amazon SES to pass authentication checks.
  3. Escalation occurs when delayed redirects, iframe loading, or obfuscated JavaScript executes after the initial scan and sends the user to a phishing destination.
  4. Impact is the delivery of a convincing phishing flow that can capture credentials or drive the user into a fraudulent workflow while bypassing static defenses.

Read and download The State of NHI & AI Agent Breach Report 2026, covering 150+ breaches impacting Non-Human Identities including AI Agents.


NHI Mgmt Group analysis

Email authentication is no longer a trust verdict: SPF and DKIM can confirm that a message passed transmission checks, but they do not confirm that the content is safe. Attackers now pair valid authentication with HTML payloads that become malicious only after rendering or delay. Practitioners should stop treating transport-layer legitimacy as content safety.

Rendered behaviour is now part of email identity risk: Phishing increasingly depends on what the message becomes after delivery, not what it looks like at rest. That makes dynamic analysis and sandboxing part of identity security, because the message itself is a trust boundary that can be abused to impersonate people, brands, and workflows. Email security teams need controls that understand message behaviour in context.

Trust has moved from the sender line to the execution path: When attackers can combine legitimate infrastructure, sender self-spoofing, and obfuscated JavaScript, the decisive question becomes whether the message executes suspiciously rather than whether it arrives cleanly. That shifts the governance problem from filtering to behavioural assurance. Email defence must now be measured by what it detects after rendering, not just before delivery.

HTML and JavaScript phishing creates an identity verification gap at the inbox: The recipient believes they are evaluating a human sender, but the actual risk is an engineered runtime sequence designed to bypass static controls. That gap is why email identity, content analysis, and user-facing trust cues must be governed as one problem instead of separate controls.

Phishing resilience now depends on content that can survive deception at multiple layers: Filename cues, sender reputation, authentication status, and rendered behaviour all have to be assessed together. When the attack can fake one layer and delay another, the old assumption that a clean-looking message is a low-risk message no longer holds. Practitioners should treat this as a behavioural detection problem, not a signature problem.

From our research library:

  • Roughly 1 in 3 phishing payloads are delivered outside email, through channels such as social media, search ads and messaging apps.

What this signals

HTML phishing is a behavioural detection problem, not a link-filtering problem: The attack surface now includes what the message does after it is opened, not just what it contains at receipt time. Security teams should assume that any workflow relying on delayed script execution, iframe loading, or authenticated sender infrastructure can be used to stage a credible phishing flow.

Content, transport, and identity signals must be evaluated together: A message that passes SPF or DKIM but contains suspicious HTML, self-spoofing, or obfuscated code should still be treated as high risk. That same cross-signal approach is increasingly necessary across human identity and email governance because the inbox has become a trust boundary, not just a delivery channel.


For practitioners

  • Inspect rendered email behaviour Test attachments and embedded HTML in a detonation environment that executes scripts, follows redirects, and waits long enough to observe delayed payloads.
  • Correlate authentication with content signals Treat SPF and DKIM as necessary but insufficient, and combine them with reply-to analysis, sender reputation, and suspicious HTML markers.
  • Block risky active content in mail flow Apply policy controls to HTML attachments, script-bearing content, and embedded iframes that can trigger browser-side execution after delivery.
  • Hunt for obfuscation patterns Look for XOR-like string handling, hex-encoded payloads, and indirect execution constructs such as unusual API-triggered function calls.

Key takeaways

  • HTML and JavaScript phishing defeats static email controls by hiding malicious behaviour until after delivery and initial inspection.
  • The article shows that delayed redirects, iframe manipulation, obfuscation, and legitimate sending infrastructure can all be combined to make a phishing email look authentic.
  • Effective defence depends on behavioural analysis, authentication correlation, and content controls that inspect what an email does after it opens.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

MITRE ATT&CK and OWASP API Security Top 10 address the attack and risk surface, while NIST CSF 2.0, CIS Controls v8 and NIST SP 800-53 Rev 5 set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
MITRE ATT&CKTA0006;TA0011 — Credential Access; Command and ControlThe article centres on phishing delivery, redirect staging, and post-open execution behaviour.
Recommendation — Map phishing delivery and redirect staging to credential access and command-and-control patterns in your detections.
OWASP API Security Top 10API8 — Security MisconfigurationLegitimate infrastructure and authentication checks are used as deceptive trust signals in delivery.
Recommendation — Review email and web-facing trust controls for misconfigurations that let hostile content appear legitimate.
NIST CSF 2.0PR.DS-10 — Data in Transit is ProtectedThe article shows how authenticated transport can still deliver malicious content if behaviour is not inspected.
Recommendation — Pair transport protection with content inspection so authenticated delivery does not equal safe delivery.
CIS Controls v8CIS-9 — Email and Web Browser ProtectionsThe attack pattern depends on malicious HTML, scripts, and deceptive web redirects in email.
Recommendation — Harden mail and browser controls to block active content and suspicious redirect behaviour.
NIST SP 800-53 Rev 5SI-4 — System MonitoringDynamic monitoring is required to see malicious behaviour that appears only after render or delay.
Recommendation — Use SI-4 monitoring to detect delayed execution, unusual redirects, and obfuscated payload behaviour.

Key terms

  • HTML Phishing Attachment: An HTML phishing attachment is a malicious file that opens in a browser and presents a fake login or data collection flow. It is often used to bypass email link filtering, capture credentials, and collect device details such as IP address, browser data, and location for attacker tracking.
  • Delayed Redirect: A delayed redirect is a script that waits before sending the user to a malicious destination. The delay helps attackers bypass static analysis because the harmful action happens after the initial scan window rather than during delivery.
  • Email Authentication: Email authentication is the set of controls that help recipients verify whether a message really came from a domain. SPF, DKIM, and DMARC reduce spoofing and impersonation, but they work best when combined with domain lifecycle management and user awareness.
  • Obfuscated JavaScript: Obfuscated JavaScript is code intentionally written to hide its real behaviour through encoding, indirection, or misleading structure. In phishing, it slows analysis and can defer execution until a runtime trigger makes the payload visible.

Deepen your knowledge

NHI governance, agentic AI identity, and machine identity lifecycle are core topics in our NHI Foundation Level course, the industry's only accredited NHI security programme. If you are building or maturing an IAM programme, it is worth exploring.
NHIMG Editorial Note
Published by the NHIMG editorial team on June 27, 2026.
Updated on October 8, 2026.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org