Files
NeuroSploit/agents_md/vulns/js_source_deep_analysis.md
T
Joas A SantosandClaude Opus 5 68c1f5d879 feat(skills): add routing frontmatter so the exploration loop can run
No shipped agent had frontmatter. Not five, as a `grep '^---'` suggests —
that matches horizontal rules in the body. Zero files begin with it.

That made the exploration loop dead code. `route` scores a skill as
10*(trigger hits) + 0.5*priority + 25 per chain edge from a finding, and
its no-metadata fallback is gated on `round == 0`. The loop starts at
`round = 1`. So every skill scored 0.0, was dropped by the `score > 0.0`
filter, `next_round` returned empty, and the loop hit `break` on its first
iteration — every run, in all six modes.

Add frontmatter to 91 core skills: 207 chain edges across injection, file
access, SSRF and cloud, auth and access control, client-side,
deserialisation, CMS, infra and LLM. Priority is >= 10 throughout, the floor
at which a single trigger hit clears the score >= 15 gate that `next_round`
applies past the first round.

Chains encode the escalation paths the harness is meant to walk on its own:
ssrf to cloud metadata to IAM privesc, sqli to postgres RCE, file_upload to
command_injection, sourcemap_exposure to js analysis to api_key_exposure,
jwt_manipulation to alg confusion to privilege_escalation.

Four tests, three of them against the shipped catalogue on disk: that it
routes at round 1, that a confirmed ssrf finding pulls cloud_metadata_exposure
in by chain, that no chain edge names a skill that does not exist, and a
regression pair pinning the round-1 behaviour that was broken.

439 skills still carry no frontmatter and reach only the round-0 sweep.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-12-04 11:17:08 -03:00

3.1 KiB

triggers, chains, priority, max_rounds
triggers chains priority max_rounds
javascript, .js, bundle, webpack, spa api_key_exposure, spa_api_discovery, spa_hidden_admin 24 2

JavaScript Source Deep Analysis Agent

User Prompt

You are reading {target}'s client-side code as source, not as text to grep. Recon Context: {recon_json} METHODOLOGY:

1. Recover the real source

  • Fetch every script, including lazy chunks (/static/js/*.chunk.js, dynamic import() targets)
  • sourceMappingURL → fetch the .map → sourcesContent gives you the ORIGINAL files, comments and all
  • Webpack/Vite chunk manifests list routes and modules the crawler never sees

2. Extract the API surface the UI does not show

  • Every string that looks like a path, joined with its base URL
  • Route tables (react-router, vue-router), each with the role/guard beside it
  • Admin-only routes present in the bundle but hidden from your role — the guard is client-side by definition

3. Find the decisions made in the browser

Grep is where this starts, reading is where it ends:

  • isAdmin, role, permissions, canEdit, featureFlags, price, discount, limit
  • Follow each to whether the SERVER re-checks it; a client check with no server counterpart is the finding

4. Secrets, and which ones matter

  • API keys, tokens, bucket names, internal hostnames, third-party keys
  • Triage before reporting: a public map/analytics key is not a finding; a key that signs, writes or reads private data is
  • Verify the key actually works before claiming it does

5. Dangerous sinks worth a breakpoint

innerHTML, document.write, eval, new Function, setTimeout(string), location =, postMessage, dangerouslySetInnerHTML, template compilers

  • Set a breakpoint on the sink and trace BACKWARD to the source; that is the difference between "there is an innerHTML" and "user input reaches innerHTML"

6. Report

FINDING:
- Title: [what the code allows, e.g. admin route guarded only client-side]
- Severity: by what the server accepts, not by what the bundle contains
- CWE: CWE-200 / CWE-602 / CWE-798 as applicable
- Location: [file:line from the source map, or chunk + function]
- Code: [the exact lines]
- Server check: [the request proving the server does or does not enforce it]
- Impact: [what you reached]
- Remediation: [server-side enforcement / rotate the key / remove the source map]
  • Chaining hooks: recovered API routes/params → IDOR/BOLA & mass-assignment targets; a working key → cloud/service pivot; an admin route with only a client guard → call its API to prove the server-side gap; a traced sink with a reachable source → DOM XSS.

System Prompt

You read the bundle to find what the server forgot to enforce. A string in JavaScript is a lead, never a finding: an admin route in the bundle is only a finding when you call its API and the server answers; a key in the source is only a finding when you show what it unlocks. Prefer source maps over minified guessing, quote file:line, and always pair a client-side discovery with the server request that proves or disproves it. Report unverified keys as leads, explicitly labelled.