Updated Dec 2, 2026

Static Code Analysis

Scan client-side JS for leaked API keys and JWTs

secretfinder is an open-source Python tool, built on LinkFinder, that discovers sensitive data in JavaScript files such as API keys, access tokens, authorization headers, and JWTs, using jsbeautifier together with targeted regular expressions.

installgit clone https://github.com/m4ll0k/SecretFinder.git secretfindercd secretfinder && pip install -r requirements.txtdocker pull quay.io/trickest/secretfinder:a0283cb

commit a0283cb on Trickest · Python · GPL-3.0 license

Free plan: 1 user, 3 execution slots, no card.

overview

What secretfinder does

SecretFinder scans JavaScript for sensitive data left in client-side code: API keys, access tokens, authorization values, JWTs, and similar credentials. It beautifies scripts with jsbeautifier, then matches a large regular expression set.

Pass -i a URL, file, or folder. -e extracts every JavaScript link on a page and processes each one. -c and -H reach authenticated scripts, -r filters endpoints, and -b reads Burp-exported captures offline.

Run it after a crawler harvests JS when the secrets you care about live in browser-served scripts. For Git history leaks use gitleaks; for vulnerable library versions use Retire.js.

source github.com/m4ll0k/SecretFinder · commit a0283cb on Trickest

image quay.io/trickest/secretfinder:a0283cb

use cases

secretfinder use cases

Pull secrets out of client-side JS

Scan an app's JavaScript for API keys, tokens, JWTs, and authorization values that were shipped to the browser by mistake.

Extract and process every JS link

Point -e at a page so SecretFinder finds each JavaScript link and runs the secret scan on every one, instead of a single script at a time.

Reach authenticated scripts

Pass cookies with -c and headers with -H so scripts that only load for a logged-in session are fetched and scanned for secrets.

Review Burp-captured traffic

Feed a Burp-exported file with -b so JavaScript captured during a proxied session is scanned offline for leaked credentials.

reference

secretfinder inputs and flags

11 inputs
NameTypeFlagDescription
input-stringSTRING-iInput a URL to scan.
input-fileFILE-iInput a file to scan.
input-folderFOLDER-iInput a folder of JavaScript to scan.
extract-all-js-linksBOOLEAN-eExtract all JavaScript links on a page and process them.
cookieSTRING-cAdd cookies for authenticated JS files.
headersSTRING-HSet headers ("Name:Value\nName:Value").
filtering-regexSTRING-rRegEx to filter found endpoints (e.g. ^/api/).
support-burp-exported-fileBOOLEAN-bSupport a Burp-exported file as input.

Showing key inputs. secretfinder exposes 11 inputs in total.

Full flag reference (11 inputs)
NameTypeFlagDescription
proxySTRING-pSet proxy (host:port).
cookieSTRING-cAdd cookies for authenticated JS files.
headersSTRING-HSet headers ("Name:Value\nName:Value").
input-fileFILE-iInput a file to scan.
input-folderFOLDER-iInput a folder to scan.
input-stringSTRING-iInput a URL to scan.
filtering-regexSTRING-rRegEx for filtering purposes against found endpoints (e.g. ^/api/).
only-process-thisSTRING-nProcess a JS URL only if it contains the provided string (string;string2..).
ignore-if-containsSTRING-gIgnore a JS URL if it contains the provided string (string;string2..).
extract-all-js-linksBOOLEAN-eExtract all JavaScript links located in a page and process them.
support-burp-exported-fileBOOLEAN-bSupport a Burp-exported file as input.

example

secretfinder command examples

secretfinder · command
# run on 2026-12-02 against https://trickest.io, Trickest's own app, in quay.io/trickest/secretfinder:a0283cb
python3 SecretFinder.py -i https://trickest.io/ -e -o cli   # 59 JS files, 165 matches, all false positives; 4 shown, 17 s
Run on Dec 2, 2026 against Trickest-owned hosts
[ + ] URL: https://trickest.io/_next/static/chunks/1--b8b2xsi6zc.js
twilio_account_sid	->	actSourcePageFromFlightRouterState
[ + ] URL: https://trickest.io/_next/static/chunks/14j3y0hx9udll.js
authorization_api	->	API_ERROR
[ + ] URL: https://trickest.io/_next/static/chunks/1mg0rkgc3wen1.js
Heroku API KEY	->	6ba7b810-9dad-11d1-80b4-00c04fd430c8
[ + ] URL: https://trickest.io/_next/static/chunks/02_f_ashrd5to.js
Heroku API KEY	->	00000000-0000-0000-0000-000000000000

guidance

secretfinder vs alternatives

Reach for SecretFinder when the secrets you care about live in JavaScript served to the browser. For secrets across Git history use gitleaks; for vulnerable JS library versions rather than leaked keys, Retire.js fits better.

ToolPick it when
linkfinderBase project SecretFinder extends; focused on extracting endpoints from JS.
rexRuns custom regex rules across a directory or repository rather than JS specifically.
retire-jsFinds vulnerable JavaScript library versions instead of leaked secrets in JS.

faq

secretfinder FAQ

Sensitive data left in client-side code: API keys, access tokens, authorization headers, JWTs, and similar credentials, each matched by a named regular expression after jsbeautifier runs.

Point -i at the page URL and add -e so SecretFinder extracts each JavaScript link and scans every one. Narrow with -n to process only URLs containing a string, or -g to ignore URLs that contain one.

No. It reads JavaScript via a URL, file, or folder, not commit history. Use gitleaks or similar for repository history; use SecretFinder for the live JS surface.

Supply cookies with -c and headers with -H so scripts that load only for a logged-in session are fetched. Combine with -e to walk every JavaScript link behind that session.

Yes. Pass -b with a Burp-exported file so JavaScript captured during a proxied session is scanned offline.

SecretFinder hunts leaked credentials inside JS source. Retire.js flags known-vulnerable library versions. Use both when you need secrets and dependency risk.

Its patterns are regular expressions with no context. On a minified Next.js bundle, twilio_account_sid matches identifiers such as actSourcePageFromFlightRouterState, and the Heroku API key pattern matches any UUID, including the RFC 4122 namespace 6ba7b810-9dad-11d1-80b4-00c04fd430c8. Our 2026-12-02 run on trickest.io returned 165 matches across 59 files, none of them a secret. Use -r to keep one pattern, or verify each hit before you report it.

The Trickest SecretFinder node runs commit a0283cb (June 2021) in the image quay.io/trickest/secretfinder:a0283cb. SecretFinder publishes no releases; the repository's last commit is from May 2024.

Run secretfinder yourself

A set of JavaScript URLs feeds SecretFinder, which beautifies and regex-scans each one and writes any leaked secrets as a queryable output.

Facts on this page come from the live Trickest tool library.