build-env-secret-triage

Validates whether environment-variable secrets in JavaScript bundles actually ship to the browser.

7|4|Updated Jun 22, 2026
One-click install
npx skills add https://github.com/dbx0/skills --skill build-env-secret-triage-dbx0
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: build-env-secret-triage
Source: https://github.com/dbx0/skills/tree/main/skills/methodology/triage/build-env-secret-triage
Command: npx skills add https://github.com/dbx0/skills --skill build-env-secret-triage-dbx0

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Grepping frontend JavaScript bundles for secret-looking variable names produces many false positives, because bundlers only inline environment variables that match a specific prefix. This Skill triages whether a matched assignment actually leaked a real value into the shipped bundle, and identifies systemic root causes across multiple hosts. ## Core Features & Use Cases - Bundler prefix rules: Applies the exposure rules for Next.js (NEXT_PUBLIC_), Vite (VITE_), Create React App (REACT_APP_), Nx, and Webpack to determine if a variable can reach the client bundle. - Literal-value confirmation: Verifies leaks by searching the compiled bundle for the actual secret literal rather than trusting declarations like process.env.SECRET. - Systemic root-cause analysis: Detects when a shared internal SDK mandates a config key, so one platform-level report replaces many duplicate single-host reports. - Use Case: After a source-map sweep surfaces process.env.API_SECRET across 30 apps, use this Skill to confirm which apps ship real values, then file one report describing the shared SDK defect with all affected hosts. ## Quick Start Triage whether the secret-looking environment variable assignments found in this JavaScript bundle actually leaked real values to the browser.

Frequently Asked Questions about build-env-secret-triage

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I check if an environment variable leaked into a JavaScript bundle?

Identify the bundler first, then check whether the variable name carries that bundler's client-exposure prefix such as NEXT_PUBLIC_, VITE_, or REACT_APP_. Finally, search the compiled bundle for the actual literal value, since a declaration alone proves nothing about what shipped.

How to find hardcoded secrets in frontend JavaScript bundles?

Grep the built bundle for secret patterns near variable names, or beautify the code and locate the assignment. Only a non-empty literal in the compiled output confirms a leak; variables without the bundler's exposure prefix typically compile to empty strings or undefined.

Does process.env expose secrets in Next.js or Vite apps?

Only variables prefixed with NEXT_PUBLIC_ in Next.js or VITE_ in Vite are inlined into the client bundle. All other process.env references evaluate to undefined in the browser, so a variable-name match without the prefix is usually a false positive.

Why is my secret finding a false positive after grepping a JS bundle?

The variable name likely lacks the bundler's client-exposure prefix, so it compiles to an empty string or undefined in the shipped bundle. Confirm by searching the built output for the literal value rather than relying on the declaration.

When should I file one report instead of many for leaked secrets?

File a single platform-level report when a shared internal SDK mandates the config key, forcing every app using it to supply a real value. List all affected hosts in that one report instead of filing duplicate single-host reports.