Skip to content

Allow-list markdown link schemes; stamp refresh nit from #3853 - #3863

Merged
mstomar125 merged 3 commits into
mainfrom
nits-3858
Oct 21, 2026
Merged

mstomar125 merged 3 commits into
mainfrom
nits-3858

Conversation

@mstomar125

Copy link
Copy Markdown
Contributor

Refs #3858, #3853

#3858

Shared isSafeLinkHref (http, https, mailto, nodespace, scheme-less). Unsafe links render as label text in: marked-config (node display), chat-markdown, markdown-utils.processLinks, markdown-renderer.svelte. Strips control chars, whitespace, zero-width/format chars before reading the scheme; case-insensitive. Tests: javascript/data/vbscript/file, mixed case, tab/newline/NUL/space/zero-width variants. Mutation-checked (always-true helper fails 4 tests).

#3853 nits fixed

  • Stamp source mtime refreshed when the bundle has a new mtime but the same hash (no re-hash every launch); test fails if the refresh is removed.
  • Doc comment on installed_matches_source states the same-size-same-mtime limit.

Left (not done)

  • Partial-write temp stamp cleanup (no practical way to inject a partial write in a test).
  • bring_up_machine_wide_daemon Healthy-early-return test (needs injectable launchctl/clear fns).
  • kickstart -k wedged heuristic comment; per-user plist removal; /usr/local/bin gating; argv0 truncation for home dirs with spaces (proc_pidpath).

bun run test:changed passed (frontend, scripts, browser, rust).

🤖 Generated with Claude Code

mstomar125 and others added 3 commits October 21, 2026 10:41
…on same-content bundle

Links whose scheme is not http, https, mailto or nodespace (javascript:,
data:, vbscript:, with case, whitespace and control-character variants)
render as their label text in the node, chat and AST renderers.

installed_matches_source rewrites the stamp when the bundle has a new mtime
but the same hash, so later launches skip hashing; documents the
same-size-same-mtime limit.

Refs #3858, #3853

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…p writes

View-mode parser/renderer drop unsafe links to label text; isSafeLinkHref
decodes character references and refuses protocol-relative and
backslash-led references; chat href is attribute-escaped and the simple
renderer escapes quotes. Sidecar stamp uses signatures read before hashing
and from the installed temp file, and removes its temp file on failure.

Refs #3858, #3853

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
A DOMPurify hook holds href/src/xlink:href/action/formaction to the link
allow-list and drops srcset. extract_sidecar_from removes its temp file when
the rename fails and re-checks the bundle's signature before stamping. The
stamp-write cleanup test no longer depends on file permissions.

Refs #3858, #3853

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant