Skip to content
PATCH

Exposed secrets, .env files or source maps

Learned from Lighter Perps · Crypto · 2026-11-16 · Source

In plain words

Keys left in a website's public files can be taken by anyone who looks.

Spec

SIG 0x5D4C12AB-04
antibody
Exposed secrets, .env files or source maps
learned
Lighter · leaked trader API key · 2026-11-16 · theblock.co
weakness
API keys or private files are readable by anyone on the project website.
reads
/.env, /.env.local, /.env.production, /.git/config, /.git/HEAD (first 4 KB, discarded) · secret patterns in the site's own JavaScript bundles · source map availability
match
a file returns KEY=value content or git config · a live secret pattern (Stripe, OpenAI, Anthropic, AWS, Supabase service key) in public JS · a public source map
not a hit
HTML error pages served at those paths (soft 404s) · public, browser-safe keys such as a Supabase anon key (checked separately, read-only)
severity
exposed .env or live secret CRITICAL · .git HIGH · source maps MEDIUM
fix
Remove the file or key from the public site now.

01

The attack it came from

Lighter · leaked trader API key, 2026-11-16, about ~$15.5M lost. A trader's leaked API key was used to withdraw funds. Lighter did not disclose a total; on-chain trackers estimated about $15.5M. About $5M in USDC was returned.

Open in the attack feed →

02

For engineers

Reads: /.env, /.env.local, /.env.production, /.git/config, /.git/HEAD (first 4 KB, discarded) · secret patterns in the site's own JavaScript bundles · source map availability.

Match: a file returns KEY=value content or git config · a live secret pattern (Stripe, OpenAI, Anthropic, AWS, Supabase service key) in public JS · a public source map.

Not a hit: HTML error pages served at those paths (soft 404s) · public, browser-safe keys such as a Supabase anon key (checked separately, read-only).

Severity: exposed .env or live secret CRITICAL · .git HIGH · source maps MEDIUM.

Requests files a visitor would not load, so it only runs when the project's owner asks.

03

Known false positives

Soft-404 HTML pages are excluded by content checks. Test keys may match a pattern; the report shows a masked prefix so the owner can tell.

04

Census result

Not run in the census: owner-requested checks only.

05

What a team should do

  1. 01Remove the file or key from the public site now.
  2. 02Rotate every exposed key: deleting it is not enough.
  3. 03Move secrets to server-only environment variables.

PATCH recommends the fix. The team applies it. Nothing is changed for them.

06

What this antibody can't detect

Secrets in private repos, servers or laptops.