Skip to content
mrdineshpathroPublic

About

Reviews URL and request parameters that may be worth a manual path-traversal check. Passive and local: reads HAR, OpenAPI and 10+ formats, never sends a request. Stdlib-only Python CLI with SARIF/JUnit output.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

PathScope logo

PathScope

Passive, offline triage of URL and request parameters that may be worth reviewing for path-traversal risk.

Python Standard library Platform License

GitHub · Instagram · Support


PathScope reports candidates for manual review. It does not find, prove, or confirm vulnerabilities. A finding means “this parameter’s name or existing value looks path-like”. Whether it is used, validated, or remotely interesting is a question for a human, in scope, with authorization.


Table of contents

  1. What it does
  2. Safety model
  3. Requirements
  4. Installation
  5. Inputs
  6. Quick start
  7. Presets
  8. Baselines, diff and suppression
  9. Reports
  10. Live watch mode
  11. Rule registry and tuning
  12. Multilingual and folded names
  13. Value-shape demotion
  14. CI integration
  15. Scale and performance
  16. Interactive HTML report
  17. Terminal reviewer
  18. Review ledger
  19. Analysis dashboard
  20. Cross-source correlation
  21. Remediation playbooks
  22. Run history and trends
  23. Streaming stdin
  24. Reproducible bundles
  25. Secret scrubbing
  26. Capture-to-capture diff
  27. Offline URL extraction
  28. Value statistics
  29. Rule coverage
  30. Term packs
  31. Preset comparison
  32. Score calibration
  33. Project files
  34. Reviewed-aware CI
  35. Acceptance expiry
  36. Path families
  37. Review queue
  38. Scope files
  39. Deterministic sampling
  40. API description matching
  41. Policy shadow mode
  42. Work-item export
  43. Pull-request comments
  44. Host redaction
  45. Shell completion
  46. Waivers
  47. Suppression audit
  48. Rule precision
  49. Rule impact
  50. Weight simulation
  51. Score-change explanation
  52. Filtering with --where
  53. Run attestation
  54. Owner assignment
  55. Ledger merge
  56. Exit codes
  57. Detection rules
  58. Configuration file
  59. Tests
  60. Project layout
  61. Limitations
  62. FAQ
  63. Authorization and legal

What it does

Given URLs or a HAR capture you already have, PathScope:

  • parses query strings, form bodies and JSON bodies locally;
  • scores every parameter against a small, documented rule set (name vocabulary + value shape);
  • prints a ranked list of candidates with the rule that fired, a plain-language reason, and a heuristic score.

It does not send a request, resolve a host, crawl, fuzz, inject, replay a HAR, or read any file named in a parameter. Parameter values are strings and nothing else.

Typical use: you have a proxy history or a list of URLs from an authorized review, and you want the five parameters worth reading first instead of two hundred.


Safety model

Guarantee How it is enforced
No network I/O No socket, ssl, http, urllib.request, requests imports anywhere in pathscope/; a test asserts this with an allow-list.
No DNS Same as above: nothing in the package can resolve a name.
No crawling or scanning Inputs are read exactly once from args, files or stdin.
No test payloads Values are only read, never generated or modified.
No filesystem access via values Values never reach open, os.open, pathlib; a test patches open to fail if a value is ever used as a path.
No root Nothing calls setuid, sudo, or privileged APIs.
No third-party packages Standard library only.

Additional hardening:

  • Values hidden by default. Reports show <hidden> unless you pass --show-values.
  • No query strings or bodies in output. The reported resource is scheme://host[:port]/path only; user:pass@ in URLs is masked.
  • Terminal-safe output. Every string from input is NFC-normalised and control characters are removed before rendering, so a crafted value cannot inject ANSI escapes or fake report lines.
  • Deterministic output. No timestamps, no machine names, stable sort order — reports diff cleanly between runs.
  • Bounded work. Decoding is capped (default 3 passes, max 5), HAR entries and JSON parameters are capped, and long values are truncated.

Requirements

Python 3.8 or newer (developed and tested on Python 3.11, which Kali ships)
Packages none — standard library only
Privileges ordinary user; root is not required (the Docker image is unprivileged too)
Network never used

Installation

PathScope is a single Python package with no third-party dependencies. Pick whichever line matches your box.

Kali / Debian / Ubuntu / macOS / WSL (one command)

git clone https://github.com/mrdineshpathro/pathscope
cd pathscope
./install.sh                  # installs into ~/.local

install.sh is POSIX sh, prints every action, and is safe to re-run:

Command Effect
./install.sh install to ~/.local, add it to the PATH in ~/.profile/~/.zshrc
PREFIX=/opt/pathscope sudo ./install.sh system-wide install
./install.sh --no-path install files but leave shell rc files alone
./install.sh --dry-run print what would happen, change nothing
./install.sh --uninstall remove the launcher and program files

It refuses to run on Python older than 3.8, verifies the copied sources import, and finishes with pathscope --version. Nothing is downloaded and no Python packages are installed.

Windows

git clone https://github.com/mrdineshpathro/pathscope
cd pathscope
install.cmd

Installs to %LOCALAPPDATA%\PathScope, adds ...\bin to the user PATH (no admin rights needed) and writes a pathscope.cmd launcher. Options: --no-path, --dry-run, --help; override the location with set PREFIX=D:\tools ^& install.cmd.

The terminal reviewer (--tui) needs curses; on Windows it is unavailable, and every other feature works unchanged (PathScope reports this clearly instead of crashing — see pathscope --doctor).

Docker (one line)

docker build -t pathscope .
cat requests.txt | docker run --rm -i pathscope --stream
docker run --rm -v "$PWD:/data:ro" pathscope -i /data/requests.txt --format json

The image is python:3.12-slim, runs as an unprivileged user, contains no scanners or networking tools, and has a HEALTHCHECK that runs --self-test.

Verify any install

pathscope --doctor      # interpreter, sqlite, zip, curses, package integrity
pathscope --self-test   # 16 behavioural checks, no network access

Manual (no install)

python3 path_detector.py --help

Kali Linux notes

Kali ships Python 3.11; there is nothing to install.

git clone https://github.com/mrdineshpathro/pathscope.git
cd pathscope

python3 --version                 # expect 3.11.x
chmod +x path_detector.py
./path_detector.py --help

# equivalent module form (no chmod needed)
python3 -m pathscope --help

Optional: put it on your PATH without root.

mkdir -p ~/.local/bin
ln -sf "$PWD/path_detector.py" ~/.local/bin/pathscope
pathscope --version

If ~/.local/bin is not on PATH, add it to your shell config (~/.zshrc on Kali by default):

echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc && exec zsh

Nothing in this project needs sudo. If a command fails, fix permissions in your home directory rather than escalating.


Inputs

PathScope accepts three sources, which are merged and de-duplicated:

Source Flag Notes
One or more URLs --url URL (repeatable) Quote URLs containing &.
URL list -i urls.txt / -i urls2.txt One URL per line; blank lines and # comments ignored; malformed lines warn and are skipped.
HAR 1.2 capture -i capture.har or --format har Parsed locally; requests are never replayed.
Burp proxy XML -i burp-history.xml or --format burp Base64 and plain request blocks; form/JSON/multipart bodies parsed.
OpenAPI / Swagger -i openapi.json or --format openapi Declared parameters become a name-only inventory (no values).
Raw HTTP request -i request.txt or --format raw GET /path?x=1 HTTP/1.1 + Host; several requests via ### lines.
Recon output -i httpx.txt, -i nuclei.jsonl, --format recon httpx/ffuf/katana/nuclei lines or JSONL, reduced to their URLs.
Postman -i collection.json or --format postman Collection v2.0/v2.1, nested folders, query/urlencoded/formdata/raw bodies.
OWASP ZAP -i zap.json or --format zap JSON history (site.messages) or alert export (alerts[].instances).
mitmproxy -i flows.json or --format mitmproxy A single flow or a list of flows; query and JSON/form bodies.
GraphQL -i introspection.json or --format graphql Argument names of the root query/mutation fields, nested args as a.b.
Cookie jar -i cookies.txt or --format cookies Netscape format; names only, values are discarded.
stdin cat urls.txt | pathscope, pathscope -i - Auto-detected when no other source is given.

Input format

  • --format auto (default) — detects, in order: HAR (.har/.har.json or a log.entries object), a plain URL list, Postman, ZAP, GraphQL, mitmproxy, cookie jar, Burp XML, OpenAPI JSON, raw HTTP request, recon output.
  • --format har|burp|openapi|raw|recon|postman|zap|mitmproxy|graphql|cookies|urls — force an input format.
  • --input-format {...} — the same selectors under an unambiguous name. Use --input-format together with --format json when you want to force the input and choose output.

--format json|csv|sarif|text selects the output format instead (see below).

What is read from a HAR

HAR location Parameters analysed
request.url query string and request.queryString query parameters (repeated names kept)
request.postData.params multipart/form fields, using value or fileName
request.postData.text + mimeType application/x-www-form-urlencoded fields, or flattened JSON body (dotted paths, [n] for arrays)

Only the request side is read. Responses, cookies, headers and timings are ignored on purpose: they are noise for this question and may contain secrets.


Quick start

All examples work on Kali with the repository checked out.

# 1. A single URL
python3 path_detector.py --url 'https://example.test/view?file=report.pdf'

# 2. A URL list (one per line)
python3 path_detector.py -i urls.txt

# 3. Piped stdin
cat urls.txt | python3 path_detector.py

# 4. A local HAR capture (auto-detected)
python3 path_detector.py -i capture.har

# 5. HAR with JSON output for a report pipeline
python3 path_detector.py -i capture.har --format json > candidates.json

# 6. Show existing values (they may contain secrets — be careful)
python3 path_detector.py --url 'https://example.test/view?file=report.pdf' --show-values

# 7. Ignore noisy parameters, in CI
python3 path_detector.py -i urls.txt --ignore-param image --ignore-param avatar \
        --fail-on-findings

Example terminal output (values hidden):

$ python3 path_detector.py --url 'https://example.test/view?file=report.pdf'
PathScope 2.6.0 - passive path-parameter triage
----------------------------------------------------------------
GitHub: https://github.com/mrdineshpathro
Instagram: https://www.instagram.com/mr_dineshpatro
Support: https://buymeacoffee.com/mrdineshpathro
Candidates for manual review only. No network requests are made; only analyze data you are authorized to review.

PathScope candidates for manual review
====================================================================================
Analyzed 1 request(s) and 1 parameter(s); 1 candidate(s) at score >= 25.

#1  file  [MEDIUM score 43/100]
   Host        example.test
   Source      url (--url)
   Request     GET https://example.test/view
   Location    query
   Rule        name-exact
   Value       <hidden> (use --show-values)
   Why           rules and evidence:
     - parameter name contains path-related term 'file' (+35)
     - value ends with a file-like extension '.pdf' (+8)

Reminder: these are candidates for manual review, not confirmed vulnerabilities. No requests were sent.

Presets

Three reporting postures, chosen with --preset. They change thresholds only — never what counts as a finding.

Preset Score threshold Weak-name evidence Use it when
minimal (aliases strict, high) 50 off you want a very short list
balanced (alias default) 25 on normal triage (default)
noisy (aliases loud, broad) 10 on first pass over a large capture

Precedence: CLI flags > configuration file > preset.

python3 path_detector.py -i capture.har --preset minimal

# Write a validated starter config for the preset you use most
python3 path_detector.py --init-config pathscope.json --preset minimal
python3 path_detector.py -i capture.har --config pathscope.json

--init-config refuses to overwrite an existing file, so it is safe to re-run.

Baselines, diff and suppression

Every finding carries a stable 16-hex fingerprint derived from host + location + parameter name + primary rule + path. Values, scores and the source file name are excluded, so a baseline survives new captures and new data.

# 1. Save a JSON baseline (any run can produce one)
python3 path_detector.py -i capture.har --json > baseline.json

# 2. Later: report only new candidates, and fail CI only on those
python3 path_detector.py -i capture-new.har --baseline baseline.json \
        --save-report triage.md --fail-on-findings
  • --baseline FILE — known findings are marked known and hidden; resolved entries (in the baseline but no longer present) are listed in text/Markdown/HTML.
  • --show-known — keep known findings in the output, labelled KNOWN.
  • --suppress FILE — hide reviewed fingerprints; accepts a PathScope JSON report or a {"suppressions": [{"fingerprint": "...", "note": "..."}]} file.
  • --mark-reviewed FILE — append the current run's fingerprints (with any baseline note) to a reviewed ledger that --suppress can read later.
  • --fail-on-findings in diff mode counts new candidates only, so a stable baseline gives a quiet CI gate.

Fingerprints appear in text, JSON ("fingerprint", "status"), CSV and SARIF (partialFingerprints), so any of them can be used as a baseline.

Reports

Every format contains the same fields: host, source_type, source, method, location (query/form/json), parameter, occurrences, rule, rules, confidence, score, reasons, resource, and — only with --show-values — value.

JSON (--format json, --json)

{
  "tool": "PathScope",
  "version": "2.1.0",
  "disclaimer": "Candidates for manual review only. ...",
  "passive": true,
  "network_requests_made": 0,
  "min_score": 25,
  "show_values": false,
  "summary": {
    "requests_analyzed": 1,
    "parameters_analyzed": 3,
    "candidates": 1,
    "confidence": {"high": 0, "medium": 1, "low": 0},
    "skipped": 0,
    "sources": ["urls.txt"],
    "mode": "scan",
    "new": 1,
    "known": 0,
    "resolved": 0
  },
  "warnings": [],
  "findings": [
    {
      "index": 1,
      "host": "example.test",
      "source_type": "file",
      "source": "urls.txt",
      "method": "GET",
      "location": "query",
      "parameter": "file",
      "occurrences": 1,
      "rule": "name-exact",
      "rules": ["name-exact", "value-extension"],
      "confidence": "medium",
      "score": 43,
      "reasons": [
        "parameter name contains path-related term 'file' (+35)",
        "value ends with a file-like extension '.pdf' (+8)"
      ],
      "resource": "https://example.test/view",
      "value": null,
      "fingerprint": "ec274fecea647284",
      "status": "new",
      "note": ""
    }
  ],
  "links": {
    "github": "https://github.com/mrdineshpathro",
    "instagram": "https://www.instagram.com/mr_dineshpatro",
    "support": "https://buymeacoffee.com/mrdineshpathro"
  }
}

CSV (--format csv)

Fixed column order, one finding per row, values empty unless --show-values:

index,host,source_type,source,method,location,parameter,rule,rules,confidence,score,reasons,resource,value
1,example.test,file,urls.txt,GET,query,file,name-exact,name-exact;value-extension,medium,43,"parameter name contains path-related term 'file' (+35); value ends with a file-like extension '.pdf' (+8)",https://example.test/view,

Markdown and HTML (--format markdown|html, --save-report FILE)

Standalone reports for tickets and reviews: summary metadata, a candidate table with fingerprints and statuses, a "why each candidate was flagged" section, the resolved list in diff mode, and input warnings. HTML is fully escaped (a parameter named <script> cannot inject markup) and has no external assets.

python3 path_detector.py -i capture.har --save-report triage.md
python3 path_detector.py -i capture.har --output-format html > triage.html

SARIF 2.1.0 (--format sarif)

Produces a valid SARIF log for GitHub code scanning or any SARIF viewer: one run, a deterministic rule catalogue, ruleIndex values that match the catalogue, level mapped from confidence (warning/note), and a properties bag with the score, reasons and location. Values are omitted unless --show-values.

Text (--format text, default)

Human-readable blocks with the rule, evidence lines and a reminder that these are candidates. Colour (ANSI) is used only when stdout is an interactive terminal; pipes, files and CI logs get plain text. --no-color and the NO_COLOR environment variable both disable colour explicitly.

Warnings

Recoverable input problems (malformed URL on line 7, unreadable HAR entry, truncated JSON body) are printed to stderr as warning: lines, counted in the summary, and never abort the run. -q/--quiet silences them and the stderr summary; JSON/CSV/SARIF on stdout stay valid.


Live watch mode

A proxy keeps appending to a capture while you work. --watch re-reads the file on a timer and prints only candidates it has not reported before, one line each, so a long session stays readable.

python3 path_detector.py --watch capture.har --interval 2
python3 path_detector.py --watch urls.txt --preset noisy --interval 5
Watching capture.har every 2s for new candidates. Press Ctrl-C to stop. No requests are sent.
[new] app.test        query  file       HIGH       71/100 name-exact
[new] cdn.test        form   attachment MEDIUM     53/100 name-exact
Stopped after 42 poll(s) in 84.0s; 2 candidate(s) seen in total.
  • Polling only parses the file when its size/mtime changed.
  • Identity is the usual fingerprint, so the same parameter never repeats.
  • A capture that shrinks (rotated/replaced) starts a fresh baseline.
  • A missing file is a usage error (exit 2); a transient read failure while a proxy is writing is retried quietly.
  • Ctrl-C stops cleanly and prints a summary. Nothing is ever requested.

Rule registry and tuning

Every rule and its default weight is listed in pathscope/rules.py and is visible from the command line. Rules can be reweighted, disabled and explained without editing code.

# What rules exist, with effective weights?
python3 path_detector.py --list-rules

# Reweight and disable rules for this run (JSON)
cat > rules.json <<'JSON'
{
  "weights": { "name-exact": 40, "value-weak": 0 },
  "disable": ["name-weak"]
}
JSON
python3 path_detector.py -i capture.har --rules rules.json

# One-off: remove a rule just for this run
python3 path_detector.py -i capture.har --disable-rule name-suffix

# Why did (or didn't) this parameter fire?
python3 path_detector.py --explain base_path --explain-value ../../etc/passwd

--explain prints the effective threshold, the rule book in use, every rule that fired with its layer, weight and reason, the total, and whether the result would be reported. Overridden weights are shown as 44 (default +35).

--disable-rule accepts a full id (value-traversal) or an unambiguous short form (traversal, uuid). Unknown ids are rejected with exit 2. Demotion rules (value-demote-*) may not be given a positive weight.


Multilingual and folded names

Folding is always on: diacritics, compatibility forms (fullwidth), exotic separators and invisible characters are normalised before tokenisation, so fıle, file and F_I_L_E are all file. Names that only match after folding get the weaker name-folded rule (+20), never the full name-exact weight.

Leet spellings are de-obfuscated for tokens of 3+ characters (f1le → file, p4th → path) and score name-leet (+12).

Term packs add path vocabulary from other languages:

Tag Language Examples
de German datei, pfad, ordner, herunterladen
es Spanish archivo, ruta, carpeta, descargar
fr French fichier, chemin, dossier, telecharger
pt Portuguese arquivo, caminho, pasta, baixar
it Italian percorso, cartella, allegato, scaricare
nl Dutch bestand, pad, map, bijlage
python3 path_detector.py -i capture.har --name-lang de,es
python3 path_detector.py -i capture.har --name-lang auto   # every pack

--name-lang off (default) keeps English only. In a configuration file use "name_lang": ["de", "es"], ["auto"] or []. English tables always win: a word that is generic in English (image, document) is never re-labelled as a foreign finding, and a folded-only match scores name-i18n-fold (+21) rather than the full name-i18n (+25).

--no-fold disables folding entirely (useful when auditing the sanitizer).


Value-shape demotion

A parameter named file whose value is a UUID, a hash, a JWT, a base64 blob, an e-mail address, an IP literal or a plain boolean/number is probably not a filesystem path. PathScope adds negative evidence for those shapes:

Rule Weight Shape
value-demote-uuid −20 550e8400-e29b-41d4-a716-446655440000
value-demote-hash −18 MD5/SHA digests, sha256:…
value-demote-jwt −20 eyJ…​.eyJ…​.…
value-demote-base64 −12 long base64 blobs
value-demote-email −8 user@example.test
value-demote-ip −10 192.168.1.1, 2001:db8::1
value-demote-scalar −10 true, 42, 3.14, short enums

Demotions appear in --explain and in every report (rules, reasons), so a candidate that drops below the threshold is visible rather than silently filtered. Tune them with --rules, remove them with --disable-rule value-demote-uuid, or turn the whole layer off with --no-demote / "demote_shapes": false.


CI integration

Four small pieces make PathScope fit a pipeline without a wrapper script.

Policy gate. --policy FILE (or inline JSON) expresses what may not happen:

{
  "description": "no new high-confidence candidates",
  "max_high": 0,
  "max_medium": 10,
  "max_total": 20,
  "min_score": 0,
  "fail_on_known": false,
  "ignore_rules": ["name-weak"],
  "ignore_hosts": ["static.example.test"]
}
python3 path_detector.py -i capture.har --baseline baseline.json \
        --policy pathscope-policy.json
python3 path_detector.py --init-policy pathscope-policy.json   # starter file

Only new findings count unless fail_on_known is true. Exit code 1 means the policy failed; the reasons are printed to stderr (policy failed: max_high=0 exceeded (1 found)).

JUnit XML. --output-format junit writes one testcase per confidence band plus one per finding, so GitLab/Jenkins/Azure show each candidate:

python3 path_detector.py -i capture.har --output-format junit > pathscope.xml

GitHub annotations. --github-annotations prints workflow commands on stdout; high-confidence candidates become ::warning, others ::notice:

python3 path_detector.py -i capture.har --github-annotations

Self-test. --self-test runs ten checks about the installation (banner, parsing, scoring, privacy defaults, escaping, bounded decoding) and exits 1 if any fail. It reads no user files and uses no network.

Ready-made files live in the repository: .github/workflows/pathscope.yml (runs the tests, scans an artifact if present, and honours a baseline) and .pre-commit-hooks.yaml (blocking new high-confidence candidates in changed captures). Both are plain YAML with no third-party actions beyond actions/checkout.


Scale and performance

Option Effect
--dedupe-by path default — one finding per host + location + parameter; occurrences counts resources
--dedupe-by param one finding per parameter name, across hosts
--dedupe-by none every (resource, parameter) pair stays separate
--max-entries N analyse at most N input entries; the rest are reported as truncated
--stats parse/analyse timings and counts on stderr and in JSON

Analysis is single-pass and in-memory; a 20 000-entry HAR is bounded by MAX_HAR_ENTRIES and the JSON body limits. Use --preset minimal and --dedupe-by path on very large captures to keep output short, and --top N when you only want the best few. --progress writes phase updates to stderr and leaves stdout machine-readable.


Interactive HTML report

--save-report FILE.html --interactive writes a single self-contained page with sortable columns, a text filter, a confidence filter, "reviewed only" mode and one-click fingerprint copying. Review checkboxes are stored in the browser's localStorage; nothing is uploaded and there are no external assets, so the file works offline and from file://.

python3 path_detector.py -i capture.har --save-report triage.html --interactive

--interactive requires an .html/.htm --save-report; use it on a report you plan to hand to a human reviewer, and keep the static/Markdown writers for tickets and archives.


Terminal reviewer

--tui turns a finished scan into a full-screen reviewer, so you can work through candidates without scrolling a terminal or opening a browser.

pathscope -i requests.txt --tui --ledger reviews.db
┌ candidates ──────────────────┬ details ─────────────────────────────┐
│*  1  71 HIGH file  a.test    │ #1 file                              │
│   2  48 MED  download  b.test│ host        a.test                   │
│   3  31 LOW  template  b.test│ location    query                    │
│                              │ rule        name-exact               │
│                              │ score       71/100 (high)            │
│                              │ fingerprint ec274fecea647284         │
│                              │ marked      yes                      │
└──────────────────────────────┴──────────────────────────────────────┘
 j/k move  / filter  c confidence  m mark  u unmark  s save  ? help  q quit
Key Action
j / k, arrows move down / up
g / G first / last
PgUp / PgDn page
/ filter by text (host, parameter, rule, fingerprint)
c cycle confidence filter: all → high → medium → low
m / u mark reviewed / unmark
s save marked fingerprints to --ledger
? help
q quit

The reviewer only reads the report and writes the ledger you name with --ledger. It never runs a scan, never sends a request, and refuses to start without a real terminal:

$ pathscope --tui --url 'https://a.test/?file=/x' < /dev/null
error: --tui needs an interactive terminal (stdin and stdout must be TTYs)

Marks are stored with a status (--ledger-status reviewed|accepted|false-positive|resolved), your name (--reviewer, default $USER) and an optional --review-note, so the ledger doubles as a record of who decided what.


Review ledger

--ledger FILE keeps reviews in a local SQLite database with a full audit trail: every mark, unmark, import and status change appends an event (who, what, when, why). Nothing leaves the file.

# Mark every current candidate as reviewed, with your name and a note
pathscope -i requests.txt --ledger reviews.db --ledger-mark-all \
          --reviewer dinesh --review-note "checked 2026-11-29"

# Later runs hide what you already reviewed (and say so on stderr)
pathscope -i requests.txt --ledger reviews.db

# Show everything again
pathscope -i requests.txt --ledger reviews.db --show-known
Command Purpose
--ledger FILE use (or create) the ledger; hides reviewed fingerprints
--ledger-mark-all record every candidate currently reported
--ledger-status STATUS reviewed (default), accepted, false-positive, resolved
--reviewer NAME who is making the call (defaults to $USER)
--review-note TEXT free-text note stored with the event
--ledger-query TEXT search host/parameter/rule/status/reviewer/note and exit
--ledger-export FILE write --baseline/--suppress compatible JSON and exit
--import-ledger FILE import a 2.1 flat JSON ledger and exit
$ pathscope --ledger reviews.db --ledger-query dinesh
PathScope ledger
====================================================================================
status           host        parameter   rule          reviewer  updated              fingerprint
reviewed         a.test      file        name-exact    dinesh    2026-11-29T11:40:48Z ec274fecea647284

Two details that matter in practice:

  • Hiding is never silent. Even with -q, a run that dropped reviews prints N candidate(s) already reviewed ... (use --show-known to include) to stderr, so a script reading stdout cannot mistake "0 candidates" for a clean result.
  • Export is lossless enough to share. --ledger-export produces the same fingerprint set --suppress/--baseline understood before 2.3, so existing pipelines keep working.

Analysis dashboard

--dashboard answers "what am I looking at?" before you read individual rows.

pathscope -i requests.txt --dashboard

It prints score distribution, mean and percentiles, which locations fired, the most frequent parameters and rules, and coverage gaps — hosts that produced no candidate at all, which is often the more interesting half of a review.

PathScope dashboard
Requests analysed  : 3
Parameters analysed: 6
Candidates         : 4
  high             : 1
  medium           : 2
  low              : 1
Mean score         : 47.5/100
Percentiles        : p50=48 p75=61 p90=66 p95=69 p99=71
Locations          : query=4

Most frequent candidates
  download                         2

Coverage gaps (hosts with no candidate)
  clean.test

--inventory is the "most consuming endpoints" view: hosts and paths ranked by how many distinct parameter names they accept. High fan-out usually means a central handler worth reading first.

pathscope -i requests.txt --inventory

Cross-source correlation

One request tells you what a parameter is called; many requests tell you what it is for. --correlate builds the parameter × host matrix and derives three views:

  • shared parameters — the same name on two or more hosts (a shared component, a copied handler, or the same app on several deployments),
  • clusters — parameters that always appear on exactly the same host set,
  • chained candidates — a value that embeds another candidate, i.e. a nested query string such as ?path=/view%3Ffile%3D%2Fa. Both keys must be candidates on the same host; the encoded inner key is decoded with the same documented, bounded decode used everywhere else.
pathscope -i requests.txt --correlate
Parameter x host matrix:
  download                     b.test x1
  file                         a.test x2

Shared across hosts (same component, different deployments?):
  file                         a.test, b.test

Chained candidates (a value embeds another candidate):
  a.test: path -> file

Correlation reads names only. Values are decoded in memory to find nested keys and are never printed.


Remediation playbooks

Every rule ships with a playbook: what the signal means, how to confirm it by hand, how to fix it, and a reminder that this is a heuristic, not a vulnerability.

pathscope --list-playbooks                     # what exists
pathscope -i requests.txt --playbook fix.md    # this run, as Markdown

The generated fix.md has one section per fired rule, ordered by best score, so the top of the file is the most useful thing to hand to a developer or paste into a ticket. Sections are self-contained: no server names beyond the ones you supplied, no values.


Run history and trends

--history FILE appends a compact record of each run — counts, bands, rules, settings and every candidate's fingerprint and parameter name only. Values are never written.

pathscope -i monday.txt  --history runs.json
pathscope -i friday.txt  --history runs.json
pathscope --trend runs.json
PathScope run trend
====================================================================================
Runs               : 2
Candidates per run : 5, 3
Sparkline          : █▃
New per run        : 5, 1
Resolved per run   : 0, 3
New in last run    : upload_file
Resolved in last   : file, download

Per parameter (first -> last run, drift):
  file            a.test  runs 1-2 (2x) drift -4

"Resolved" means a fingerprint that was present before and is gone now. That is a real signal (a fix, a removed parameter, or a renamed endpoint) and it is usually worth more than the count of new rows. The file keeps the last 2 000 runs.


Streaming stdin

--stream is for pipelines that never end: tail -f a capture, a recon tool writing URLs as it finds them, or a list too large to hold in memory.

tail -f capture.log | pathscope --stream --stream-batch 500
ffuf -o /dev/stdout ... | pathscope --stream
grep -E '=/' urls.txt | pathscope --stream --format json --save-report out.json

Memory stays bounded: lines are read one at a time, analysed in batches, and only the merged report is retained. --stream-json emits one JSON object per batch (plus a final {"complete": true, ...}) for a parent process to consume.

Constraint Reason
line-oriented input only HAR/OpenAPI need random access; using --stream with them is a usage error
one pass over stdin a stream cannot be rewound
--stream + --url is rejected otherwise the URL would be silently ignored
5 000 000-line safety cap runaway producers fail loudly instead of hanging

Exit codes follow the normal rules: --stream alone exits 0, and --fail-on-findings gates as usual. Emitting JSON never implies a gate.


Reproducible bundles

--bundle FILE writes one .zip you can attach to a ticket without leaking data. Values are scrubbed unconditionally, even if the run used --show-values.

pathscope -i requests.txt --bundle case-1234.zip
pathscope --inspect-bundle case-1234.zip
case-1234.zip
├── manifest.json      tool/version/exit code/counts/settings/hashes
├── report.json        the full machine-readable report
├── report.md          the human-readable report
├── playbook.md        remediation guide for the rules that fired
├── environment.json   OS, Python, terminal-independent facts
├── rules.json         effective rule weights
├── config.json        the config used, when one was supplied
└── README.txt         what this is and how to read it

Bundles are byte-for-byte reproducible: entry order, permissions and the timestamp are fixed (1980-01-01), so two runs on the same input produce identical archives and a hash in manifest.json is meaningful.


Secret scrubbing

Reports hide values by default. When you do need to see them (--show-values, usually while sharing a report), --scrub redacts anything credential-shaped:

pathscope -i requests.txt --show-values --scrub
file         a.test   query   71  HIGH   value <redacted:ba94fef9>
access_token a.test   query   64  MED    value <redacted:5f308125>

A value is redacted when either holds:

  • the name looks sensitive (token, secret, password, signature, session, api_key, authorization, …), or
  • the value looks like a credential: a known vendor prefix (ghp_, github_pat_, glpat-, sk_live_, AKIA, xoxb-, AIza, npm_, -----BEGIN, …), a long hex key, or a long high-entropy base64-ish string.

The marker is <redacted:sha256[:8]>: it is stable, so the same secret shows the same marker in two reports (you can tell "same value" from "different value") without the value being recoverable. Ordinary paths (/etc/passwd, report.pdf) are not scrubbed — they are the analysis, not a secret.

--no-scrub turns redaction off for the main report. Bundles still scrub; there is no flag that makes a bundle contain a credential.


Capture-to-capture diff

--baseline compares reports. --diff-capture compares captures, which answers a different question: what changed about the application?

pathscope --diff-capture monday.har -i friday.har
pathscope --diff-capture monday.har -i friday.har --diff-json > diff.json
Endpoints only in the new capture (1)
  GET https://new.test/api

Endpoints only in the old capture (1)
  GET https://old.test/api

Renamed parameters (same endpoint, shared name token) (1)
  GET https://a.test/view: file -> file_id [absolute-path]

New parameters (1)
  GET https://a.test/list: filter (query)

Removed parameters (1)
  GET https://a.test/list: sort (query)

Value shape changes (values are never printed) (1)
  GET https://a.test/doc: absolute-path -> uuid

Two deliberate choices:

  • Renames require evidence. A pair is called a rename only when the two names share a token (file → file_id, doc_path → file_path). Pairing on "the values look similar" produced confident nonsense (q → file), so file → document is reported as one removal plus one addition instead.
  • Shapes, never values. A changed value is described with the same vocabulary as demotion (absolute-path, uuid, traversal, …).

Exit code is 1 when anything differs, 0 when the captures match, which makes it usable as a "did the surface change?" CI check.


Offline URL extraction

--extract reads local HTML and JavaScript and pulls out the endpoints it finds in fetch(), axios, xhr.open, $.ajax, new URL, import(), href, src, action and formaction.

pathscope --extract dist/app.js --extract index.html
pathscope --extract app.js --extract-host app.test     # resolve relative paths
pathscope --extract app.js --extract-all-hosts         # keep third parties

The files are read, never fetched. Extraction then hands the strings to the normal analysis pipeline, so scoring, formats and exit codes are unchanged.

Origin handling is deliberately conservative, because resolving a relative path against the wrong host would invent an endpoint that does not exist:

Situation Behaviour
one host dominates the files that host is the origin
a single host that is not a known CDN/analytics domain trusted as the origin
a single host that looks third-party (cdn., fonts., …) refused, with a warning
several hosts, no clear winner refused, with a warning
--extract-host app.test used, no guessing
--extract-all-hosts every absolute URL is kept

When the origin is refused, relative paths are dropped and the warning says how to supply the host. --extract cannot be combined with --url/-i; run them as separate analyses.


Value statistics

--value-stats profiles the corpus without disclosing anything:

pathscope -i capture.har --value-stats
Parameters analysed : 412
Empty values        : 37
Mean length         : 23.4 chars
Longest value       : 512 chars

Value shapes
  text                 214   51.9%
  absolute-path         71   17.2%
  uuid                  33    8.0%
  traversal             12    2.9%
  ...

Encoding depth (percent layers)
  0                    388   94.2%
  1                     19    4.6%
  2                      5    1.2%

Entropy band
  low                  201   48.8%
  medium               167   40.5%
  high                  44   10.7%

This view contains counts and bands only: 0 values are disclosed.

It exists to answer "is this corpus full of encoded blobs?" before you read a single row. Every field is a count or a band; disclosed_values is always 0, and the test suite asserts that no value from the input can appear in the output.


Rule coverage

--rule-coverage compares the rule book with the rules that actually fired:

pathscope -i capture.har --rule-coverage

It lists rules that fired (with their weights), rules that stayed silent, rules with weight 0 (present but unable to move a score), disabled rules, and rule ids that appear in findings but not in the book.

The wording matters and is printed with the report:

A silent rule is not a dead rule: it may simply be the rule that stayed quiet on this capture. Review against several corpora before pruning.

Negative-weight rules are labelled as demotions, not as inert — they lower scores when they match, which is a job.


Term packs

A term pack is a project's custom path terms on their own, so they can be committed and shared instead of living inside somebody's personal config.

pathscope --init-terms acme.json      # write a valid starter pack
pathscope --list-terms acme.json      # validate and summarise
pathscope -i capture.har --terms acme.json
{
  "pack": "acme-api",
  "version": 1,
  "description": "Literal path-like parameter names for the document service.",
  "terms": ["attachment", "document", "receipt", "scan"],
  "ignore": ["utm_source", "utm_medium"]
}

Packs are strict, on purpose:

Rejected Why
"file.*", "/etc/passwd" terms are literals; no regex, no paths
duplicate terms a shared file should not depend on which copy wins
unknown keys ("include", "rules") a pack cannot pull in other files
wrong version the format is versioned so it can change safely
over 200 terms or 256 KB keeps scoring bounded and explained

Merge order is deterministic (config terms first, then packs in command-line order, first occurrence wins), so the scoring trace is identical on every machine that uses the same packs.


Preset comparison

--compare-presets shows how the three postures classify the same scored candidates:

pathscope -i capture.har --min-score 0 --compare-presets
  preset       threshold  reports   share
  minimal             50        1   33.3%
  balanced            25        2   66.7%
  noisy               10        3  100.0%

  score  minimal  balance  noisy    candidate
     71  yes      yes      yes      a.test query:file
     47  -        yes      yes      a.test query:download
     22  -        -        yes      a.test query:image

minimal reports 1, balanced 2, noisy 3; 2 candidate(s) are shown by a looser
threshold than minimal.
Choosing a preset changes what is shown, never what is scored; the underlying
evidence is identical.

Use it to pick a threshold from evidence instead of taste. Run with --min-score 0 so every scored candidate is visible; otherwise the preset thresholds filter the table itself.


Score calibration

Once the ledger holds real decisions, it is a small test set. --calibrate turns it into a threshold recommendation.

pathscope --ledger reviews.db --ledger-scores    # distribution by label
pathscope --ledger reviews.db --calibrate        # threshold recommendation
Accepted reviews      : 10
False-positive reviews: 10

  threshold  reported  recall  fp-rate
         40        13    100%      10%
         45        12    100%       0%  <- recommended
         50        10     83%       0%

Recommended --min-score 45: highest threshold keeping recall >= 90% with a
false-positive rate <= 20%.
  At that threshold the ledger would report 12 of 20 reviewed candidate(s):
  12/12 accepted, 0/10 false-positive.

The rule is stated in the output so the number is auditable:

  1. discard thresholds that would hide more than 10% of accepted candidates,
  2. among the rest pick the highest with a false-positive rate at or below 20%,
  3. if none qualifies, pick the lowest false-positive rate and say so.

With fewer than 8 labelled reviews nothing is recommended — a threshold derived from four decisions is a guess wearing a lab coat. Rows imported from a 2.1 ledger carry no score and are excluded with a note.


Project files

Drop a .pathscope/project.json in a repository and stop repeating flags:

{
  "project": "acme-api",
  "version": 1,
  "description": "Shared PathScope settings for this repository.",
  "config": "pathscope.json",
  "policy": "policy.json",
  "terms": ["terms/paths.json", "terms/vendor.json"],
  "ledger": "reviews.db"
}
pathscope --init-project .     # write a starter file
pathscope --show-project       # what was found and what it supplies
pathscope --no-project         # ignore it for this run

Discovery walks up from the working directory to the first project file, so running from src/api/ uses the repository's settings. Paths inside the file are resolved relative to the project directory and must stay inside it: an absolute path or a ../.. escape is an error, not a warning.

Precedence is simple and one-directional:

command-line flag  >  project file  >  config file  >  preset default

--show-project prints exactly which keys the project supplied and which were overridden by the command line. Missing referenced files are reported and ignored, so a fresh clone still runs.


Reviewed-aware CI

The ledger is also the place where "we looked at this and decided" lives. Every machine-readable output understands that decision:

Output What a reviewed finding becomes
SARIF a result with suppressions: [{kind: external, status: accepted}], so GitHub code scanning stops re-alerting
JUnit <skipped message="reviewed in the PathScope ledger"/>, counted in the skipped attribute, not failures
--policy excluded from the gate (a human already decided)
text/JSON/CSV status: "reviewed"

If you do want the gate to keep failing on reviewed findings:

pathscope -i capture.har --ledger reviews.db --policy policy.json --policy-include-reviewed
# or, permanently:
{"max_total": 0, "fail_on_reviewed": true}

--policy-include-reviewed also stops the ledger from hiding those rows, so the policy sees what it is being asked to judge.


Acceptance expiry

An acceptance with no expiry quietly becomes permanent. --ledger-expire puts a deadline on the decision itself:

pathscope -i capture.har --ledger reviews.db --ledger-mark-all \
          --ledger-status accepted --ledger-expire 30d
pathscope --ledger reviews.db --ledger-stale      # what has expired
pathscope --ledger reviews.db --ledger-refresh    # clear expiry (audited)
Spec Meaning
30d, 12h, 90m, 2w, 45s expires that long after the review is written
none never expires (the default, and explicit)

Expired reviews keep hiding their candidates until you deal with them — the point is to be reminded, not to have the finding reappear silently. Every review also records an owner (from --reviewer), so a stale acceptance has a name attached.

--ledger-refresh clears the expiry on stale rows and writes an extended event to the audit trail; nothing is deleted, so the history of "we kept accepting this" survives.

Ledgers written by 2.2/2.3 are migrated in place on first open: the new owner and expires_at columns are added with neutral defaults, and the schema version is bumped to 2.


Path families

Two hundred candidates are rarely two hundred decisions. --cluster groups them into route shapes, so you review the pattern once:

pathscope -i capture.har --cluster
4 candidate(s) collapsed into 4 family/families.

    #  score  conf    rows  family
    1     73  high       1  a.test/view  [query] file
    2     53  medium     1  a.test/items/{id}/view  [query] image
    3     53  medium     1  b.test/list  [query] template

Identifier-looking path segments become {id}. Version prefixes are kept, because v2 is a different surface and hiding it would defeat the purpose.

A family is a view, not a merge. Every row keeps its own fingerprint, and a review still covers one endpoint. That is deliberate: collapsing fingerprints would let one acceptance silently cover endpoints nobody looked at.

Note that with the default --dedupe-by path, three URLs that differ only by an identifier already collapse into one finding with occurrences: 3 before clustering runs. Use --dedupe-by none to keep them as separate rows.


Review queue

--queue answers a different question from "what scored highest": what should I look at next? It only contains work that is still open, and it accounts for how much a single decision covers.

pathscope -i capture.har --ledger reviews.db --queue --queue-limit 10
    1. [ 73] a.test/view  [query] file  (high, 1 row(s))
       priority 0.85  open  -- score 73/100, seen 3 time(s), high-confidence evidence
    2. [ 53] b.test/list  [query] template  (medium, 1 row(s))
       priority 0.55  open  -- score 53/100, primary rule name-exact

Ordering = 0.55*score + 0.30*leverage + 0.15*confidence.
  • Novelty — known and already-reviewed rows are excluded; --queue-all puts them back.
  • Leverage — how many endpoints one decision covers (family size, or the occurrence count after dedupe).
  • Confidence — high-confidence evidence ranks above low at equal score.

The weights are printed with the queue so the ordering is auditable. The queue only orders work; it never records a decision.


Scope files

A scan is only meaningful inside a boundary somebody wrote down. --scope-file declares it, and it is applied before analysis, so out-of-scope requests never become findings:

pathscope --init-scope scope.json     # starter file
pathscope -i capture.har --scope-file scope.json
{
  "scope": "acme-api assessment",
  "version": 1,
  "in_scope": ["api.acme.test", "*.acme.test", "acme.test/app/*"],
  "out_of_scope": ["legacy.acme.test", "*.vendor.test"]
}
Pattern Matches
api.acme.test that host exactly
*.acme.test one label only (api. yes, deep.api. no)
**.acme.test any number of labels
acme.test/app/* that host, one path segment

Rules that matter:

  • a pattern containing / matches host/path, otherwise it matches the host;
  • out_of_scope always wins — doubt resolves to exclusion;
  • an empty in_scope means "everything not explicitly excluded";
  • a file with neither list is rejected, because an empty scope that silently means "everything" is the one typo this must not allow;
  • whitelisting is refused for URLs: write a.test, not https://a.test.

Dropped requests are always counted out loud, even under --quiet, and a scope that drops everything says so instead of reporting "no input".

A scope file records intent, not permission. Holding one authorises nothing; see Authorization and legal.


Deterministic sampling

Large captures take time and produce reports nobody reads. --sample analyses a subset — and the same subset every time:

pathscope -i huge.har --sample 500 --sample-seed 7
# pathscope: sampled 500 of 41230 request(s) (1.2%) with seed 7 across 12 stratum/strata

Why it is trustworthy:

  • Reproducible — selection is SHA-256 over seed + request identity, not Python's hash(), whose value changes per process.
  • Stratified — proportional to host (default), --sample-by source, or --sample-by none. Every non-empty stratum gets at least one slot when the budget allows, because a rare host is exactly the one worth looking at.
  • Stable — sampling by hash means adding entries to a capture does not reshuffle the entries already chosen.
  • Blind to values — the sampling key excludes parameter values and scores, so the data cannot steer the sampler.

The seed and coverage always appear on stderr, so a sampled run can never be mistaken for a complete one.


API description matching

If the repository already contains an OpenAPI or Swagger document, --openapi compares the report against it:

pathscope -i capture.har --openapi api/openapi.json
spec      : Acme 1.0 [openapi] from api/openapi.json
operations: 2 described
coverage  : 3 finding(s) on described endpoints, 1 on undocumented ones (75.0% described)

Undocumented endpoints (1)
  GET    b.test/list  [query] template  (score 53)

Parameters the spec does not declare (1)
  GET /view                                download  [query] (score 53)

Two different questions, both useful: an endpoint nobody documented is where undocumented behaviour lives, and a parameter the spec forgot is what the code reads anyway.

server/basePath prefixes are applied, {name} templates match one segment, and request-body properties count as declared parameters. JSON only — a YAML document is refused with an explanation rather than half-parsed, because a partial parse of an API description produces confident nonsense.


Policy shadow mode

Adopting a policy is usually a one-way door: the first red build teaches everyone to add an exception. Shadow mode reports what a proposed policy would do without letting it fail anything:

pathscope -i capture.har --policy current.json --policy-shadow proposed.json
active: current.json
  verdict : would pass
proposed.json: proposed.json
  verdict : WOULD FAIL
  counted : 3 finding(s) (high 1, medium 2, low 0)
  violated: max_high=0 exceeded (1 found)
  by rule : name-exact x3
Difference
  proposed.json: would fail where the active policy passes

The exit code stays 0 whatever the shadow says, the report is never filtered by it, and it can be repeated. Watch a candidate gate for a week, then adopt it by moving the file to --policy.


Work-item export

Findings only help once they land where work happens. --export-ticket writes one Markdown work item per family (or per candidate):

pathscope -i capture.har --export-ticket tickets/
pathscope -i capture.har --export-ticket tickets/ --ticket-per-candidate

Each file carries the evidence table, the scoring reasons, the playbook's confirm-by-hand and fix steps, the fingerprint, and the --ledger command that records a decision. INDEX.md lists them all.

Filenames are derived from host, route and parameter, so re-running overwrites the same ticket instead of piling up duplicates.

Values are never written to a ticket, even with --show-values: a ticket is going to be pasted somewhere with different access controls than the terminal it came from.


Pull-request comments

--pr-comment writes a Markdown summary sized for a PR thread:

pathscope -i capture.har --pr-comment comment.md --run-id "$GITHUB_RUN_ID"
<!-- pathscope:comment -->

**PathScope: 4 new candidate(s) need review** (best score 73/100, high confidence).

`5` request(s) · `7` parameter(s) · `4` candidate(s) at score ≥ 25 · ...

| score | host | resource | parameter | location |
|---:|---|---|---|---|
| 73 | a.test | https://a.test/view | `file` | query |
  • The marker line lets a workflow find and update its previous comment instead of stacking a new one on every push.
  • The verdict follows the report, never a caller's guess: a comment that says "no new candidates" above a table of four is worse than no comment.
  • The output is budgeted (~5.5 KB by default, well under GitHub's limit) and truncates by whole rows, always saying how many were left out.
  • Pipes are escaped so a parameter name cannot break the table.
  • No timestamp in the body, so a diff shows what actually changed.

Host redaction

A report names hosts and paths. That is fine on the capture machine and not fine in a ticket, a slide, or a vendor email.

pathscope -i capture.har --redact-hosts
python3 path_detector.py --redact-hosts --redact-key "$TEAM_SHARE_KEY" ...

Every host becomes a stable pseudonym (host-c137d9f4), in every format and in every artefact written by that run — reports, tickets, PR comments and bundles.

Property Behaviour
stability the same host is the same pseudonym throughout the run
with --redact-key stable across runs, so two reports still correlate
without a key a random per-run key: pseudonyms are useless outside the report
keyed, not hashed it is HMAC-SHA-256, so a short hostname cannot be reversed by guessing
paths untouched — /items/8811/view still reads as a route
ports preserved (:8443 survives)
localhost left alone
fingerprints unchanged — they are opaque, and rewriting them would invalidate every baseline and ledger row

Redaction is always announced on stderr, even with --quiet.


Shell completion

pathscope --completion bash  > /etc/bash_completion.d/pathscope
pathscope --completion zsh   > "${fpath[1]}/_pathscope"
pathscope --completion fish  > ~/.config/fish/completions/pathscope.fish
pathscope --completion powershell >> $PROFILE

The script is generated from the real argument parser, not maintained by hand, so it cannot drift: a flag added to the parser appears in completion the moment it exists, or nowhere at all. Value choices (--format, --ledger-status, --sample-by, …) are completed from the parser's own choices.


Waivers

The ledger is a good review store and a bad review artefact: it is SQLite, it lives beside whoever ran the scan, and a pull request cannot show a diff of it. A waiver file is the opposite — plain JSON, in the repository, reviewed like code:

pathscope --init-waivers waivers.json
pathscope -i capture.har --waivers waivers.json
{
  "version": 1,
  "waivers": [
    {
      "host": "api.acme.test",
      "path": "/documents/*",
      "parameter": "file",
      "rule": "name-exact",
      "reason": "validated against a signed allow-list upstream",
      "owner": "platform-team",
      "expires": "2027-01-31",
      "ticket": "SEC-1234"
    }
  ]
}
Rule Why it exists
reason and owner are required an exception without either is anonymous and permanent
at least one of host/path/parameter/rule/location {} would waive every finding in every future run
expires must be YYYY-MM-DD a duration restarts every run, so it never expires
unknown keys are errors a typo in expirse must not create an immortal waiver

Waived findings are hidden and announced, exactly like ledger reviews; --show-known reveals them with their justification. --waivers also stops --policy from failing on them — that is what a waiver is for.


Suppression audit

Every suppression rots, and it rots silently, because suppressed rows are removed before rendering. --suppression-audit reads the inputs and reports what they are actually doing:

pathscope -i capture.har --baseline base.json --waivers waivers.json \
          --ledger reviews.db --show-known --suppression-audit
Baseline / suppression files (2)
  [live     ] 2cc01c9e8a375a9e  -- matched 1 finding(s)
  [DEAD     ] deadbeefdeadbeef (old)  -- matched 0 finding(s)

Waivers (1)
  [EXPIRED  ] a.test /view file  -- matched 1 finding(s)

Summary
  live       : 1
  dead       : 1
  overbroad  : 0
  expired    : 1
  • dead — matched nothing: an endpoint renamed, a parameter removed, a rule changed. It looks like coverage in review and hides nothing in a run.
  • overbroad — one entry hiding more than 10 findings, usually a waiver that named only a host.
  • expired — the acceptance outlived its date and no longer hides anything.

The audit is read-only. Nothing is removed automatically; a human edits the file.


Rule precision

The ledger records what humans decided. Comparing that with the rules that produced each finding gives each rule a precision:

pathscope --ledger reviews.db --rule-precision
  rule                       labelled accepted    fp precision  verdict
  name-exact                       15       12     3       80%  earning its weight
  name-weak                        10        1     9       10%  candidate for demotion
  value-extension                   4        4     0      100%  thin evidence

Only accepted and false-positive count. reviewed means somebody looked, not what they concluded, so it carries no signal.

Under 5 labelled findings a rule is reported but never judged — a precision from four rows is a coincidence. Every contributing rule is counted, not just the primary one.


Rule impact

--rule-coverage says whether a rule fired. --rule-impact says whether it decided anything:

pathscope -i capture.har --rule-impact
  rule                         weight  seen leading deciding  points  share
  name-exact                       35     3       3        2     105   48.8%
  value-absolute                   12     3       1        1      36   16.7%
  value-multi-segment               6     3       0        0      18    8.4%

deciding counts findings that would fall below the threshold without the rule. A rule can fire 300 times and decide nothing, and another can fire twice and decide everything. Demotions are shown with their sign rather than pretending they have no effect.


Weight simulation

Changing a weight is a guess unless you can see what it does. --simulate re-analyses the same input under hypothetical weights:

pathscope -i capture.har --simulate "name-weak=-10,value-absolute=off"
Candidates
             before      after delta
  total          4  ->  0        -4
  high           1  ->  0        -1

No longer reported (4)
  - a.test/view [query] download

Syntax: rule=-10, rule=off (disable), rule=default (reset). Comma separated, one change per rule.

It re-analyses rather than subtracting the rule's share from recorded scores, because scores are capped at 100, demotions can floor them at 0, and removing the leading rule changes which rule is primary. Arithmetic on the recorded score would be wrong in all three cases.

The real report is printed unchanged and the exit code is untouched, so --simulate is safe in a pipeline. Apply a change through a --rules file.


Score-change explanation

--baseline answers "what is new". This answers a different question: the finding did not appear or disappear — why did its score move?

pathscope -i before.har --format json > before.json
pathscope -i after.har  --format json > after.json
pathscope --explain-diff before.json --explain-diff after.json
tracked 4 finding(s): 3 changed score, 1 unchanged.

  a.test/view [query] file: 73 -> 53 (-20)
    confidence high -> medium
    + parameter name contains path-related term 'file' (+15, was +35)

Identity is (host, path, parameter, location) — the tuple that survives new values and different source labels — so a finding is tracked even when its primary rule changed.

Where the saved report has signed contributions, the diff names the exact rule whose evidence moved. Where it does not, it says so rather than inventing a cause.


Filtering with --where

pathscope -i capture.har --where "score > 60 and confidence = high"
pathscope -i capture.har --where "host ~= *.api.test and not status = known"
pathscope -i capture.har --where "rule starts_with name- or parameter in file,template"
Part Supported
fields host, resource, parameter, location, rule, confidence, status, method, source, fingerprint, score, occurrences
operators = != > >= < <= ~= (glob) in starts_with ends_with contains
combining and (binds tighter than) or, not
values bare words, or "quoted strings"

eval is never used. The expression is tokenised, parsed into a small tree, and applied through a fixed set of field accessors, so a crafted expression can filter rows — it cannot execute anything.

Errors name the position: unknown field 'scor' at position 1 (known: ...). A filter that silently matches nothing is how people decide a tool is broken.

--where changes what you see, never the exit code: --fail-on-findings and --policy still judge the unfiltered set, so a filter cannot create a false green. --where-json writes just the matched findings.


Run attestation

An attestation binds a run to its inputs and settings:

pathscope -i capture.har --format json --attest run.attest.json > report.json
pathscope -i capture.har --format json --verify-attest run.attest.json > report2.json
{
  "tool": "PathScope",
  "version": "2.6.0",
  "schema": 1,
  "created": "2026-11-29T10:11:12Z",
  "digests": { "inputs": "sha256:...", "settings": "sha256:...", "output": "sha256:..." },
  "counts": { "requests": 5, "parameters": 7, "candidates": 3 },
  "signature": null,
  "signature_note": "not signed: an attestation is a digest, not proof of authorship"
}

What it is: a digest. Two runs with the same input bytes and the same settings produce the same input and settings digests, and an edited report no longer matches its output digest.

What it is not: a signature. It says nothing about who ran it — that needs a key, and PathScope has no keystore. The file says so in its own body rather than implying more.

Input digests cover bytes, so attesting a capture full of secrets discloses nothing about them. Values never appear in an attestation.


Owner assignment

pathscope -i capture.har --ledger reviews.db --assign-owners alice,bob,carol
pathscope -i capture.har --assign-owners alice,bob,carol --assign-dir work/
  bob                          1   25.0%  ########
  carol                        3   75.0%  ######################

Assignment uses a rendezvous hash: hash each finding against each owner and give it to the highest scorer. That buys three properties round-robin cannot:

  • the same finding goes to the same owner on every machine, so re-running does not reshuffle a half-finished review;
  • adding findings never moves an existing one;
  • adding an owner takes a proportional share instead of reassigning everything.

--assign-by host (default) keeps all of one host's work with one person, so two people never reach different conclusions about the same code. Also available: path, parameter, rule, foundry.

Shares are proportional in expectation, not forced equal — forcing exact balance would break both stability properties. The real split is printed, so an uneven result is visible rather than hidden.


Ledger merge

Two reviewers, two local ledgers, both full of real decisions.

pathscope --ledger mine.db --ledger-merge theirs.db            # dry run
pathscope --ledger mine.db --ledger-merge theirs.db --merge-apply
  added     : 1
  unchanged : 0
  conflicts : 1
Situation Behaviour
same fingerprint, same status keep the newer updated_at; nothing was in dispute
same fingerprint, different status a conflict, both decisions shown
only in one ledger carried across untouched

--merge-prefer newer\|left\|right makes the rule explicit instead of implicit. The dry run is the default because a merge that runs by accident is unrecoverable.

Audit events are never rewritten: the destination records each merged row as a merged event, so "alice accepted this on the 3rd" survives a merge that preferred bob's later decision.


Exit codes

Code Meaning
0 Analysis completed. No candidates (or candidates found without --fail-on-findings).
1 --fail-on-findings and at least one candidate was reported (in diff mode: at least one new candidate), or a --policy was violated.
2 Usage error, unreadable/malformed input file, invalid configuration, or no usable input.
3 Internal error while producing a report (never a crash trace).
130 Interrupted with Ctrl-C.

--fail-on-findings is designed for CI: 0 means “nothing to look at”, 1 means “somebody should read this report”. It never redefines 2.


Detection rules

A parameter’s score is the sum of the weights of the rules that fired, clamped to 0–100. Names and values are evaluated independently and then combined. All rules live in pathscope/heuristics.py and are safe to edit.

Name rules (pathscope.heuristics.analyze_name)

Rule Weight Fires when
name-exact +35 (+5 multiword) a token is a path term: file, filepath, document, download, attachment, path, dir, folder, base_path, template, include, page, view, layout, config, log, script, resource, asset, storage, locale, …
name-custom +30 a token matches a term from --config name_terms
name-compound +35 the whole name is a known compound without separators (filepath)
name-prefix +28 the name starts with a path term (filedata)
name-suffix +23 the name ends with a path term (resolvepath)
name-weak +5 multiword name without a path term — never enough on its own
name-folded +20 the term appears only after diacritic/compatibility folding
name-leet +12 the term appears only after leet expansion (f1le → file)
name-i18n +25 the term comes from an enabled language pack
name-i18n-fold +21 a pack term that only matches after folding
name-generic 0 generic names (image, img, target, ref, avatar, …) only count with a path-like value

utm_source, gclid, page_size, urlencoded, landscape, sort and similar ordinary names do not produce findings.

Value rules (pathscope.heuristics.analyze_value)

Values are decoded up to --max-decode-passes times (default 3, hard max 5) with malformed escapes left intact. Traversal is matched as a path segment, so report..pdf or v1..2 never match.

Rule Weight Example value
value-traversal +30 ../../etc/passwd, ..\..\win.ini, bare ..
value-encoded-traversal +15 %2e%2e%2f, ..%2f, %252e%252e%252f
value-encoded-slash +12 %2f, %5c
value-double-encoded +10 value needed ≥2 decoding passes
value-absolute +12 /var/www/html (not //cdn)
value-windows-drive +15 C:\Windows\win.ini, D:/data
value-unc +15 \\server\share\x
value-multi-segment +6 three or more separators
value-extension +8 .pdf, .php, .tar.gz on a path-like value
value-path-list +5 a.css;b.css
value-full-url −10 https://other.test/x (usually a redirect target)
value-pairs-with-generic-name +10 image=/static/logo.png
value-demote-* −8 … −20 UUID, hash, JWT, base64, e-mail, IP, scalar (see Value-shape demotion)

Confidence bands (heuristic, not exploitability)

Score Label
70–100 high
40–69 medium
0–39 low

The default threshold is 25 (--min-score). Recommended interpretation: read high and medium first, low only when you have time. A score is a reading priority, never a risk rating.

Tuning

  • Add project-specific vocabulary: --config name_terms (literal strings only).
  • Silence known-noisy names: --ignore-param NAME (repeatable) or --config ignore_params.
  • Change weights at runtime with --rules FILE / --disable-rule RULE, or permanently in pathscope/rules.py; --list-rules always reflects the effective values.
  • Change the vocabulary by editing PATH_NAME_TERMS, GENERIC_NAME_TERMS, FILE_EXTENSIONS (English) or pathscope/naming.py (other languages); the tests exercise these tables.
  • Widen the name layer with --name-lang de,es,… and narrow the value layer with --no-demote.

Command-line reference

python3 path_detector.py [-h] [--version] [--url URL] [-i FILE]
                         [--format FORMAT] [--input-format FORMAT]
                         [--output-format {text,json,csv,sarif,markdown,html,junit}]
                         [--json] [--show-values] [--no-color] [--no-banner] [-q]
                         [--save-report FILE] [--interactive] [--progress] [--stats]
                         [--github-annotations] [--top N] [--group-by FIELD]
                         [--summary-only] [--preset NAME] [--baseline FILE]
                         [--suppress FILE] [--mark-reviewed FILE] [--show-known]
                         [--explain PARAM] [--explain-value VALUE]
                         [--init-config FILE] [--init-policy FILE]
                         [--rules FILE] [--list-rules] [--disable-rule RULE]
                         [--name-lang LIST] [--no-fold] [--no-demote]
                         [--dedupe-by {path,param,none}] [--max-entries N]
                         [--policy FILE|JSON] [--watch FILE] [--interval SECONDS]
                         [--self-test] [--ignore-param NAME] [--config FILE]
                         [--min-score N] [--max-decode-passes N]
                         [--fail-on-findings] [--doctor]
                         [--tui] [--ledger FILE]
                         [--ledger-mark-all]
                         [--ledger-status {reviewed,accepted,false-positive,resolved}]
                         [--reviewer NAME] [--review-note TEXT]
                         [--ledger-query TEXT] [--ledger-export FILE]
                         [--import-ledger FILE]
                         [--dashboard] [--inventory] [--correlate]
                         [--playbook FILE] [--list-playbooks]
                         [--history FILE] [--trend FILE]
                         [--scrub | --no-scrub] [--bundle FILE]
                         [--inspect-bundle FILE]
                         [--stream] [--stream-batch N] [--stream-json]
                         [--diff-capture FILE] [--diff-json]
                         [--extract FILE] [--extract-host HOST]
                         [--extract-all-hosts]
                         [--value-stats] [--rule-coverage]
                         [--terms FILE] [--init-terms FILE] [--list-terms FILE]
                         [--compare-presets] [--calibrate] [--ledger-scores]
                         [--ledger-expire DURATION] [--ledger-stale]
                         [--ledger-refresh] [--policy-include-reviewed]
                         [--show-project] [--init-project DIR] [--no-project]
                         [--cluster] [--queue] [--queue-limit N] [--queue-all]
                         [--policy-shadow FILE] [--sample N] [--sample-seed K]
                         [--sample-by {host,source,none}]
                         [--scope-file FILE] [--init-scope FILE]
                         [--openapi FILE] [--openapi-json]
                         [--export-ticket DIR] [--ticket-per-candidate]
                         [--ticket-limit N]
                         [--pr-comment FILE] [--run-id TEXT] [--pr-rows N]
                         [--redact-hosts] [--redact-key SECRET]
                         [--redact-prefix TEXT] [--redact-length N]
                         [--completion SHELL]
                         [--waivers FILE] [--init-waivers FILE] [--list-waivers]
                         [--suppression-audit] [--audit-json]
                         [--rule-precision] [--rule-impact]
                         [--simulate CHANGES] [--simulate-json]
                         [--explain-diff OLD.json]
                         [--where EXPR] [--where-json]
                         [--attest FILE] [--verify-attest FILE]
                         [--assign-owners LIST] [--assign-by KEY] [--assign-dir DIR]
                         [--ledger-merge OTHER] [--merge-apply]
                         [--merge-prefer {newer,left,right}] [--merge-json]
Option Description
--url URL URL to analyze; repeatable.
-i, --input FILE URL list or HAR file; repeatable; - reads stdin.
--format FMT Input selector (har, urls, auto) or output format (text, json, csv, sarif).
--input-format FMT Explicit input selector when --format is used for output.
--output-format FMT Report format (same as --format json etc.).
--json Shorthand for --output-format json.
--show-values Reveal parameter values (hidden by default).
--ignore-param NAME Ignore a parameter name; repeatable.
--config FILE JSON configuration (see below).
--min-score N Reporting threshold, 0–100 (default 25).
--max-decode-passes N Percent-decoding passes per value, 0–5 (default 3).
--fail-on-findings Exit 1 when candidates exist (new ones only in diff mode).
--preset NAME Reporting posture: minimal, balanced, noisy.
--baseline FILE Diff against a previous JSON report.
--suppress FILE Hide reviewed fingerprints.
--mark-reviewed FILE Write reviewed fingerprints to a ledger.
--show-known Keep baseline/suppressed findings visible.
--explain PARAM Print the scoring trace for one parameter and exit.
--explain-value VALUE Value to score with --explain (inert string).
--init-config FILE Write a starter configuration and exit.
--save-report FILE Also write a .md/.html report.
--top N Show only the N best text candidates.
--group-by FIELD Group text output by host, rule, confidence, location.
--summary-only Compact counts-per-host/rule view.
--interactive Add sorting/filtering/review boxes to an HTML --save-report.
--progress Phase progress on stderr (stdout stays machine-readable).
--stats Timings and counts on stderr, and in the JSON payload.
--github-annotations Emit GitHub Actions annotations on stdout.
--output-format junit JUnit XML for CI test reports.
--list-rules Print every rule, effective weight and description.
--rules FILE JSON weight overrides ({"weights": {...}, "disable": [...]}).
--disable-rule RULE Remove a rule from scoring; repeatable.
--name-lang LIST Term packs: de,es,fr,pt,it,nl, auto, off.
--no-fold Disable diacritic/compatibility folding.
--no-demote Disable value-shape demotion.
--dedupe-by MODE path (default), param or none.
--max-entries N Analyse at most N input entries (0 = unlimited).
--policy FILE|JSON CI gate; exit 1 when violated.
--init-policy FILE Write a starter policy and exit.
--watch FILE Re-analyse a growing capture; print new candidates only.
--interval SECONDS Polling interval for --watch (default 2).
--self-test Run the built-in environment checks (exit 1 on failure).
--doctor Check this installation: interpreter, sqlite3, zipfile, curses, package files.
--tui Interactive terminal reviewer (needs a TTY and --ledger).
--ledger FILE SQLite review ledger; hides reviewed candidates and keeps an audit trail.
--ledger-mark-all Record every reported candidate in the ledger.
--ledger-status STATUS reviewed (default), accepted, false-positive, resolved.
--reviewer NAME Who is reviewing (default: $USER); written to the audit trail.
--review-note TEXT Note stored with the ledger event.
--ledger-query TEXT Search the ledger (host/parameter/rule/status/reviewer/note) and exit.
--ledger-export FILE Export review fingerprints in --baseline format and exit.
--import-ledger FILE Import a 2.1 flat JSON ledger and exit.
--dashboard Distribution, percentiles, frequent rules and coverage gaps.
--inventory Endpoints ranked by distinct parameter count.
--correlate Parameter × host matrix, shared parameters, clusters, chains.
--playbook FILE Write a Markdown remediation guide for this run.
--list-playbooks List the installed playbooks and exit.
--history FILE Append this run to a JSON history file (values never stored).
--trend FILE Analyse a history file and print the trend, then exit.
--scrub Redact credential-shaped values when --show-values is used.
--no-scrub Disable redaction in the main report (bundles always scrub).
--bundle FILE Write a reproducible, scrubbed .zip support bundle.
--inspect-bundle FILE Print a bundle's manifest and file list, then exit.
--stream Read line-oriented input from stdin with bounded memory.
--stream-batch N Analyse and report every N streamed requests (default 200).
--stream-json With --stream, emit one JSON object per batch.
--diff-capture FILE Compare -i captures against an earlier one; exit 1 when they differ.
--diff-json With --diff-capture, emit JSON instead of text.
--extract FILE Extract endpoints from a local HTML/JS file and analyse them; repeatable.
--extract-host HOST Resolve relative URLs from --extract against this host.
--extract-all-hosts Keep endpoints on every host found in --extract files.
--value-stats Length/encoding/entropy profile of values; no value is shown.
--rule-coverage Which rules fired, stayed silent, are disabled or weigh zero.
--terms FILE Load custom literal terms from a term pack; repeatable.
--init-terms FILE Write a validated starter term pack and exit.
--list-terms FILE Validate term pack(s) and print a summary, then exit.
--compare-presets How minimal/balanced/noisy classify the same candidates.
--calibrate Recommend --min-score from accepted vs false-positive reviews.
--ledger-scores Score distribution of ledger reviews, by label.
--ledger-expire DURATION Expiry for reviews written this run (30d, 12h, none).
--ledger-stale List expired reviews and exit.
--ledger-refresh Clear the expiry on stale reviews (audited) and exit.
--policy-include-reviewed Let --policy fail on findings already reviewed.
--show-project Show the discovered project file and what it supplies, then exit.
--init-project DIR Write DIR/.pathscope/project.json and exit.
--no-project Ignore any .pathscope/project.json above the working directory.
--cluster Collapse candidates into path families and review once per shape.
--queue Print unreviewed work ordered by score, novelty and leverage.
--queue-limit N Items to show with --queue (default 20; 0 = all).
--queue-all With --queue, include known and reviewed candidates.
--policy-shadow FILE Evaluate a proposed policy without failing the build; repeatable.
--sample N Analyse a deterministic subset of N requests (0 = everything).
--sample-seed K Seed for --sample; the same seed always selects the same subset.
--sample-by KEY Stratify --sample by host (default), source or none.
--scope-file FILE JSON file declaring in-scope and out-of-scope hosts.
--init-scope FILE Write a starter scope file and exit.
--openapi FILE Compare findings against a local OpenAPI/Swagger JSON file.
--openapi-json With --openapi, emit the comparison as JSON.
--export-ticket DIR Write one Markdown work item per family into DIR.
--ticket-per-candidate With --export-ticket, one ticket per candidate.
--ticket-limit N With --export-ticket, write at most N tickets (0 = all).
--pr-comment FILE Write a compact Markdown summary for a pull-request comment.
--run-id TEXT Identifier written into --pr-comment so CI can update in place.
--pr-rows N Table rows in --pr-comment (default 10).
--redact-hosts Replace every host with a stable pseudonym in all outputs.
--redact-key SECRET Key for --redact-hosts so pseudonyms are stable across runs.
--redact-prefix TEXT Prefix for --redact-hosts pseudonyms (default host-).
--redact-length N Hex characters in --redact-hosts pseudonyms (default 8).
--completion SHELL Print a completion script generated from the parser (bash/zsh/fish/powershell).
--waivers FILE Load committable JSON waivers; repeatable.
--init-waivers FILE Write a starter waiver file and exit.
--list-waivers Show the loaded waivers and what each matched.
--suppression-audit Report dead, overbroad and expired suppressions.
--audit-json With --suppression-audit, emit JSON.
--rule-precision Precision per rule from labelled ledger reviews, then exit.
--rule-impact How much each rule contributes to what is reported.
--simulate CHANGES Re-analyse under hypothetical weights, e.g. name-weak=-10,x=off.
--simulate-json With --simulate, emit JSON.
--explain-diff OLD.json With a second report, explain which scores moved and why; then exit.
--where EXPR Filter findings, e.g. score > 60 and confidence = high.
--where-json With --where, emit the filtered findings as JSON.
--attest FILE Write a JSON digest of inputs, settings and output.
--verify-attest FILE Check a report against an attestation.
--assign-owners LIST Split open work across owners.
--assign-by KEY Stratum for --assign-owners (host/path/parameter/rule/foundry).
--assign-dir DIR Write one Markdown worklist per owner into DIR.
--ledger-merge OTHER Plan a merge of OTHER into --ledger (dry run unless --merge-apply).
--merge-apply With --ledger-merge, actually write the merge.
--merge-prefer SIDE Which side wins a status conflict (newer/left/right).
--merge-json With --ledger-merge, emit the plan as JSON.
-q, --quiet Suppress warnings and the stderr summary.
--no-color Disable colour on terminals.
--no-banner Suppress the startup banner.
-h, --help / --version Help / version and exit.

Configuration file

A small JSON file, validated strictly. Unknown keys, wrong types, values out of range, and anything that looks like a regular expression are rejected with a clear error and exit code 2.

{
  "extends": "balanced",
  "name_terms": ["download", "media_file", "cdn_blob"],
  "ignore_params": ["image", "avatar"],
  "min_score": 25,
  "max_decode_passes": 3,
  "weak_names": true,
  "show_values": false
}
Key Type Rules
name_terms array of strings 2–48 chars, letters/digits/_/- only, max 200 entries
ignore_params array of strings same rules
min_score integer 0–100
max_decode_passes integer 0–5
weak_names boolean enables the weak name-weak rule (default true)
show_values boolean defaults values to visible; --show-values also works
name_lang array enabled term packs (["de","es"], ["auto"] or [])
fold_names boolean diacritic/compatibility folding (default true)
demote_shapes boolean UUID/hash/scalar demotion (default true)
extends string base preset (minimal/balanced/noisy) or another .json file, relative to this file
python3 path_detector.py --config pathscope.json -i urls.txt

Regular expressions are deliberately unsupported: they add a catastrophic-backtracking risk to a passive tool and make results harder to explain. Literal terms keep every finding traceable to a readable rule. extends may chain up to 4 files; cycles and missing bases are rejected with a clear error and exit code 2. Lists merge (base first), scalars override.


Tests

The suite uses only unittest and runs fully offline.

python3 -m unittest discover -s tests -v
# or directly
python3 tests/test_path_detector.py

769 tests cover exactly the behaviours this tool promises:

Area What is asserted
Query parsing repeated parameters, occurrence counters, encoded names/values, + in names, blank values, encoded &/=, IPv6 hosts
Value heuristics literal/encoded/partially-encoded/double-encoded traversal, bounded decoding, segment-only matching (report..pdf does not match), Windows/UNC/absolute paths, full-URL penalty, malformed % sequences
Name heuristics snake_case/kebab-case/camelCase, exact/compound/prefix/suffix/custom terms, generic names, ordinary names produce nothing
HAR query, form (postData.params and urlencoded text), JSON bodies with arrays, duplicate entries, malformed entries, missing log, invalid JSON, BOM, version warnings
Malformed input unreadable files, directories, binary data, oversized values, control characters
Redaction values hidden by default in every format, --show-values reveals them, credentials masked
Formats stable JSON/CSV/SARIF, SARIF ruleIndex consistency, CSV columns, deterministic ordering
Safety import allow-list, no socket use (patched to raise), values never passed to open, no root/shell calls
Presets & config thresholds, aliases, extends chains, cycles, depth limit, --init-config
Baselines fingerprint stability, known/new/resolved counts, notes, suppression ledgers, CI exit codes
Extra inputs Burp XML (base64 + plain + multipart), OpenAPI query/body inventory, raw HTTP with ###, recon lines and JSONL
Reports Markdown/HTML content and escaping, --save-report, SARIF fingerprints
UX --top, --group-by, --summary-only, --explain
Watch mode stable polls, new-only output, rotation, Ctrl-C, missing file
Rules registry validation, overrides, disabling, --list-rules, --explain
i18n & folding fullwidth/diacritic/leet names, packs, English-first precedence
Demotion every shape, thresholds, --no-demote, disabled rules
CI policy evaluation, JUnit XML, GitHub annotation escaping, self-test
Tool exports Postman, ZAP, mitmproxy, GraphQL, cookie jars (names only)
Scale dedupe modes, --max-entries, --stats, rate-limited progress
Interactive controls, escaping, self-containment, HTML-only enforcement
Terminal reviewer cursor/filter/mark state machine, headless curses render, no-TTY refusal
Review ledger record/forget/audit events, reviewed hiding, query, export, 2.1 import
Dashboard percentiles, bands, coverage gaps, inventory ranking
Correlation matrix, shared parameters, host clusters, encoded chains
Playbooks per-rule coverage, Markdown export, --list-playbooks
History append/load, no values stored, new/resolved, sparkline, corrupt file
Streaming batching, dedupe, comments/blanks, format rejection, line cap, JSON batches
Bundles layout, scrubbing, byte reproducibility, manifest roundtrip, bad zip
Scrub vendor prefixes, high-entropy values, name hints, stable markers, --no-scrub
Packaging install.sh POSIX-ness, dry run, unknown option, Dockerfile, --doctor
Acceptance expiry unit parsing, stale/upcoming, refresh audit, v1→v2 migration in place
Capture diff renames vs unrelated names, shape/location changes, JSON, exit codes
Extraction fetch/axios/xhr/attributes, origin inference, CDN refusal, no-network
Value stats buckets, encoding depth, zero disclosure in output
Rule coverage fired/silent partition, disabled, inert vs demotion, unknown rules
Term packs regex and duplicate rejection, merge order, CLI round trip
Preset comparison thresholds, per-score classification, monotonic counts
Calibration recall/fp bounds, thin-evidence guard, scoreless rows excluded
Project files upward discovery, containment, precedence, --no-project
Reviewed CI SARIF suppressions, JUnit <skipped>, policy include/exclude
Path families route shapes, identifiers vs words, versions, no fingerprint merge
Review queue ordering, novelty exclusion, leverage via size and occurrences
Scope files wildcard breadth, exclusion precedence, empty-scope refusal
Sampling reproducibility, stratification, stability, order preservation
API matching templates, base paths, body properties, YAML refusal
Shadow mode never fails the build, repeatable, side-effect free
Work items per-family vs per-candidate, no values, stable filenames
PR comment marker, honest verdict, row budget, pipe escaping
Redaction keyed stability, paths preserved, fingerprints untouched
Completion all four shells, bash syntax, tracks new parser flags
Waivers required reason/owner, expiry is a date, expired hides nothing
Suppression audit live/dead/overbroad/expired, read-only
Rule precision per-rule precision, thin evidence unjudged, labels only
Rule impact points, deciding vs appeared, demotion signs
Simulation spec parsing, re-analysis, never mutates the real book
Explain diff tracked identity, rule-level causes, tamper evidence
--where operators, precedence, clear errors, no eval anywhere
Attestation digest stability, tamper detection, unsigned by design
Assignment determinism, one owner per stratum, stability under growth
Ledger merge conflicts surfaced, dry run default, audit preserved

Project layout

pathscope/
├── path_detector.py            # executable entry point (thin wrapper)
├── pathscope/
│   ├── __init__.py             # name, version, branding constants
│   ├── textutil.py             # decoding (bounded), sanitising, truncation
│   ├── heuristics.py           # name/value rules and scoring
│   ├── sources.py              # URL, list, stdin and HAR 1.2 parsing
│   ├── detector.py             # request → findings (no I/O)
│   ├── report.py               # text, JSON, CSV, SARIF renderers, banner
│   ├── config.py               # strict JSON configuration + extends
│   ├── presets.py              # minimal / balanced / noisy postures
│   ├── extra_formats.py        # Burp XML, OpenAPI, raw HTTP, recon exports
│   ├── rules.py                # rule registry, weights, overrides
│   ├── naming.py               # folding, leet variants, language packs
│   ├── valueshape.py           # UUID/hash/JWT/base64/email/IP/scalar demotion
│   ├── tool_formats.py         # Postman, ZAP, mitmproxy, GraphQL, cookies
│   ├── policy.py               # CI policy evaluation
│   ├── ci.py                   # JUnit, GitHub annotations, --self-test
│   ├── watch.py                # live re-analysis (--watch)
│   ├── progress.py             # stderr progress (--progress)
│   ├── writers.py              # Markdown / HTML / interactive HTML reports
│   ├── cli.py                  # argument parsing, input merging, exit codes
│   ├── tui.py                  # curses terminal reviewer (--tui)
│   ├── ledger.py               # SQLite reviews + audit trail (--ledger)
│   ├── analytics.py            # dashboard, inventory, correlation
│   ├── playbooks.py            # per-rule remediation guidance
│   ├── history.py              # run history, trends, sparklines
│   ├── stream.py               # bounded-memory stdin analysis (--stream)
│   ├── bundle.py               # reproducible, scrubbed support bundles
│   ├── scrub.py                # credential-shaped value redaction
│   ├── capturediff.py          # capture-to-capture structural diff
│   ├── extractor.py            # offline URL extraction from HTML/JS
│   ├── termpacks.py            # shareable literal term packs
│   ├── calibrate.py            # ledger-driven score calibration
│   ├── project.py              # .pathscope/project.json discovery
│   ├── families.py             # route-shape clustering
│   ├── queue.py                # prioritised review queue
│   ├── scope.py                # authorisation scope files
│   ├── sampling.py             # deterministic stratified sampling
│   ├── openapi.py              # OpenAPI/Swagger comparison
│   ├── shadow.py               # policy shadow evaluation
│   ├── tickets.py              # work-item export
│   ├── prcomment.py            # pull-request comment renderer
│   ├── redact.py               # host pseudonymisation
│   ├── completion.py           # generated shell completion
│   ├── waivers.py              # committable JSON waivers
│   ├── audit.py                # suppression rot audit
│   ├── precision.py            # per-rule precision from the ledger
│   ├── impact.py               # per-rule contribution to what is shown
│   ├── simulate.py             # hypothetical weight re-analysis
│   ├── scorechange.py          # why a score moved between two reports
│   ├── query.py                # safe --where expression parser
│   ├── attest.py               # run digests (deliberately unsigned)
│   ├── assign.py               # rendezvous-hash owner assignment
│   ├── ledgermerge.py          # conflict-surfacing ledger merge
│   └── __main__.py             # enables `python3 -m pathscope`
├── tests/
│   ├── test_path_detector.py   # core suite (offline)
│   ├── test_features.py        # end-to-end feature suite
│   ├── test_features_v22.py    # 2.2 regression suite
│   ├── test_features_v23.py    # 2.3 feature suite (one class per feature)
│   ├── test_features_v24.py    # 2.4 feature suite (one class per feature)
│   ├── test_features_v25.py    # 2.5 feature suite (one class per feature)
│   └── test_features_v26.py    # 2.6 feature suite (one class per feature)
├── install.sh                  # POSIX one-command installer
├── install.cmd                 # Windows installer
├── Dockerfile                  # slim, unprivileged, --self-test healthcheck
├── .dockerignore
├── assets/logo.svg             # original PathScope mark (route + magnifier)
├── README.md
└── LICENSE

Data flow: sources (parse, warn) → detector (score, rank) → report (render). The detector has no I/O and is trivially testable.


Limitations

  • Heuristic only. Names and values can be misleading; a parameter called file may be an enum, and the real handler may be called x.
  • Query, form and JSON bodies only. Path segments, headers, cookies and multipart file content are out of scope.
  • No verification. PathScope never checks whether the server uses, validates or blocks the parameter. That requires an authorized, separate test.
  • Encoding depth is bounded. Three passes by default; deeper nesting is reported only as value-double-encoded.
  • No persistence. Nothing is written to disk; redirect stdout if you need a report file.
  • Not a risk rating. Scores order reading, not severity. Do not publish them as vulnerability ratings.

FAQ

Does it send anything? No. The package contains no networking imports; a test asserts the import allow-list and another runs analysis with socket functions patched to raise.

Why are values hidden by default? URLs and HAR captures routinely contain session tokens and personal data. Masking by default makes accidental disclosure in tickets or CI logs much harder. --show-values is a deliberate choice, and even then query strings of the URL itself are never printed — only the specific parameter you asked to see.

How do I use it in CI? python3 path_detector.py -i capture.har --format sarif --fail-on-findings > pathscope.sarif then upload the SARIF file. Exit 0 = nothing flagged, 1 = candidates found.

Can HAR replay send requests? No. PathScope only reads log.entries[].request.url, queryString and postData. No curl, no requests, no sockets.

Which Python versions work? 3.8 or newer. The installers enforce that at install time and --doctor reports the version it found. CI runs on 3.11 (the Kali default) and 3.12 (the Docker image).

Why not regex configuration? ReDoS risk and explainability. Literal terms are validated and predictable.


Authorization and legal

PathScope is a defensive triage aid for authorized security review, education and engineering. Only analyze URLs, files and HAR captures you are authorized to review. If a system is not yours, confirm scope in writing before you analyze data from it — and remember that a finding here is a reason to look, not a license to test.

Provided under the MIT License (see LICENSE), without warranty of any kind.


GitHub: https://github.com/mrdineshpathro · Instagram: https://www.instagram.com/mr_dineshpatro · Support: https://buymeacoffee.com/mrdineshpathro

Built for Kali Linux · Python 3 · standard library only

About

Reviews URL and request parameters that may be worth a manual path-traversal check. Passive and local: reads HAR, OpenAPI and 10+ formats, never sends a request. Stdlib-only Python CLI with SARIF/JUnit output.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages