Never thought I would actually get to see it in action in real life like how it solved Huggingface's hack since security is taken pretty seriously around here. We use deepseek to can logs system wide to catch potential threats.
What happened was that one of our service was down on an open port and a dev server concidentally was spun up in its place unbeknownst to the dev. Couple of hours later we got a notice. This was real time detection. We later gave the same issue to Claude and was rejected 😂.
Big ups for the whale.
If you are curious we just nuked the dev node immediately and rotated all the dev keys, which was a bitch but what can you do. Always separate your envs people!!
1. Security Finding (Live on Host)
This is a local host compromise, not a chat application bug. An unexpected error notification surfaced the initial clue.
What triggered the alert: A 5,425-byte IIFE was appended to Vite files on disk (node_modules/vite/bin/vite.js, dist/node/cli.js, and dist/node/index.js). The implant identifies itself as _LILITH_VITE_V3 (VER=32, PERSIST=true) and was active in the running stack.
Implant behavior:
- Hooks emit on http, https, tls, net, and http2 servers in process.
- Reads an x-amzn-trace-context (Root=1-672e9988-<b64>) header and executes supplied code via Function("process","require","req","res", code), returning [GHOST_OK v3=True].
- Handles GET ...?__v=1 by returning V0_<base64 of {uid, cwd, env, f}>_E, dumping cwd, environment variables, and related fields.
- Alters writeHead and end so responses with status 400 or higher return status 200 with content-length removed, masking real 404 and 500 errors in the dev server.
- Returns 404 for requests matching file-read or code-execution probes, including / outside the working directory, __vite-browser-external, Function, child_process, process in the URL, %xx encoding, /.env, /.ssh/id_rsa, /.aws, /.npmrc, /etc/passwd, and /proc/self/.
2. Blast Radius & Root Cause
Affected files: 15 files across 5 directory trees (<APP_ROOT>, <APP_ROOT>-order, and <APP_ROOT>-wt/{<WORKTREE_1>,<WORKTREE_2>,<WORKTREE_3>} under frontend/node_modules/vite).
Unaffected areas: Backend node_modules, repository source files, and <AGENT_HOME> showed no matches.
Post-install tampering: The upstream registry archive (vite-7.3.6.tgz) is clean (2,574 / 26,755 / 3,630 bytes versus 7,999 / 32,181 / 9,056 bytes on disk), and package-lock.json integrity hashes match the registry. The files were modified on disk after installation rather than via a poisoned package or npm ci.
3. Secret Exposure & Cleanup
How it leaked: Vite's glob parser failed on the injected code and wrote the V0_..._E payload into <LOG_DIR>/frontend-hints.log.
Exposed secrets: The dump contained 132 environment variables with values, including API keys, cloud storage credentials, CDN tokens, and active session secrets.
Remediation: The log blob was replaced with [REDACTED-ENV-BLOB]. Only a truncated, non-decodable fragment remains in the local agent state database. All exposed credentials should be rotated immediately.