fix(markdown): enforce explicit trust posture - #75
Merged
Conversation
The default-deny added to handleAnchorClick preventDefault()s every click before dispatching, which is right for the hrefs this renderer owns — an unclaimed relative href would navigate the whole renderer away from the app — but it also swallowed `#fragment` links, in trusted content as well as untrusted. A fragment cannot leave the document, reach the network, or leak anything, and a rendered README's table of contents consists of nothing else. Both neighbours already treat them that way: html-renderer.tsx exempts `#` alongside absolute schemes, and resolveWorkspaceResourcePath returns null for them rather than resolving a path, so openWorkspaceLink was declining them anyway and the click simply did nothing. Pinned in the node test project, which CI runs, rather than the browser project, which it does not; both assertions fail without the guard.
64ix
force-pushed
the
codex/issue-59-markdown-trust
branch
from
August 5, 2026 20:26
b8bbcda to
c980fac
Compare
64ix
marked this pull request as ready for review
August 5, 2026 20:30
6 tasks
64ix
added a commit
that referenced
this pull request
Aug 5, 2026
`ipc.ts` guarded on `typeof window !== 'undefined'` and then read `window.electronAPI`, so outside Electron — browser-mode tests, Storybook — it took the first branch and left `electronAPI` undefined. The `createRPCClient` call one line down then threw while the module was still evaluating, which took down every module that transitively imports it, at import time, before any test body ran. That is how #75's browser suite shipped red: `markdown-renderer-security.test.tsx` failed with `Cannot read properties of undefined (reading 'invoke')` and nothing noticed, because fork-ci.yml runs node/main-db/migrations/scripts and not the browser project. Guarding on the bridge itself makes the unavailable-channel errors below reachable, which is what they were written for. The suite also needed the ipc stub every other renderer test installs: importing the markdown renderer constructs the SSH connection store, whose Resources call RPC from their constructor, and those rejections failed the file even with both assertions passing. Full workspace suite now green: 398 files, browser project included. Co-authored-by: 64ix <64ix@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #59.
Summary
Checks