GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — id(web): neutralize executable URL schemes in imported Markdown links · Issue #5745 · developing-today/code

id(web): neutralize executable URL schemes in imported Markdown links #5745

New issue
Copy link
New issue
Copy link
Closed
#6339
Closed
id(web): neutralize executable URL schemes in imported Markdown links#5745
#6339
Copy link
Assignees
dezren39
Labels
app/idPackage/app: id (pkgs/ or apps/ in this repo)epic/id-programReprioritization program epic (2026-11-12)kind/bugSomething isn't working (prefixed form of the classic bug label)priority/highImportant and time-sensitivestatus:donetask/small-fixQueue packet kind: bounded fix with reproduction and targeted teststask/triageQueue packet kind: verify, reproduce, and route this item

Description

@dezren39
dezren39
opened on Nov 5, 2026
Issue body actions

Problem

Markdown converted for the ID web surface copies Comrak link URLs into HTML href attributes without rejecting executable schemes. In pkgs/id/src/web/markdown.rs around lines 2985-2995, imported or collaborative Markdown can contain a link such as open; when rendered and clicked in the same-origin application, the javascript URL runs in the user's browser context. The collab document path reaches this renderer via pkgs/id/src/web/collab.rs:141-153.

Existing renderer tests cover safe schemes but not javascript: (markdown.rs around lines 5808-5829 and 5879-5899). The /blob active-content mitigation in #908/#919 is related precedent but does not cover these editor links.

Required behavior

Only render URLs from an explicit safe set; neutralize executable or unknown schemes such as javascript:, data:, and vbscript:. Preserve safe http, https, mailto, and relative/internal links. Do not rely on browser sanitization.

Acceptance criteria

  • A regression test renders a javascript: link and proves it cannot produce an executable href.
  • Cases cover data:, vbscript:, protocol-relative, relative, http, https, and mailto, with a documented allowed-scheme oracle.
  • Collaborative Markdown rendering uses the same sanitizer as other Markdown entry points.
  • Existing safe-link behavior and formatting are unchanged.

Activity

Next
  1. dezren39
    added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    priority/highImportant and time-sensitive
    app/idPackage/app: id (pkgs/ or apps/ in this repo)
    on Nov 5, 2026
  2. developing-today commented on Nov 5, 2026

    @developing-today
    developing-todayBot
    on Nov 5, 2026 – with developing.today
    Contributor
    More actions

    CODE-1434

  3. github-actions
    assigned
    dezren39
    on Nov 5, 2026
  4. dezren39
    added a commit that references this issue on Nov 5, 2026

    fix(id): neutralize executable URL schemes in imported Markdown links

    This issue will close once commit 49aad00 is merged into the 'main' branch.
    49aad00
  5. dezren39
    added
    queue/queuedHas a queued queue task
    task/triageQueue packet kind: verify, reproduce, and route this item
    on Nov 5, 2026
  6. dezren39 commented on Nov 5, 2026

    @dezren39
    dezren39
    on Nov 5, 2026
    MemberAuthor
    More actions

    🤖 Agent note · done

    • Agent: queue worker (repo-worker-code), lane code-z
    • Session / ID: task 10157
    • Found via: queue claim (assigned_lane=direct; triaged directly this shift)
    • Task: Triage of issue id(web): neutralize executable URL schemes in imported Markdown links #5745 — CONFIRMED at current main c26e0585add36770e90d7b24480b9bb5b3564c5e.
    • Expectation: done — findings below; the fix is enqueued as a follow-up small_fix task (packet hidden_files/5745-fix-packet-10157.json).
    • Links: task 10157; issue id(web): neutralize executable URL schemes in imported Markdown links #5745

    Triage findings — issue #5745 is a live stored-XSS-class bug

    Verified fresh against GitHub main c26e0585add3 (not the packet's stale line numbers alone):

    1. Verbatim href copy, no scheme check. pkgs/id/src/web/markdown.rs, NodeValue::Link arm (line 2988 at that sha): let mut attrs = json!({"href": link.url}); — the Comrak URL goes straight into the ProseMirror link mark. A grep of the full 10,821-line file finds no scheme validation or sanitizer, and a repo code search for safe_scheme / allowed_schemes / sanitize_url / is_safe_url returns no hits anywhere.
    2. Emit side is the same. At ~4972–4984 the save path builds <a href="..."> from linkHref with escape_attr_value only — attribute escaping stops quote-breakout, not a javascript: scheme.
    3. Collab path reaches it. pkgs/id/src/web/collab.rs (~141–153): ContentMode::Markdown => markdown_to_prosemirror(&text) — collaborative Markdown uses the same unsanitized converter, exactly as the issue states.
    4. Test gap is real. The renderer tests at ~5831–5901 assert https://, http://, and mailto: hrefs only; there is no javascript: / data: / vbscript: case in markdown.rs.
    5. No competing work. gh pr list --search 5745 (all states) returns nothing; the issue carries no held / user/owned / do-not-merge / do-not-auto-edit labels.

    Routing: fix scoped as a single allowed-scheme sanitizer (oracle: http, https, mailto, and scheme-less relative/internal references; protocol-relative decided and documented explicitly; every other scheme neutralized by dropping the href while keeping the link text), applied on both parse and emit paths so all Markdown entry points share it, with the acceptance-criteria test matrix from the issue body. Enqueued as a small_fix follow-up task — see the task 10157 completion for its task id.

  7. dezren39
    added
    task/small-fixQueue packet kind: bounded fix with reproduction and targeted tests
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    status/in-progressQueue worker lifecycle state
    and removed
    queue/queuedHas a queued queue task
    on Nov 5, 2026
  8. developing-today commented on Nov 5, 2026

    @developing-today
    developing-todayBot
    on Nov 5, 2026 – with developing.today
    Contributor
    More actions

    🤖 Agent note · picked up

    • Agent: queue worker (repo-worker-code), lane code-d
    • Session / ID: task 10643
    • Found via: queue claim
    • Task: Fix issue id(web): neutralize executable URL schemes in imported Markdown links #5745 — neutralize executable URL schemes in id web Markdown links (allowed-scheme sanitizer). Assigned lane=direct, working it directly.
    • Revalidation: issue id(web): neutralize executable URL schemes in imported Markdown links #5745 OPEN fresh, no hard-stop labels (held/user/owned/do-not-merge/do-not-auto-edit absent).
    • Next: inspect pkgs/id/src/web/markdown.rs link rendering, implement allowed-scheme sanitizer with regression tests, open PR.
    • Links: issue id(web): neutralize executable URL schemes in imported Markdown links #5745, task 10643
  9. 28 remaining items

  10. developing-today commented on Nov 8, 2026

    @developing-today
    developing-todayBot
    on Nov 8, 2026 – with developing.today
    Contributor
    More actions

    🤖 Agent note · picked up (salvage leads from a superseded duplicate)

    • Agent: queue worker (repo-worker-code), lane code-l
    • Session / ID: task 13507
    • Found via: queue claim (shepherd task for PR fix(id): neutralize executable URL schemes in imported Markdown links #7198, the stranded-branch duplicate of this issue's fix)
    • Task: PR fix(id): neutralize executable URL schemes in imported Markdown links #7198 was closed as superseded — this issue's fix merged via PR fix(id/web): neutralize executable URL schemes in Markdown links (#5745) #6339 (links) and PR fix(id): neutralize unsafe image URLs #6592 (images, issue id(web/markdown): image src bypasses the #5745 scheme neutralization — javascript:/data:text/html/vbscript:/file: survive import, raw-HTML <img>, collab PM JSON, and save #6364). Two Codex P2 findings raised on PR fix(id): neutralize executable URL schemes in imported Markdown links #7198 apply equally to the merged implementation on current main and are recorded here as verification leads, since this issue is still open:
    • Expectation: whoever verifies/closes issue id(web): neutralize executable URL schemes in imported Markdown links #5745 checks the two leads below against main; each is a grep-level observation, not a reproduced failure.
    1. Native reference URLs. Reference::to_markdown emits [surface](id://{hex}) / id://{hex}@{hex}. Main's link_url_is_safe (pkgs/id/src/web/markdown.rs) allows only http/https/mailto, and there is no id:// handling anywhere in that file — so a reference link that reaches the Markdown converter (Codex cited the collab import path) is sanitized to # and the reference target is lost on save. Verify whether reference links actually traverse the converter; if they do, validated id:// targets need an allowlist carve-out.
    2. Newline-placeholder destinations. protect_newline_destinations swaps a newline inside an angle-form destination for an idweb-newline-<n>-token placeholder before parsing, and restore_attr_newlines runs only after conversion. Main's oracle strips real TAB/LF/CR characters but not the placeholder token, so a protected destination like <https\n://example.com> is judged under the scheme httpsidweb-newline-0-token and sanitized to #. Verify with a test combining a newline destination with the scheme sanitizer.

    Full salvage diff and Codex dispositions: PR #7198, comment 6726973992.

  11. dezren39
    added
    epic/id-programReprioritization program epic (2026-11-12)
    on Nov 12, 2026
  12. dezren39 commented on Nov 17, 2026

    @dezren39
    dezren39
    on Nov 17, 2026
    MemberAuthor
    More actions

    🤖 Agent note · triaged — both salvage leads VERIFIED REAL on current main; fix routed as task 19948

    • Agent: repo-worker-code
    • Session / ID: queue task 18357 · lane any-j
    • Found via: repo-health-code-pilot atomic claim (bulk-intake triage packet)
    • Task: Re-verify issue id(web): neutralize executable URL schemes in imported Markdown links #5745 fresh. Its sanitizer merged via PR fix(id/web): neutralize executable URL schemes in Markdown links (#5745) #6339 (links) and PR fix(id): neutralize unsafe image URLs #6592 (images, id(web/markdown): image src bypasses the #5745 scheme neutralization — javascript:/data:text/html/vbscript:/file: survive import, raw-HTML <img>, collab PM JSON, and save #6364); the open remainder was the two unverified Codex P2 leads salvaged by task 13507 from the superseded duplicate PR fix(id): neutralize executable URL schemes in imported Markdown links #7198.

    Verification (probe tests on main 287441b, scratch worktree, cargo test -p id-web): both leads reproduce.

    1. Native reference URLs — REAL. Reference::to_markdown (pkgs/id/src/references.rs:145) emits [surface](id://{hex}) / id://{hex}@{hex}, and collab Markdown import runs the converter (pkgs/id/crates/id-web/src/collab.rs:158), whose oracle link_url_is_safe (pkgs/id/crates/id-web/src/markdown/prosemirror_json.rs:1152) allows only http/https/mailto. Probe: markdown_to_prosemirror("[surface](id://0123456789abcdef)") yields link href "#" — a reference target is silently lost on save.
    2. Newline-placeholder destinations — REAL. protect_newline_destinations swaps a newline inside an angle-form destination for an idweb-newline-<n>-token before parsing; the oracle strips only real TAB/LF/CR, and newline restoration runs after conversion. Probe: markdown_to_prosemirror("[open](<https\n://example.com>)") yields link href "#" instead of https://example.com.

    Both failures are over-neutralization (safe content destroyed), not security holes — the executable-scheme rejection itself is intact and its tests pass.

    Routing: the fixes need a validated id:// carve-out matching exactly the Reference::from_markdown grammar and a placeholder-aware scheme judgment that a literally-authored token cannot spoof — scoped, security-adjacent work in the oracle, so it is routed as its own packet rather than driven from this triage claim: follow-on task 19948 (small_fix, repo-health-code-pilot, dedupe repo-health:v1:fix:developing-today/code:issue:5745), with the probe evidence and acceptance criteria recorded in the packet. This issue stays open (status:in-review) until that fix lands.

    Task 18357 completes as triaged.

  13. dezren39
    added
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    status/in-progressQueue worker lifecycle state
    on Nov 17, 2026
  14. dezren39 commented on Nov 17, 2026

    @dezren39
    dezren39
    on Nov 17, 2026
    MemberAuthor
    More actions

    🤖 Agent note · state: in progress (fix implemented, PR open)

    • Agent: queue worker (repo-worker-code), lane any-e
    • Session / ID: task 19948
    • Found via: queue claim (unfiltered one-queue claim)

    Task 19948 fix for the two verified #5745 sanitizer remainders is implemented in PR #11194 (branch queue/19948-5745-idweb-sanitizer, commit a7d2cdf):

    1. id:// carve-out — link_url_is_safe now allows the exact Reference degradation grammar: id://<hex> or id://<hex>@<hex> with each hex exactly 64 ASCII hex digits (the p2panda_core::Hash hex form Reference::to_markdown emits and Reference::from_markdown parses). Malformed id: URLs (non-hex, short hex, extra path segments, empty target, multiple @, missing //) stay neutralized to #.
    2. Newline-placeholder scheme judgment — the probe removes idweb-newline-<n>-token placeholders before judging, so <https\n://example.com> is judged https and preserved (newline restored in the PM href), while <java\nscript:...>-style constructions still judge as their executable scheme and stay neutralized. Stripping can only expose the scheme the surrounding characters already spell; safe URLs are still returned verbatim.

    Verification: cargo test -p id-web (from pkgs/id, laptop, fleet-build-lock) — 700 lib + 1 integration passed, 0 failed, including two new regression tests (test_link_id_reference_destinations_preserved_and_malformed_neutralized, test_link_newline_placeholder_scheme_judgment) and all pre-existing #5745/#6364 sanitizer tests. Ordinary allowed set unchanged (http/https/mailto or scheme-less); image sanitizer untouched.

    Codex gate: the first Codex review run on PR #11194 failed to complete with zero findings presented; a retry was requested on the PR and its outcome will be dispositioned there before merge.

  15. dezren39
    added a commit that references this issue on Nov 17, 2026

    fix(id-web): preserve validated id:// reference links, judge newline-…

    d935230
  16. dezren39
    removed
    status/in-progressQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    on Nov 17, 2026
  17. dezren39 commented on Nov 17, 2026

    @dezren39
    dezren39
    on Nov 17, 2026
    MemberAuthor
    More actions

    🤖 Agent note · state: done (fix merged)

    • Agent: queue worker (repo-worker-code), lane any-e
    • Session / ID: task 19948
    • Found via: queue claim

    Task 19948 is done: PR #11194 MERGED (squash d935230206aadb1a31ea3586cc901a9dd6fc9f9f, 2026-11-17T10:00:34Z).

    • Both remainder defects from triage task 18357 are fixed in link_url_is_safe (pkgs/id/crates/id-web/src/markdown/prosemirror_json.rs): the validated id:// Reference-degradation carve-out (exactly the Reference::from_markdown grammar) and the newline-placeholder-aware scheme judgment. Regression tests are in pkgs/id/crates/id-web/src/markdown.rs.
    • Verification: cargo test -p id-web — 700 lib + 1 integration passed, 0 failed (new tests + all pre-existing id(web): neutralize executable URL schemes in imported Markdown links #5745/id(web/markdown): image src bypasses the #5745 scheme neutralization — javascript:/data:text/html/vbscript:/file: survive import, raw-HTML <img>, collab PM JSON, and save #6364 sanitizer tests).
    • Codex gate: both Codex runs quota-failed with zero findings; disposition recorded on PR fix(id-web): preserve validated id:// reference links, judge newline-protected schemes (#5745) #11194 (comment 6944790516), per fleet precedent.
    • Issue id(web): neutralize executable URL schemes in imported Markdown links #5745 stays OPEN (status:in-review) for its other tracked halves, as the triage routing specified; this task covered only the sanitizer remainder. Claim labels set by this lane (queue/claimed, work/assigned, status/in-progress) have been removed.

    Task 19948 completes as fixed_merged.

  18. dezren39
    closed this as completedon Nov 18, 2026
  19. developing-today
    added
    status:done
    and removed
    status:in-review
    on Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @dezren39
    dezren39

Labels

app/idPackage/app: id (pkgs/ or apps/ in this repo)epic/id-programReprioritization program epic (2026-11-12)kind/bugSomething isn't working (prefixed form of the classic bug label)priority/highImportant and time-sensitivestatus:donetask/small-fixQueue packet kind: bounded fix with reproduction and targeted teststask/triageQueue packet kind: verify, reproduce, and route this item

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.