Back to Intelligence

Hugging Face Spaces Abused for Brand-Spoofing Phishing: Detection and Defense Guide

SA
Security Arsenal Team
November 27, 2026
11 min read

Researchers at Aikido have identified 42 social engineering pages hosted on Hugging Face Spaces, the AI community platform's app-hosting service — and roughly two-thirds of them were generated using Hugging Face's own AI site builder. The pages spoof major brands, leveraging the legitimacy of the hf.space and huggingface.co domains to bypass email filters, URL reputation engines, and user skepticism. If your organization permits outbound access to Hugging Face (and most do, given its developer popularity), your users are one crafted lure away from credential theft on a domain your stack almost certainly trusts.

This is not a vulnerability in Hugging Face's code. It is trusted-platform abuse — and it is part of a broader, accelerating trend in which phishers host malicious content on legitimate SaaS and PaaS infrastructure (GitHub Pages, Azure blob storage, Cloudflare Workers, Google Sites) precisely because defenders cannot block the parent domain without breaking business workflows. The defensive lesson here is concrete: you need granular detection on subdomain-level behavior, brand-spoofing analytics, and identity-layer controls that assume the lure page itself will look clean.

Technical Analysis

What Hugging Face Spaces Is — and Why Attackers Want It

Hugging Face Spaces lets anyone with a free account deploy interactive web apps (Gradio, Streamlit, Docker, or static HTML) under the *.hf.space domain. The platform's AI site builder lowers the bar further: a user describes the page they want, and the tool generates a working site. According to Aikido's findings, approximately two-thirds of the 42 malicious pages were produced with this builder — meaning the attacker no longer needs front-end skills to produce a pixel-perfect Microsoft 365, DocuSign, or banking login clone.

Why this infrastructure is attractive to phishers:

  • Domain reputation inheritance. hf.space resolves under Hugging Face's umbrella. Reputation engines, secure web gateways, and email URL detonation systems score the parent domain as a legitimate, high-traffic developer platform.
  • TLS by default. Pages serve over HTTPS with valid certificates, defeating the old "look for the padlock" user guidance and any control that treats certificate presence as a trust signal.
  • Free, fast, disposable. A space can be created, used for a 48-hour campaign, and abandoned before abuse teams respond. Takedown latency is the attacker's friend.
  • AI-generated fidelity. Site builders produce clean, professional markup — no typos, no broken CSS — which neutralizes both user heuristics and simple HTML-similarity filters tuned to sloppy kits.

Attack Chain (Defender's View)

  1. Lure delivery. Phishing email, SMS, malvertising, or QR code directs the victim to https://<space-name>.hf.space or a Hugging Face Spaces URL embedded behind a URL shortener or redirect chain.
  2. Brand spoof page. The space renders a cloned login portal (Microsoft 365, Google Workspace, financial institutions, shipping brands are typical targets in these campaigns).
  3. Credential capture. Entered credentials are POSTed to an attacker-controlled endpoint — frequently a Telegram bot API endpoint, a Discord webhook, or a third-party form service — or relayed through an adversary-in-the-middle (AiTM) flow to capture session cookies and bypass MFA.
  4. Account takeover. Harvested credentials or session tokens are used against the real identity provider, often within minutes.

Exploitation Status

This is confirmed in-the-wild abuse: 42 live social engineering pages were observed by Aikido on the platform. There is no CVE associated with this activity — no software flaw is being exploited. The "vulnerability" is architectural trust: allowlists, reputation scoring, and user training all treat established platforms as safe. That makes this a detection-engineering and identity-hardening problem, not a patching problem.

Detection & Response

The observables that matter are at the network edge (DNS, proxy, TLS SNI), the email gateway (URL rewriting/click telemetry), and the identity layer (impossible travel, token theft indicators). A blanket block of hf.space is a legitimate option for organizations with no developer dependency on Hugging Face; for those that do, the detections below target the malicious subset without breaking engineering workflows.

Sigma Rules

YAML
---
title: Outbound Connection to Hugging Face Spaces Hosting Domain
id: 3f8a1c72-6b9d-4e51-a2c4-9d7f2e5b8a01
status: experimental
description: Detects DNS queries or proxy requests to hf.space, the Hugging Face Spaces hosting domain abused in phishing campaigns spoofing major brands. Tune against legitimate developer usage or scope to non-developer segments.
references:
  - https://www.infosecurity-magazine.com/news/hugging-face-ai-builder-phishing/
  - https://attack.mitre.org/techniques/T1566/
author: Security Arsenal
date: 2026/04/06
tags:
  - attack.initial_access
  - attack.t1566.002
logsource:
  category: dns
  product: windows
detection:
  selection:
    QueryName|contains:
      - '.hf.space'
      - 'huggingface.co'
  filter_known_dev_hosts:
    ComputerName|contains:
      - '-DEV'
      - '-ENG'
  condition: selection and not filter_known_dev_hosts
falsepositives:
  - Data science and ML engineering staff legitimately browsing Hugging Face Spaces
  - CI/CD pipelines pulling models from huggingface.co
level: medium
---
title: Proxy Request to Hugging Face Space with Brand-Spoofing Indicators in Path
id: 8c2e5d14-4a7b-4f38-b196-3c1a9e6d7254
status: experimental
description: Detects web proxy requests to hf.space where the URI path or page title hints at credential phishing (login, verify, account, secure, signin, microsoft, office365, docusign). Hugging Face Spaces were observed hosting brand-spoof login pages.
references:
  - https://www.infosecurity-magazine.com/news/hugging-face-ai-builder-phishing/
  - https://attack.mitre.org/techniques/T1566/002/
author: Security Arsenal
date: 2026/04/06
tags:
  - attack.credential_access
  - attack.t1566
  - attack.t1539
logsource:
  category: proxy
detection:
  selection_domain:
    c-uri|contains: '.hf.space'
  selection_keywords:
    c-uri|contains:
      - 'login'
      - 'signin'
      - 'verify'
      - 'account'
      - 'secure'
      - 'office365'
      - 'microsoft'
      - 'docusign'
      - 'webmail'
      - 'password'
  condition: selection_domain and selection_keywords
falsepositives:
  - Legitimate Spaces demonstrating authentication integrations
  - Security researchers investigating reported pages
level: high
---
title: Browser Process Followed by Credential Entry After Hugging Face Space Visit
id: 5d7b9e03-2c4f-4a81-93e6-1f5c8b2d6473
status: experimental
description: Detects a browser making a network connection to hf.space infrastructure from a host with no prior Hugging Face usage baseline. Intended as a low-and-slow hunting rule for trusted-platform phishing; deploy as a hunting/analytic rule rather than a blocking control.
references:
  - https://www.infosecurity-magazine.com/news/hugging-face-ai-builder-phishing/
  - https://attack.mitre.org/techniques/T1566/002/
author: Security Arsenal
date: 2026/04/06
tags:
  - attack.initial_access
  - attack.t1566.002
logsource:
  category: network_connection
  product: windows
detection:
  selection_browser:
    Image|endswith:
      - '\chrome.exe'
      - '\msedge.exe'
      - '\firefox.exe'
      - '\brave.exe'
  selection_dest:
    DestinationHostname|endswith: '.hf.space'
  condition: selection_browser and selection_dest
falsepositives:
  - ML engineers and developers browsing Spaces demos
  - Marketing or research staff following shared links
level: low

KQL (Microsoft Sentinel / Defender)

This query correlates email URL click telemetry with network connections to hf.space, then pulls in sign-in anomalies for users who clicked — giving you a single hunt that moves from lure delivery through potential account compromise. It assumes Defender for Office 365 UrlClickEvents is available; if not, the DeviceNetworkEvents portion still stands alone.

KQL — Microsoft Sentinel / Defender
let lookback = 14d;
let hfClicks = UrlClickEvents
    | where TimeGenerated > ago(lookback)
    | where Url has_any ("hf.space", "huggingface.co/spaces")
    | summarize Clicks=count(), FirstClick=min(TimeGenerated), LastClick=max(TimeGenerated) by AccountUpn, Url, ActionType;
let hfConnections = DeviceNetworkEvents
    | where TimeGenerated > ago(lookback)
    | where RemoteUrl endswith ".hf.space" or RemoteUrl has "huggingface.co"
    | summarize Connections=count(), RemoteIPs=make_set(RemoteIP), FirstConn=min(TimeGenerated) by DeviceName, InitiatingProcessAccountUpn, RemoteUrl;
hfClicks
| join kind=leftouter hfConnections on $left.AccountUpn == $right.InitiatingProcessAccountUpn
| join kind=leftouter (
    SigninLogs
    | where TimeGenerated > ago(lookback)
    | where ResultType !in ("0")
    | summarize FailedSignins=count(), Locations=make_set(Location), IPs=make_set(IPAddress) by UserPrincipalName
    ) on $left.AccountUpn == $right.UserPrincipalName
| project AccountUpn, Url, Clicks, FirstClick, ActionType, DeviceName, Connections, RemoteIPs, FailedSignins, Locations, IPs
| order by FirstClick desc;

Velociraptor VQL

This artifact hunts endpoints for DNS cache entries and live connections referencing Hugging Face Spaces infrastructure, which is useful for scoping exposure after a reported lure — identify which hosts actually resolved or reached the phishing space before the takedown.

VQL — Velociraptor
-- Hunt for Hugging Face Spaces (hf.space) resolution and connections across endpoints
SELECT Fqdn,
       Pslist.Name AS ProcessName,
       Pslist.Pid AS Pid,
       Pslist.Username AS Username,
       netstat.RemoteAddr AS RemoteIP,
       netstat.RemotePort AS RemotePort,
       netstat.Status AS ConnStatus
FROM netstat()
LET Pslist = SELECT Pid, Name, Username FROM pslist()
WHERE netstat.RemoteAddr =~ '.'
  AND netstat.Family =~ 'TCP'
GROUP BY RemoteIP
VQL — Velociraptor
-- Simpler variant: enumerate DNS cache for hf.space resolutions
SELECT Name AS DnsEntry,
       Type AS RecordType,
       Data AS ResolvedValue
FROM Artifact.Windows.System.DNSCache()
WHERE DnsEntry =~ 'hf\.space|huggingface\.co'

Remediation / Exposure Assessment Script

Use this PowerShell script on endpoints (or at scale via your RMM/EDR) to quickly assess which machines have resolved Hugging Face Spaces domains recently — your scoping step after a phishing report — and optionally add a hosts-level sinkhole on high-risk, non-developer machines as an emergency stopgap while SWG policy is updated.

PowerShell
# hf.space phishing exposure assessment + optional emergency block
# Run elevated. Assess mode first; block only on hosts with no legitimate Hugging Face need.

param(
    [switch]$ApplyBlock
)

$domains = @('hf.space', 'huggingface.co')
$report  = @()

# --- Assess: DNS client cache ---
$dnsHits = Get-DnsClientCache -ErrorAction SilentlyContinue |
    Where-Object { $d = $_.Entry; $domains | Where-Object { $d -like "*$_*" } }

foreach ($hit in $dnsHits) {
    $report += [PSCustomObject]@{
        Source = 'DNSCache'
        Entry  = $hit.Entry
        Data   = $hit.Data
        Time   = (Get-Date)
    }
}

# --- Assess: active TCP connections to Hugging Face infrastructure ---
$conns = Get-NetTCPConnection -State Established -ErrorAction SilentlyContinue |
    Where-Object { $_.RemotePort -in 443,80 }
foreach ($c in $conns) {
    try {
        $rdns = (Resolve-DnsName -Name $c.RemoteAddress -ErrorAction Stop).NameHost
        if ($domains | Where-Object { $rdns -like "*$_*" }) {
            $proc = Get-Process -Id $c.OwningProcess -ErrorAction SilentlyContinue
            $report += [PSCustomObject]@{
                Source = 'ActiveConnection'
                Entry  = $rdns
                Data   = "$($c.RemoteAddress):$($c.RemotePort) [$($proc.ProcessName)]"
                Time   = (Get-Date)
            }
        }
    } catch { }
}

$report | Format-Table -AutoSize
$report | Export-Csv -Path "$env:TEMP\hf_space_exposure.csv" -NoTypeInformation
Write-Output "[+] Exposure report written to $env:TEMP\hf_space_exposure.csv"

# --- Optional emergency sinkhole (non-developer hosts only) ---
if ($ApplyBlock) {
    $hostsPath = "$env:SystemRoot\System32\drivers\etc\hosts"
    foreach ($d in $domains) {
        $line = "0.0.0.0 $d"
        if (-not (Select-String -Path $hostsPath -Pattern [regex]::Escape($d) -Quiet)) {
            Add-Content -Path $hostsPath -Value $line
            Write-Output "[+] Sinkholed $d in hosts file"
        }
    }
    Write-Output "[!] Remember: wildcard subdomains (*.hf.space) are NOT covered by hosts entries. Enforce blocking at your SWG/DNS layer."
}

Note the limitation called out in the script: hosts-file entries cannot wildcard-match subdomains. Real enforcement must happen at your DNS resolver (RPZ), secure web gateway, or EDR network protection layer.

Remediation

There is no patch — the fix is policy, detection, and identity hardening. Prioritize in this order:

1. Categorize and control the domain (today).

  • In your secure web gateway / DNS filter, verify how hf.space and huggingface.co are categorized. If your org has no ML development function, block *.hf.space outright — that is the hosting surface, and it is distinct from the model hub content most proxies actually need to permit. If you do have ML engineers, scope access by group or require explicit exceptions.
  • Enable SSL inspection for newly-seen or uncategorized domains so path-level and content-level detections (like the proxy Sigma rule above) actually function.

2. Tighten email and collaboration-channel controls for platform-hosted URLs.

  • Add hf.space (and peer abuse-prone platforms: workers.dev, web.app, github.io, azurewebsites.net, glitch.me, netlify.app, vercel.app) to your email gateway's URL-rewrite and click-time protection policy. Reputation-based verdicts will fail here; click-time sandboxing and "newly observed sender + platform URL" heuristics are what catch these.
  • Alert on first-seen URLs from these domains in inbound mail. Legitimate vendors do not send your employees login links hosted on Hugging Face Spaces.

3. Deploy the detections above and baseline developer usage.

  • Stand up the DNS/proxy rules, but baseline first: identify your data science and engineering population and scope alerting to everyone else. An un-tuned rule against huggingface.co in an AI-heavy enterprise will be disabled within a week.

4. Harden the identity layer — assume the phish works.

  • Phishing-resistant MFA (FIDO2/passkeys) is the single highest-leverage control here. Site-builder phishing pages that capture passwords are neutered entirely; AiTM variants that relay sessions are largely defeated by hardware-bound credentials.
  • Enforce Conditional Access with device compliance and token protection where your IdP supports it, so stolen session cookies have reduced replay value.
  • Alert on impossible travel, anomalous ASN sign-ins, and new inbox forwarding rules for any user observed clicking an hf.space lure.

5. Report and takedown.

  • Report malicious Spaces to Hugging Face at https://huggingface.co/report (or abuse@huggingface.co). Include the full space URL and screenshots. Takedowns on this platform are generally responsive, and every report improves the abuse signals available to the broader community.
  • File the spoofed brand's abuse channel in parallel — brand owners often have faster takedown relationships with hosting platforms.

6. Update user awareness with the right lesson.

  • Retire "check the domain" as primary advice in the form most programs teach it. The correct modern guidance: a padlock and a well-known company name in the URL prove nothing; navigate to sensitive portals via bookmarks or your password manager, never via message links. Password managers that refuse to autofill on *.hf.space are doing real detection work for you.

Related Resources

Security Arsenal Penetration Testing Services AlertMonitor Platform Book a SOC Assessment vulnerability-management Intel Hub

Is your security operations ready?

Get a free SOC assessment or see how AlertMonitor cuts through alert noise with automated triage.