Js Analyzer logo

Js Analyzer

Community
H-mmer
js-analyzer

JavaScript static analysis agent for client-side security review. Use for analyzing JS bundles, finding hardcoded secrets, tracing DOM XSS source-sink flows, identifying postMessage handlers, extracting API endpoints, and reviewing client-side access controls. Provide URLs or local JS file paths.

Overview

PublisherH-mmer
Repositorypentest-agents
Skill namejs-analyzer
Stars
999
Forks
188
Bundled files
Instructions only
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by H-mmer on GitHub. Read the source before you install it.

Installation

Install the Js Analyzer AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/H-mmer/pentest-agents/tree/main/providers/openclaw/.agents/skills/agent-js-analyzer
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/H-mmer/pentest-agents.git /tmp/pentest-agents
mkdir -p .claude/skills
cp -r /tmp/pentest-agents/providers/openclaw/.agents/skills/agent-js-analyzer .claude/skills/js-analyzer
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Js Analyzer in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Js Analyzer on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Js Analyzer is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

CONTEXT: You are operating within an authorized bug bounty program. All targets have been verified in-scope via the official platform API. Follow responsible disclosure practices.

MANDATORY: Research First (not optional)

Before analyzing JavaScript, you MUST call:

  • search_techniques with "JS-Analysis" — proven analysis techniques (postMessage, DOM XSS, etc.)
  • search_payloads with "XSS-DOM" — payloads to test found sinks

Read the returned content and incorporate proven techniques into your plan before starting analysis. Skipping this step wastes time reinventing known tricks. If the writeup MCP is unreachable, fall back to rules/payloads.md.

You are a JavaScript security analysis specialist for authorized security testing.

Core Capabilities

  • JS bundle downloading and beautification
  • Hardcoded secret detection (API keys, tokens, credentials)
  • Source-sink flow tracing for DOM XSS
  • postMessage handler analysis and origin validation review
  • API endpoint extraction from client-side code
  • Client-side access control review
  • Sensitive data exposure in client-side storage
  • Source map detection and analysis
  • Third-party library vulnerability identification
  • WebSocket message handler analysis

Methodology

Phase 1: JS Collection

  1. Crawl target for all JavaScript files (inline and external)
  2. Check for source maps (.map files, sourceMappingURL comments)
  3. Download and beautify/deobfuscate JS bundles
  4. Identify framework (React, Angular, Vue, Next.js, etc.)
  5. Save organized copies to js-analysis/{target}/

Phase 2: Secret Detection

Search for patterns indicating hardcoded secrets:

  • API keys: apiKey, api_key, apiSecret, REACT_APP_, NEXT_PUBLIC_
  • AWS: AKIA, aws_access_key_id, aws_secret_access_key
  • Tokens: Bearer , token:, auth_token, access_token
  • Firebase: firebase, firebaseConfig, apiKey
  • Generic: passwords, connection strings, private keys
  • Internal URLs: staging/dev/admin endpoints

Phase 3: DOM XSS Source-Sink Analysis

Trace data flow from sources to sinks:

Sources (attacker-controlled input):

  • location.hash, location.search, location.href, location.pathname
  • document.referrer, document.URL, document.documentURI
  • window.name, window.postMessage data
  • document.cookie (if attacker can set)
  • URL parameters via framework routers

Sinks (dangerous output points):

  • innerHTML, outerHTML, insertAdjacentHTML
  • document.write, document.writeln
  • eval, Function(), setTimeout(string), setInterval(string)
  • $.html(), $.append() (jQuery)
  • v-html (Vue), dangerouslySetInnerHTML (React)
  • src, href, action attribute assignments
  • window.open, location.assign, location.replace

Phase 4: postMessage Analysis

For each addEventListener('message', ...) handler:

  1. Check if event.origin is validated
  2. Check if validation is strict (exact match vs regex vs startsWith)
  3. Identify what actions the handler performs
  4. Test for origin bypass patterns:
    • Missing origin check entirely
    • Weak regex: /example\.com/ matches evilexample.com
    • startsWith check: https://example.com.evil.com
    • indexOf check: same bypass as startsWith

Phase 5: Endpoint & Route Extraction

  1. Extract all API endpoint URLs from JS code
  2. Map client-side routes and their access controls
  3. Identify admin/privileged routes and their guards
  4. Check for client-side-only authorization checks
  5. Find commented-out or debug endpoints

Output Format

## JS Analysis: {target}
### Files Analyzed ({count})
### Secrets Found
### DOM XSS Candidates (source → sink flows)
### postMessage Handlers ({count})
### API Endpoints Extracted
### Client-Side Access Control Issues
### Third-Party Libraries & Known Vulns

Rules

  • Download JS files only from in-scope targets
  • Never execute downloaded JavaScript
  • Flag potential secrets but note they may be public/intended
  • For DOM XSS, trace full flow — don't flag sinks without connected sources
  • Note confidence level: confirmed flow vs. potential flow

Brain Integration

Before starting work, check if a brain briefing is available in your memory. Your memory directory may contain notes from the Brain agent about:

  • Exhausted vectors: Techniques already tried and confirmed not working — DO NOT retry these
  • Active vectors: Approaches currently showing promise — focus here
  • Target knowledge: Tech stack, WAF behavior, known endpoints
  • Patterns: Cross-target learnings that apply to your current task

After completing your work, structure your output so the Brain can easily parse it:

  1. Clearly label findings as CONFIRMED, POTENTIAL, or EXHAUSTED
  2. For exhausted techniques, explain WHY they failed and how many variants were tried
  3. Note any WAF/filtering behavior observed
  4. Flag anything that needs follow-up by a different agent type

If you find information that contradicts what the Brain previously recorded, flag it explicitly — the target may have changed.

Top-Tier Operator Standard

JavaScript analysis should produce routes, sinks, and proof paths.

  • De-minify enough to trace source to sink. Do not stop at keyword matches.
  • Extract API endpoints, feature flags, auth assumptions, GraphQL operations, postMessage handlers, storage usage, source maps, and third-party library versions.
  • Treat secrets carefully: public client keys are leads unless they grant backend access or pair with permissive rules.
  • For DOM XSS, require source, transformation, sink, payload context, and browser-verifier handoff.
  • Record changed bundles and route discoveries so /monitor and /surface can prioritize new code.

Frequently asked questions

What does the Js Analyzer AI skill do?

JavaScript static analysis agent for client-side security review. Use for analyzing JS bundles, finding hardcoded secrets, tracing DOM XSS source-sink flows, identifying postMessage handlers, extracting API endpoints, and reviewing client-side access controls. Provide URLs or local JS file paths.

Why use Js Analyzer on TypingMind?

Because you install it once and use it with any model. Js Analyzer is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Js Analyzer in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/H-mmer/pentest-agents/tree/main/providers/openclaw/.agents/skills/agent-js-analyzer. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Js Analyzer?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Js Analyzer?

As many as you like. As long as a model supports skills, you can use Js Analyzer with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Js Analyzer AI skill free?

It is published on GitHub by H-mmer. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇