You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
security/leaked-secrets: browser SDK/widget keys (analytics, RUM, chat widgets, embed data-*-key, RevenueCat public) reported as leaks; need a public-client allowlist #1294
Client keys that vendors design to ship in the browser are reported as leaked secrets. From hand verification of 263 Generic API Key Assignment and misc flags, plus the generic-secret lane, in a ~38k-site batch (v0.0.141):
Most are recognisable by the SDK call or the embed attribute next to them, not by the value.
Acceptance Criteria
A maintained public-client-key allowlist keyed on SDK call or attribute context classes these as public-by-design, not reported: Bugsnag and Amplitude (only when the SDK call is the immediately enclosing call or object), RevenueCat public prefixes (within 200 characters of the SDK name), third-party widget data-*-api-key embed attributes, Mapbox pk., and the families that were already public (Segment, PostHog, Sentry DSN, Stripe pk_, Intercom). Datadog RUM, Rollbar, Crisp and Tawk are deliberately not claimed (documented). A fixture per family. (amended 2026-11-01)
A secret-prefixed value (sk_live_, rk_live_, sb_secret_, AWS secret) is still reported even inside a widget attribute (fixture).
The rule docs list the allowlisted families.
A value under a NEXT_PUBLIC_, VITE_ or PUBLIC_ key, or a key named public*/publishable*/client*Key, gets a hint and keeps its confidence tier (medium); it is not classed public-by-design, because a variable with a public-looking name can still hold a secret. A value with a secret prefix (sk_, rk_, sb_secret_) is still reported (fixtures both ways). (amended 2026-11-01)
An AKIA… ID with no 40-character secret-shaped value within 300 characters reports at medium (with the pair hint), not high and not info (fixture); an ID beside its secret still reports high and the secret reports critical (fixture). The report text names the 300-character window and the other-file blind spot. (amended 2026-11-01)
Two more public-client signals from the hand-verified generic API key lane (v0.0.141, ~38k sites):
The key name says it's public (5 flags / 5 sites): NEXT_PUBLIC_*, VITE_*/PUBLIC_* build-time prefixes, public_api_key, publishableKey, clientSideApiKey. Frameworks only inline these prefixes into client bundles because they're meant to be public.
Publishable prefixes outside Stripe (10 / 9): pub_, pubk_ and similar under an apiKey key.
An AWS access key ID with no secret nearby (1 / 1, as an affiliate URL parameter): the ID alone can't sign a request. Downgrade it when no secretAccessKey/40-char secret sits within a few hundred characters.
A value under a NEXT_PUBLIC_, VITE_ or PUBLIC_ key, or a key named public*/publishable*/client*Key, is classed public-by-design unless the value has a secret prefix (sk_, rk_, sb_secret_) (fixtures both ways).
An AKIA… ID with no secret within 300 characters reports as info, not high (fixture); an ID + secret pair still reports critical (fixture).
Amended the acceptance criteria to the shipped behaviour. Public-client-key families: Bugsnag and Amplitude (immediately enclosing SDK call only), RevenueCat public prefixes within 200 characters of the SDK name, third-party widget data-*-api-key attributes; Segment, PostHog, Sentry DSN, Mapbox pk., Stripe pk_ and Intercom were already public; Datadog RUM, Rollbar, Crisp and Tawk are deliberately not claimed. A public-looking variable name (NEXT_PUBLIC_, public*, client*Key) adds only a hint and keeps the medium tier. An AWS key id with no 40-character secret-shaped value within 300 characters moves from high to medium, not info; an id beside its secret stays high.
Activity
nc9 commentedon Oct 30, 2026
Two more public-client signals from the hand-verified generic API key lane (v0.0.141, ~38k sites):
The key name says it's public (5 flags / 5 sites):
NEXT_PUBLIC_*,VITE_*/PUBLIC_*build-time prefixes,public_api_key,publishableKey,clientSideApiKey. Frameworks only inline these prefixes into client bundles because they're meant to be public.Publishable prefixes outside Stripe (10 / 9):
pub_,pubk_and similar under anapiKeykey.An AWS access key ID with no secret nearby (1 / 1, as an affiliate URL parameter): the ID alone can't sign a request. Downgrade it when no
secretAccessKey/40-char secret sits within a few hundred characters.A value under a
NEXT_PUBLIC_,VITE_orPUBLIC_key, or a key namedpublic*/publishable*/client*Key, is classed public-by-design unless the value has a secret prefix (sk_,rk_,sb_secret_) (fixtures both ways).An
AKIA…ID with no secret within 300 characters reports as info, not high (fixture); an ID + secret pair still reports critical (fixture).fix(rules): leaked-secrets classifies signed-URL JWTs and browser SDK…
fix(rules): public-client classification needs the enclosing SDK call…
fix(rules): leaked-secrets classifies signed-URL JWTs and browser SDK…
fix(rules): leaked-secrets classifies signed-URL JWTs and browser SDK…
nc9 commentedon Nov 1, 2026
Amended the acceptance criteria to the shipped behaviour. Public-client-key families: Bugsnag and Amplitude (immediately enclosing SDK call only), RevenueCat public prefixes within 200 characters of the SDK name, third-party widget
data-*-api-keyattributes; Segment, PostHog, Sentry DSN, Mapboxpk., Stripepk_and Intercom were already public; Datadog RUM, Rollbar, Crisp and Tawk are deliberately not claimed. A public-looking variable name (NEXT_PUBLIC_,public*,client*Key) adds only a hint and keeps the medium tier. An AWS key id with no 40-character secret-shaped value within 300 characters moves from high to medium, not info; an id beside its secret stays high.nik
fix(rules): leaked-secrets classifies signed-URL JWTs and browser SDK…
fix(rules): leaked-secrets classifies signed-URL JWTs and browser SDK…
fix(rules): leaked-secrets classifies signed-URL JWTs and browser SDK…
fix(rules): leaked-secrets classifies signed-URL JWTs and browser SDK…
fix(rules): leaked-secrets classifies signed-URL JWTs and browser SDK…
fix(rules): leaked-secrets classifies signed-URL JWTs and browser SDK…
fix(rules): leaked-secrets classifies signed-URL JWTs and browser SDK…
nc9 commentedon Nov 1, 2026
Shipped in v0.0.158 and checked against it: every acceptance criterion is met, with the amended text (allowlist families as built, public-looking names add a hint and keep medium, an AWS id with no secret within 300 characters reports at medium with the pair hint, an id beside its secret stays high). Release: https://github.com/squirrelscan/squirrelscan/releases/tag/v0.0.158
nik