Get DeafLetter
A weekly selection of signals, vulnerabilities and guides. Critical alerts remain optional.
You can unsubscribe at any time. Privacy policy.
On August 27, 2025, a SANS Internet Storm Center handler collected and analyzed roughly 56 samples of a phishing page that generated unique variants server-side for every single request. A scope error in the counter variable k caused infinite loops in ~3.6% of instances, breaking the page and exposing a polymorphic obfuscation mechanism that would otherwise have flown under the radar.
- 50 automated requests to the same URL produced 50 distinct SHA-256 hashes, each with unique HTML titles, function/variable names, CSS classes, and image parameters
- 21 different page titles identified across the 50 samples, including "Solution", "Viewer", "Credentials", "Private", "Authenticate"
- 49 of 50 samples deobfuscated correctly; 1 entered an infinite loop with 100% utilization of a single CPU core for ~30 seconds
- The scope bug shares variable k between an outer decode function and an internal _YF helper; the call _YF(47,47) resets the counter, stalling the outer loop between values 48 and 49
- Across ~56 total samples collected, 2 pages exhibited the same failure pattern with different randomized function names but identical scope error
How the Bug Made the Invisible Visible
The original page, loaded manually by the analyst, failed to work. "Had the first page loaded normally, I would almost certainly have dismissed it as yet another run-of-the-mill phishing site," the author wrote in the SANS diary. The malfunction instead triggered a manual analysis that led to the systematic collection of 50 additional samples, all with distinct SHA-256 hashes.
The polymorphic generation mechanism extends beyond the obfuscated JavaScript wrapper. The 50 samples presented 21 different page titles — including "Solution", "Viewer", "Credentials", "Private", "Authenticate" — along with varied form and input names, CSS classes, element IDs, image parameters, and zero-width characters. The source documents that the transformations are "quite systematic," indicating a conventional obfuscator with random renaming and function reordering, not a system based on large language models.
The SANS author explicitly ruled out LLM involvement, despite the existence of a Unit 42 proof-of-concept on AI-generated polymorphic phishing. The recurring scope bug, consistent with a random renaming mechanism that ignores local variable handling, was considered decisive evidence of a traditional approach.
The Loop Mechanism: From Global Variable to Stall
The core of the failure lies in a counter variable k that is not declared locally, shared between the outer decode function and the internal _YF helper. The outer loop iterates from 0 to 63; when _YF(47,47) sets k to 47, the internal increment brings the value to 48, the exit condition fails, and the function returns with k=48. The outer loop increments to 49, but the subsequent call to _ie() reinvokes _YF(47,47), which resets k to 48. The cycle repeats indefinitely between 48 and 49.
This behavior produces 100% consumption of a single CPU core for approximately 30 seconds, followed by a browser timeout. The page never fully renders, frustrating the credential-harvesting objective. The observed failure rate is 2 pages out of ~56 total samples, obtained by combining the 50 automated requests with the author's original manual attempts.
The phenomenon is probabilistic: the original page loaded by the analyst was "broken," while subsequent manual loads worked. This non-determinism, inherent to the polymorphic mechanism, makes the malfunction intermittent and therefore harder for victims to diagnose.
"The obfuscation mechanism intended to make the page more difficult to detect was also capable of making it somewhat ineffective at stealing credentials" — SANS Internet Storm Center
What to Do Now
For enterprise security teams, the case demands three concrete actions. First: integrate systematic multi-sample collection from the same URL into malware analysis playbooks, not single downloads. The SANS author obtained 50 different hashes from 50 consecutive requests; detection based on a single sample would have logged 50 distinct signatures without correlating them.
Second: configure dynamic analysis sandboxes to flag JavaScript loops with sustained CPU consumption beyond 10 seconds, not just completed executions. The infinite loop between values 48 and 49 of variable k generated a reproducible behavioral profile — 100% single-core CPU for ~30 seconds — identifiable as an anomaly even without manual deobfuscation.
Third: verify that inbound anti-phishing filters do not rely exclusively on static hashes or HTML title patterns. The 21 different titles and unique SHA-256 hashes per request render simple signature-based blocklists ineffective; detection must prioritize DOM structure, network behavior, and dynamic JavaScript analysis.
For researchers, the case confirms that "broken" samples — pages that fail to render or generate errors — deserve the same attention as functional ones. The scope error exposed the entire polymorphic mechanism that would have remained invisible in the 49 out of 50 working variants.
Questions and Answers
Is the 3.6% failure rate representative of the real victim population?
No. The 3.6% refers to ~56 samples collected by the analyst under controlled conditions (50 automated requests plus manual attempts). The source provides no data on the failure rate in the real victim population, which depends on undocumented factors such as geographic distribution, browser fingerprinting, or potential server-side targeting logic.
Why does the author rule out LLM use despite the Unit 42 proof-of-concept?
The SANS author argues that the observed transformations are "quite systematic" and that the recurring scope bug "fit quite nicely with a relatively simple random renaming and reordering mechanism which doesn't properly account for variable scope." An LLM system, in the author's assessment, would not have generated such a specific and repetitive programming error in the code structure.
Is the page's final payload technically sophisticated?
The source explicitly describes it as a "completely unremarkable credential-stealing page." The sophistication resides entirely in the delivery and obfuscation mechanism, not in the harvesting payload, which represents a standard form of credential collection without advanced distinguishing elements.
Information is based on the cited source and current as of publication.
Sources
- https://isc.sans.edu/diary/rss/33290
- https://www.akamai.com/blog/security/the-tale-of-double-javascript-obfuscated-scam
- https://unit42.paloaltonetworks.com/real-time-malicious-javascript-through-llms/
- https://link.springer.com/chapter/10.1007/978-3-642-02617-1_28
Get DeafLetter
A weekly selection of signals, vulnerabilities and guides. Critical alerts remain optional.
You can unsubscribe at any time. Privacy policy.