/jstack:eng-securityfrom jstack
Use when a change touches auth, sessions, permissions and roles, tenant data access, redirects, OAuth, webhooks, regex on input, logs of errors, exposed ports, or secrets. Ownership checked on every object, deny by default, nothing secret leaves.
Ships in jstack. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Every object read or written proves the caller owns it (tenant and owner in the query, not only the id), every route and tool is gated by a declared permission and denies by default, protocols follow their best-current-practice documents with negative tests, and nothing secret leaves the machine: not in logs, error dumps, screenshots, PR text or committed commands.
/preflight): answer the questions for the task's tier (S: MUST, M: + SHOULD, L: all + a pre-mortem). An answer that needs a number gets a number or "unknown, measure first". Copy the budgets that apply into the pre-flight with how each is measured./unslop): the static red flags run in tools/unslop/scan.mjs; the review agent reads the diff for the eyes ones. A red flag is a hypothesis until a confirm recipe produces evidence that a second agent reproduces.checks.json in this folder (triggers, questions, budgets, rules, verify). Projects tune it in .jstack/unslop.json (rule modes, waivers, extra questions and rules).MUST (asked at every tier)
sec.q.ownership Which objects does this change read or write, and which line proves the caller's tenant/owner matches? (answer as: table; prevents: bola)sec.q.gate Which permission key and scope gate each new route or tool, and is it declared as data in the registry? Is the public allowlist delta empty? (answer as: table; prevents: missing-authz)SHOULD (tier M and L)
sec.q.revocation For every credential or copied ACL: how is it revoked, and what is the max staleness? (answer as: table; prevents: stale-authz)sec.q.input-sinks Does any input flow into a redirect, regex, shell, SQL or HTML? What bound or allowlist applies? (answer as: list; prevents: open-redirect, redos, injection)sec.q.protocol Am I implementing a protocol (OAuth/OIDC, webhook signature)? Which BCP section am I following, and which negative tests prove it? (answer as: text; prevents: incomplete-protocol)sec.q.error-logs What does an error from this path log? Could it include headers, URLs, configs or tokens? (answer as: text; prevents: secrets-in-logs)DEEP (tier L, with the pre-mortem)
sec.q.exposure What new listener, port, endpoint or container appears, and what is its default exposure? (answer as: list; prevents: unsafe-defaults)sec.q.artifacts Which artifacts leave the machine (PR text, screenshots, docs, transcripts), and were they scanned? (answer as: list; prevents: secret-leak)sec.q.stride STRIDE, one line per changed data flow: who could spoof, tamper, read, deny or escalate here? (answer as: table; prevents: unreviewed-change)Defaults with their source. The project file .jstack/budgets.json wins; null means the project sets it the first time a task touches it (pre-flight turns that into a measure-first task).
| key | default | unit | how measured | source |
|---|---|---|---|---|
sec.ungated_routes | 0 | count | route/tool inventory: entries neither gated nor in the public allowlist | OWASP API5:2023; architecture fitness functions |
sec.canary_leaks | 0 | count | sentinel secrets found in logs, artifacts and outputs after a test run | OWASP Logging Cheat Sheet; CWE-532 |
sec.redos_ms_at_max_input | 50 | ms | regex timing at the max accepted input length with a pumped attack string | CWE-1333; Davis et al. FSE 2018 |
A red flag is a hypothesis. /unslop turns it into a finding only with evidence (see Confirm recipes).
| id | what it looks like | why it is slop | detector | severity |
|---|---|---|---|---|
sec.regexp-from-input | RegExp built from request or user input | Regex injection and catastrophic backtracking on attacker-chosen patterns. | static sec.regexp-from-input (regex) | high |
sec.password-in-command | Password on a command line or inside a connection string | Visible to every local user in the process list and kept in shell history and transcripts (CWE-214). | static sec.password-in-command (regex) | high |
sec.raw-error-log | Raw error/response/config object logged | HTTP and DB client errors carry headers, URLs with keys and configs (CWE-532). | static sec.raw-error-log (regex) | low |
sec.public-port-bind | Compose service port published on all interfaces | A dev database or metrics port reachable from the network, often with default credentials. | static sec.public-port-bind (regex) | medium |
sec.missing-ownership | Lookup by client-supplied id with no tenant/owner condition | Another tenant's object is one id away (OWASP API1:2023). | review agent (eyes) | high |
sec.route-without-gate | New route/procedure/tool with no permission call and not in the public allowlist | Anyone signed in (or anyone) can call it. | review agent (eyes) | high |
sec.role-name-check | Authorization by role name (role === 'ADMIN', isAdmin) instead of the permission resolver | Custom roles and scopes are bypassed or over-granted. | review agent (eyes) | medium |
sec.open-redirect | Redirect target from request input without an origin compare | Phishing via a trusted domain (CWE-601). | review agent (eyes) | high |
sec.no-revocation-path | Token without expiry, or an ACL copied to another store with no update path | Removed users keep access. | review agent (eyes) | high |
sec.nested-quantifier | Regex with a quantified group that itself contains a quantifier ((\w+\s?)+, (.)) | Nested quantifiers backtrack exponentially on a near-miss input: one request can pin a CPU. | static sec.nested-quantifier (regex) | medium |
sec.dev-shortcut | Verification skipped when the host or env looks local (localhost, development, missing base URL) | An attacker or a misconfigured deploy makes production look local and the check turns off. | review agent (eyes) | high |
sec.display-gate-mismatch | Data a view shows is fetched through an endpoint gated by a stricter permission than the view, or a new key defaults differently on the front and back end | Members who can see the view get blank labels or refused requests, and the UI promises actions the server denies. | review agent (eyes) | medium |
sec.regexp-from-input: measurement: pumped attack string at 1e3/1e4/1e5 grows super-linearly or breaks the budget Fix direction: escape the input, bound its length, or use a linear engine.sec.password-in-command: static-proof: the credential is in the command or file Fix direction: read credentials from env or a password file.sec.raw-error-log: failing-test: canary secret in env, force a provider error, grep outputs for the canary Fix direction: log message, code and status only.sec.public-port-bind: measurement: ss -ltn / netstat shows 0.0.0.0: Fix direction: bind to 127.0.0.1::.sec.missing-ownership: failing-test: two tenants; B's user requests A's id and gets 200sec.route-without-gate: failing-test: call it with a token lacking the permission; expect 403sec.role-name-check: failing-test: permission matrix property test finds an over- or under-grantsec.open-redirect: failing-test: next=https://evil.example and //evil.example resolve off-originsec.no-revocation-path: failing-test: grant, use, revoke, reuse the same token -> still workssec.nested-quantifier: measurement: pumped attack string at 1e3/1e4/1e5 chars; time grows super-linearly or breaks sec.redos_ms_at_max_input Fix direction: make repetitions unambiguous, bound the input length, or use a linear-time engine. Known false positives: groups whose repetitions cannot overlap because a literal separator starts each one, e.g. (?:-\w+)*.sec.dev-shortcut: failing-test: production build with a localhost-like base URL; an unsigned or unauthenticated request is acceptedsec.display-gate-mismatch: failing-test: render as a role with the view permission only; labels are blank or the request is refused Fix direction: ship display data with the viewable record; one default per permission key shared by both layers.Run in this order after the change; each line is a pass criterion.
sec.v.inventory route/tool inventory diff: every entry gated or allowlisted (test; fitness test over the router registry)sec.v.bola two-tenant tests for each changed endpoint (1 positive, 2 negative) (test; test runner)sec.v.matrix permission/scope matrix property test (test; fast-check)sec.v.revocation revocation test per credential type and derived ACL (test; test runner)sec.v.protocol protocol negative tests (state, PKCE, redirect allowlist, webhook signature) (test; test runner)sec.v.canary canary-secret run: sentinel secrets, run suite, grep all outputs = 0 (test; tools/memory/secrets.mjs + grep)sec.v.secret-scan secret scan of the diff and every outbound artifact (test; gitleaks / trufflehog)Loaded by tools/unslop/classify.mjs when the task says "auth", "login", "oauth", "token", "session", "permission", "permissions", "role", "roles", "admin", "secret", "secrets", or touches **/auth/**, **/*auth*, **/*session*, **/*permission*, **/*role*, **/middleware*, **/routers/**, **/api/**.
| tool | how to run it | what number to read | valid only when | trap |
|---|---|---|---|---|
| ownership tests | call each new route as another tenant's user | 403/404, never data | real permission resolver | testing only the happy path |
| secret scan | gitleaks detect on the diff and on artifacts (PR body, screenshots text, reports) | 0 findings | scan what leaves, not only the repo | a token pasted in a PR description |
| regex safety | never compile user input; test patterns with long adversarial strings | bounded time | escape or use literal matching | nested quantifiers on unbounded input |
| exposure check | list new listeners, ports, public routes | bound to loopback or behind auth | compose and server config | 0.0.0.0 by default |
| symptom | measure | cause | fix |
|---|---|---|---|
| User sees another tenant's data | cross-tenant request in a test | lookup by id only | scope every query by tenant/owner |
| Secrets in logs | grep logs for header and token shapes | whole error objects logged | log code and message only |
| Open redirect | next=//evil.example | prefix or includes checks | allowlist of paths |
security-review if installed.
Dated sources with their verification tags are in SOURCES.md. Claims tagged unverified there are not stated as fact here.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub jayjayholic/jstack --plugin jstack31 skills in this plugin
/domain-modelingBuild and sharpen a project's domain model. Use when discussing codebase terminology, writing or editing a GLOSSARY.md, or recording or editing an ADR./eng-agent-disciplineUse for every coding-agent task, and when writing briefs, reports, READY messages, docs or handoffs. Quote the ask, stay in owned files, cite sources for claims, verify yourself before claiming done, report with evidence./eng-ci-gitUse when a change touches CI, build, typecheck, merges and rebases, branches and worktrees, release trains, exported signatures or renames. Gate the merged tree, find every caller, resolve conflicts by reading them.