js-secrets-extraction

Extract hardcoded secrets, API keys, and internal endpoints from JavaScript bundles and source maps.

6|Updated Jan 31, 2026
One-click install
npx skills add https://github.com/Wyl-cmd/kxns-cli --skill js-secrets-extraction-wyl-cmd
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: js-secrets-extraction
Source: https://github.com/Wyl-cmd/kxns-cli/tree/main/src/kxns_cli/skills/js-secrets-extraction
Command: npx skills add https://github.com/Wyl-cmd/kxns-cli --skill js-secrets-extraction-wyl-cmd

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires requests, and includes scripts (resource) components.

What problem does it solve? Modern web applications ship JavaScript bundles that frequently leak hardcoded API keys, JWTs, Firebase/Supabase configurations, and internal backend URLs. Manually reviewing megabytes of minified code is impractical, so this Skill automates the detection of exposed credentials and hidden endpoints during authorized penetration tests and security assessments. ## Core Features & Use Cases - Automated Secret Scanning: Scan a target URL or local JS file against 13 regex patterns covering AWS keys, Google API keys, JWTs, Stripe tokens, Slack tokens, internal IPs, and more. - Source Map Reconstruction: Detect and exploit exposed .js.map files to recover original pre-minification source code for deeper credential analysis. - Backend URL Discovery: Extract production backend URLs (Fly.io, Azure, Render, Supabase) that bypass CDN/WAF protections. - Use Case: During a web app pentest, you find an admin portal on port 8080 serving a 1.15MB bundle with an exposed source map. Run the scanner to recover 1,200+ source files, revealing the internal API backend and authentication service endpoints. ## Quick Start Scan https://target.com for exposed secrets in its JavaScript bundles using the js-secrets-extraction skill.

Frequently Asked Questions about js-secrets-extraction

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

FAQPage Schema
How do I find API keys in JavaScript bundles?

Download the JS bundles referenced in the page HTML, then grep them with regex patterns for known key formats like AWS AKIA keys, Google AIza keys, JWTs, and Stripe tokens. The included scan_js.py script automates this by fetching a URL, extracting all JS bundle links, and scanning each against 13 secret patterns.

How to extract source code from a .js.map source map file?

Fetch the .js.map file, parse its JSON, and write each entry in the sourcesContent array to a file named from the corresponding sources entry. This recovers the original pre-minification source, which often contains credentials and internal API paths removed from the minified output.

Does JavaScript secret scanning work on minified bundles?

Yes, regex pattern matching works directly on minified bundles since secrets retain their literal values regardless of minification. However, source maps provide better context by revealing variable names and surrounding code, making false positive validation easier.

Why does JS secret scanning produce false positives?

Generic patterns like 'secret' or 'token' match placeholder strings, example values, and public identifiers such as Vercel dpl_ deployment IDs. Validate each candidate by testing it against the corresponding API endpoint, such as calling the Firebase identity toolkit with a suspected API key.

What are the limitations of scanning JavaScript for secrets?

Large bundles slow down naive scanning, rate limiting can interrupt bulk downloads, and server-side-only secrets never appear in client code. The scanner caps downloads at 15 bundles per page and works best combined with source map analysis and Wayback Machine historical JS files.