# Hunt Xss Stored

> Stored-XSS expert of the xss split: the payload PERSISTS and renders

- Skill: `encod3d-sec/hunt-xss-stored` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx get-skill add encod3d-sec/hunt-xss-stored`
- Raw SKILL.md: https://api.skillmd.com/api/skills/encod3d-sec/hunt-xss-stored/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Security
- Author: Encod3d-Sec (https://skillmd.com/u/encod3d-sec)
- Updated: 2026-11-16
- Page: https://skillmd.com/skills/encod3d-sec/hunt-xss-stored

---


# Hunt: XSS - stored expert (microskill)

Stored-XSS expert of the xss split: the payload PERSISTS and renders
later, elsewhere, often to a privileged viewer. The mapper (hunt-xss)
owns the reflection map and class routing; this skill owns write
fields, storage sinks, second-order render discovery, and the
victim-side confirmation.

The two load-bearing ideas: (1) the sink is rarely where you typed -
read the WHOLE reflected block on every page the field touches
(greeting/counter/result lines - phrasing shifts hide sinks); (2) an
approval/moderation panel is the payoff surface - raw markup rendered
in the panel is class proof WITHOUT firing in the bot.

## Wiki

Hub: [[wiki/techniques/web/xss]] - Primary page: [[wiki/techniques/web/xss]] - Payloads:
`wiki/payloads/xss.md`
Anchors: [[wiki/techniques/web/xss]] (the beacon ops companion)
**REFS:** [[wiki/techniques/web/xss]], wiki/payloads/xss.md

qmd on hint only: "stored xss second order render moderation panel
reviewer bot queue" - the xss page first.

## Paths (binding - shared with the mapper run)

    # seat side (wsl):
    ENG_DIR=/mnt/c/Users/Lenovo/Desktop/VMshare/<eng>/<eng>
    RUN=$ENG_DIR/hunt/xss/<host>          # SHARED with hunt-xss
    # VM side:
    ENG_DIR=/mnt/VMshare/<eng>/<eng>
    RUN=$ENG_DIR/hunt/xss/<host>

Experts write probes/xss-stored*.jsonl into the mapper's $RUN tree.

## Transport

Every VM-native command block ships through ONE documented transport:

    wsl.exe -d kali-linux -u root bash -c "cd /mnt/c/Users/Lenovo/Documents/ObisidianVaults/ZTorch/ZTorch && bash scripts/vm-ssh.sh '<command>'"

- vm-ssh lands as user tz (NOT root); one argument per call; quotes
  ship as base64 (`echo <b64> | base64 -d | bash`).
- Target-facing curls MUST use /opt/scope-shim/bin/curl by absolute
  path; out-of-scope dies rc 126 (never work around); UNKNOWN =
  ADVISORY, self-deny.
- Browser validation runs on the seat; console snapshots +
  screenshots into targets/<eng>/poc/.

## Entry gate

All four must pass; each is falsifiable:

1. Active engagement exists; the write surface is on
   targets/<eng>/scope.md in-scope. Scope-guard is the deny.
2. hunt-core loaded (skills/exploit/hunt/hunt-core/SKILL.md).
3. Mapper verified: $RUN/raw/reflection-map.md exists AND the
   XSS-HUNT-DONE pointer names stored in next=. Missing = dispatch
   hunt-xss first.
4. Toolchain preflight (fails LOUD):

       for t in /usr/bin/jq /usr/bin/python3 \
                 /opt/scope-shim/bin/curl; do
         [ -x "$t" ] || { echo "MISSING TOOL: $t"; exit 1; }
       done

## Checklist (mandatory)

Copy checklist.md (this skill's dir) to
`$ENG_DIR/hunt/xss/<host>/xss-stored-checklist.md` at run start.
Unchecked at stop = UNCHECKED lane, re-run from the first unchecked
step. SKILL.md and the checklist header agree byte-for-byte on that
copy target.

## Nudge

Review-skill re-injection text (pinned; NOTE: completion-gate emits
its own generic nudge - both mean: resume at the first unchecked box):

    Your work was just reviewed by the review skill and it was found
    that you either missed a step of analysis, or didn't generate an
    artifact of sufficient proof. Look at the markdown based checklist
    and the output for each step, find what you missed, and complete
    that step.

## Confirmation gate

**NOT confirmation:** the payload stored (a 200 on the write); markup
visible on YOUR OWN profile page only; a queue entry sitting pending.

**IS confirmation:** rendered + EXECUTED in a second context (fresh
session/incognito), alert(window.origin) captured; OR raw markup
rendered in an approval/moderation panel (reviewer-bot recognition -
class proof without firing in the bot); reproduced from your own
written steps.

## Methodology

### Steps 1-2 - Sink discovery

Enumerate write fields (profile fields, names, comments, tickets,
filenames) and where each renders: own page / other page / other
origin. Then SECOND-ORDER discovery: read the whole reflected block on
every page the field touches - greetings, counters, result lines.
Phrasing shifts hide sinks; a partial read is a missed sink.

### Steps 3-4 - Delivery + panels

- Probe payload per sink (the mapper's sanitizer verdict gates the
  shape). QUEUE DISCIPLINE: one row per probe, wait for render/queue
  processing between probes - never flood a moderation queue.
- Approval/moderation panel = the privileged render target. Reviewer
  bot present: RAW MARKUP IN PANEL is the proof - do not fire in the
  bot. A stored field in a moderator panel dispatches BOTH this skill
  (sink owner) and hunt-xss-blind (beacon + callback ops owner).

### Steps 5-6 - Confirmation + escalation

- Victim-side: fresh session/incognito, alert(window.origin) (names
  the executing origin in cross-domain iframes), console + screenshot
  into targets/<eng>/poc/.
- Session-theft escalation: cookie exposure / token-bearing DOM
  assessed. RoE gate: proof-of-exposure on OWN accounts only, no
  third-party victims.

### Step 7 - Exit

Append rows to the mapper's $RUN/candidates.jsonl;
`XSS-STORED-DONE sinks=<n> executed=<n> panel=<0|1>` appended to the
mapper pointer $ENG_DIR/hunt-xss-<host>.md; _requests.md rows (lane =
hunt-xss-stored); Deadends per clean sink.

## Chaining

- Admin/moderation viewer of the field -> hunt-xss-blind for beacon +
  callback ops.
- Immediate-response reflection on the same field ->
  hunt-xss-reflected.
- Sink is client-side (postMessage/innerHTML) -> hunt-xss-dom.

## Validation

- Proof = second-context execution captured, or panel recognition
  row citing the panel response.
- Negative control: the same field with benign content renders
  encoded/clean.

## False Positives

- Stored-but-always-encoded sink (name the encoder when deadending).
- Self-XSS with no second viewer (no chain, no severity).
- Queue entry that never renders (abandoned queue = deadend, not a
  finding).

## Severity

CRITICAL = executed in an admin/privileged context or session theft
proven. HIGH = executed cross-user. MEDIUM = own-page only with a
second render path. LOW = pending-queue only.

## N/A escapes

- "N/A: no second-order render surface" (whole-block read on every
  touched page came back clean)
- "N/A: no moderation/approval panel"
An N/A tick is a claim with a reason, never a silent pass. Identical
strings in SKILL.md and checklist.md.

## Bitter-pill variant

Freehand run: skip checklist + numbered steps, one freehand pass over
the sink map, output ONLY $RUN/analysis/bitter-pill.md. The
second-context gate survives freehand. Declare with a _requests.md row
(lane = hunt-xss-stored-bitterpill).

### Depth walk (mandatory)

Walk EVERY applicable row of the payload arsenal page cited above.
Record each row in `$RUN/coverage-depth.md` as a table
`| row | state | evidence |` where state is `probed`, `blocked`, or
`N/A`, and evidence is a probe-pair path or a Deadends.md line. A bare
`probed` with no evidence reference fails the completion gate
(NEEDS-REVIEW). N/A rows cite why (surface shape forbids it).

Blocked implies research: before any Deadend is claimable on a blocked
row, (a) walk the arsenal page's bypass-ladder rows for that control
class, and (b) run one wiki query AND one `mcp__wigolo__search` for the
specific tech-plus-control bypass. Results, or a genuine null, land in
`coverage-depth.md`. "No research tried" is not a claimable state.

## Exit artifact + handoff

Appends into the shared mapper $RUN: probes/xss-stored*.jsonl,
raw/stored-sink-map.md, candidates.jsonl rows, pointer line
XSS-STORED-DONE. Consumer: triage. Findings leave ONLY through G1.
Distill: `python3 scripts/wiki-stage.py --kind technique --slug <slug>
--target-page techniques/web/xss.md`.

## Stop conditions

All steps terminal; queue discipline held (no flooding); no
third-party firing; nothing written into skill dirs; no unchecked
boxes above REVIEW; hunt-core stop conditions fire unchanged.

## Attack surface

**APPROACH:** Map every reflection point, classify reflected/stored/DOM, probe the sanitizer (`aaa"bbb'ccc<ddd`), then fire the context-matched payload; plant a blind beacon in admin/moderation-viewed fields and confirm the session-theft callback.
**AVOID:** A payload that comes back URL/HTML-encoded (`&lt;script&gt;`) is NOT XSS; a blind/stored beacon is unproven until its `oob.md` row flips to HIT.

## Cross-routing

- Load hunt-upload for SVG/file-borne payload delivery.
- Load hunt-cache / hunt-smuggling when the payload needs a poisoned or desynced
  response to reach the victim.
- Load hunt-llm when the sink renders model output (markdown render of LLM content).
- Not this skill: stored-but-always-escaped fields (deadend with the control named).

