Repository navigation
Conversation
…it as a link sanitise kept [label] text untouched whenever any [ or ( followed it, so [@alice][1] with no definition, [@org/team](see notes) or [#12][x] reached GitHub as literal text with a live mention or backlink. A label now stays verbatim only for a CommonMark inline destination, or a full, collapsed or shortcut reference to a definition GitHub honours (outside code, starting a block, one line), and never when it holds a nested link; anything else is neutralised as prose.
…--once exits like lookup
Discovery trusted a patchula-server marker from any bot whose login the
advertised server named, but that server answers whatever it likes and
could hand out the real Count App's client ID, sending the user's token
to an attacker. The author's App, as GET /apps/{slug} describes it, must
now have the client ID the server gives the device flow, and that ID is
remembered with the choice, so a server that later names another App is
refused before sign-in.
tui --once always exited 0; it now shares lookup's exit code (1 on a
repository error, 4 on a failed lookup).
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
count-patchula | 504599c | Commit Preview URL Branch Preview URL |
Nov 16 2026, 12:41 AM |
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.
Three fixes in the cli and notes crates.
Server discovery trusted any bot's marker (security)
discoveraccepted apatchula-server:marker from any Bot account, as long as the advertised server's/api/v1/authnamed that same bot. But the advertised server answers whatever it likes. Say another bot copies attacker text into an issue (a workflow running asgithub-actions[bot], or a bot that pastes release notes). The attacker's server could then claim that bot and hand out the real Count App'sclient_id. The user approves the familiar App on GitHub, and the CLI sends the resulting user token to the attacker.Invariant: the device flow only ever signs in to the GitHub App that wrote the marker.
{slug}[bot]; anything that is not[a-zA-Z0-9-]+is skipped without a request). It fetchesGET https://api.github.com/apps/{slug}and requires that App'sclient_idto equal the one the server advertises. Any error or mismatch skips the marker (fail closed).repositories.json(new requiredappfield) and carried through--remotediscovery asremote::Server. Sign-in and token refresh refuse a discovered server that later names a different App, which closes the check-then-use gap between discovery andlogin(). Servers the user names (PATCHULA_SERVER,--server) are not pinned; the user vouches for those.guide/server.mdxno longer claims a marker "written by another App, is ignored". It now describes what is checked.Hard cutover: a
repositories.jsonwritten before this has noapp, so it fails to load with the existing "is not valid; delete it to start over" message. Those choices were made under the broken check, so they should not carry over silently.Tests (fake transport, as the rest of
remote/tests.rs): the attack itself (other[bot]marker; the server claimsother[bot]and the Count's client ID; GitHub saysotherhas another ID), an App GitHub cannot describe, a server whose client ID does not match its author's App, slugs that are never looked up, and a remembered server that switches App being refused before anygithub.com/loginrequest.Notes sanitise kept non-links verbatim (security)
sanitisekept a[...]label untouched whenever any[followed it, or any parentheses. GitHub shows[@alice][1](no definition),[@org/team](see notes)and[#12][x]literally, so they became live mentions and backlinks from every Count PR.Invariant: a label stays verbatim only when GitHub renders it as a link.
<...>, or no spaces or control characters with balanced parentheses; an optional closed title; at most one line ending.The existing test that had
[ref]: ...directly under a paragraph line was relying on a definition GitHub ignores. It now has blank lines around the definition. New tests cover the three reported cases plus undefined collapsed refs, invalid destinations (spaces, unclosed titles, blank lines, newlines in<>), definitions in code, interrupting a paragraph, with an escaped bracket or trailing text, and nested links. They also check that real links survive: full, collapsed and shortcut refs,<a b>, balanced parens, multi-line, escaped quotes in titles, badges, and paren titles.The state and derive guards required version bumps for every row that hashes the notes sources (
changelog,notes-adapter, and the notes derives intests/derived-versions.tsv).tui --oncealways exited 0batch()'s exit-code logic (error, stale, lookup failure) moved intoexit_code(), whichtui --oncenow uses, so a CI snapshot fails likelookup(1 or 4). The help text,reference/cli.md(mise run docs:cli), the help snapshot andguide/tui.mdsay so. Tests: a unit test of the ranking, andtui --onceon the existing lookup-failure fixture exits 4. That test now runs multi-threaded likemain. The TUI checks the tree with a blocking git call (futures_executor::block_on), and that deadlocks on a current-thread test runtime.Checks run
cargo test -p patchula-notes -p patchula-cliandcargo clippy -p patchula-notes -p patchula-cli --all-targets -D warningspass on the VM.Follow-ups
copier::changedblocks on an async process withfutures_executor::block_on. It works under#[tokio::main]'s multi-thread runtime but deadlocks on a current-thread one. Aspawn_blockingor a sync process call would remove the trap.