Area 01
Exposed secrets
Keys and credentials that end up where anyone can read them.
Why it shows up in AI-generated code
Assistants optimize for code that runs on the first try. Pasting a key inline is the fastest way to make a demo work — and that snippet often lands in a client component, a public environment variable or a committed config file.
What this area covers — examples
- API keys and tokens hard-coded in source files
- Secret keys exposed to the browser through client components or public env variables
- .env files and credentials committed to the repository
- Admin or service-role keys used where a public key belongs
CWE-798 · CWE-200 · CWE-312
import { createClient } from "@supabase/supabase-js"; export const supabase = createClient( process.env.NEXT_PUBLIC_SUPABASE_URL!, process.env.NEXT_PUBLIC_SUPABASE_SERVICE_ROLE_KEY!);