- Home
- Skills
- Frontend & Web Apps
- React Frontend Safety Check
More screenshots
Works with the AI Agents you already use
React Frontend Safety Check
One dangerouslySetInnerHTML with a post body, or one VITE_OPENAI_API_KEY in the bundle, is enough for an attacker to take over accounts or spend your API credit.
$5
React Frontend Safety Check
Example session with this skill installed
Check this project with react-frontend-safety-check.
- Read your context and instructions
- Compiled the react frontend safety
$ python3 scripts/check_react.py examples/risky
BLOCK .env.production:2 R03 SECRET_IN_BROWSER_BUNDLE
VITE_STRIPE_SECRET_KEY=<redacted>
Why: A secret is built into the browser bundle: a VITE_, REACT_APP_, NEXT_PUBLIC_ or EXPO_PUBLIC_ variable with a secret name (secret, private, password, service role, OpenAI or another API secret), a secret Stripe key in the code, or an AI SDK with dangerouslyAllowBrowser. Anyone who opens the site can read everything in the bundle.
Safer: Keep secrets on a server (an API route or edge function) that the app calls, use only publishable or anon keys in the browser, and rotate the exposed secret.
BLOCK src/components/Assistant.jsx:5 R03 SECRET_IN_BROWSER_BUNDLE
BLOCK src/components/Assistant.jsx:6 R03 SECRET_IN_BROWSER_BUNDLE
BLOCK src/components/Assistant.jsx:22 R04 EVAL_IN_BROWSER
BLOCK src/pages/Login.jsx:10 R02 REDIRECT_FROM_URL
BLOCK src/pages/Post.jsx:16 R01 UNSANITIZED_HTML
REVIEW src/components/Assistant.jsx:13 R12 HTML_SINK_OUTSIDE_REACT
REVIEW src/components/Assistant.jsx:14 R13 POSTMESSAGE_TO_ANY_ORIGIN
REVIEW src/components/Assistant.jsx:15 R14 MESSAGE_LISTENER_WITHOUT_ORIGIN_CHECK
REVIEW src/pages/Login.jsx:18 R16 URL_FROM_QUERY_IN_LINK
REVIEW src/pages/Post.jsx:10 R11 TOKEN_IN_BROWSER_STORAGE
REVIEW vite.config.js:6 R15 SOURCE_MAPS_PUBLISHED
(Each finding also has Why and Safer lines, as in the first one.)
Verdict: BLOCK. Checked 5 files, 5 with React front end content.
This is a static check of file text. NOT FLAGGED is not a guarantee.
Connects securely to your tools. The creator never sees your data.
About this skill
One dangerouslySetInnerHTML with a post body, or one VITE_OPENAI_API_KEY in the bundle, is enough for an attacker to take over accounts or spend your API credit. This skill finds those and eight other React front-end mistakes before you ship, and tells you how to fix each one.
Your agent runs a scanner on your JSX and TSX components, React code in .js and .ts files, the app's .env files and your Vite, webpack and Next.js config. It skips comments, knows fixed strings from values, follows values read from the URL (useSearchParams, location.search, router.query) through your variables, and accepts the usual guards (DOMPurify.sanitize, a relative-path or origin check). Test files are skipped. It never builds or runs the app. It returns BLOCK, REVIEW, or NOT FLAGGED, with the file, line, reason, and a safer approach. Secrets are never printed.
What it checks
BLOCK
- R01: dangerouslySetInnerHTML with HTML that is not sanitized
- R02: redirects to a value read from the URL
- R03: secrets in VITE_, REACT_APP_, NEXT_PUBLIC_ or EXPO_PUBLIC_ variables, secret Stripe keys, or AI SDKs in the browser
- R04: eval() or new Function() on values
REVIEW
- R11: tokens in localStorage or sessionStorage
- R12: innerHTML, insertAdjacentHTML or document.write with values
- R13: postMessage to any origin
- R14: message listeners without an origin check
- R15: source maps published in production builds
- R16: links and iframes built from URL values
What's included
- The scanner (Python 3.9+, standard library only)
- A rules guide with the reason and safer approach for each rule
- A risky and a safe example React app, and the real report the scanner produces on the risky one
Limits It reads each file on its own: values passed between components as props, checks inside helpers in other files, server-side code, npm dependencies and Content Security Policy headers are not checked. NOT FLAGGED is not a guarantee.
Static check of JavaScript, TypeScript, .env and config text. Props across components and npm dependencies are not checked. NOT FLAGGED is not a guarantee.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before any payment.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 5 days ago
Permissions
Runs one local Python script in the terminal. It reads your project's files, writes nothing, and makes no network calls. The example app includes clearly fake, inert keys (notarealkey...) for the scanner to find. It is never run.