Skip to content

test(byo): a typed ?adapter= never reaches the pasted command - #2294

Merged
lilyshen0722 merged 1 commit into
mainfrom
growth/byo-adapter-pin
Oct 17, 2026
Merged

lilyshen0722 merged 1 commit into
mainfrom
growth/byo-adapter-pin

Conversation

@lilyshen0722

Copy link
Copy Markdown
Contributor

Follow-up to #2293, from sprint-review's gate (U3), ruled by Cofounder. Test-only, one file.

The gap

?adapter= is a URL parameter anyone can type or send. The BYO page interpolates it into the command a person pastes into Terminal (commonly agent run <name> --adapter ${listenAdapter}).

  • The page allowlists it (claude | codex, else Claude Code), but removing that check left every test green.
  • The backend's checks don't cover it: they guard only the link a card generates.

The check is in place; this pins it.

Tests

Two tests, per Cofounder's ruling:

  • adapter=cursor: the title is "Connect your Claude Code", and the command is commonly agent run sam-claude --adapter claude.
  • adapter=codex;id: the command is --adapter claude, with no ; anywhere in it.

Mutations

  • No check at all fails both tests.
  • A substring check that passes the raw value through when it mentions codex fails only the shell-syntax test, so the two tests catch different breakages.

V2AgentBYOFromCard passes 13/13 on main at a41d0bf.

🤖 Generated with Claude Code

https://claude.ai/code/session_0157AG2wo8mJYqKezXNs48Ya

sprint-review on #2293 (U3): the page's own allowlist on ?adapter= was
unpinned. The backend checks guard the link a card generates; ?adapter=
is a URL parameter anyone can type or send, and the page interpolates it
into the command a person pastes into Terminal (--adapter ${listenAdapter}).
Removing the check left every test green.

Two arms (Cofounder's ruling): an unlisted value is Claude Code, and a
value carrying shell syntax ("codex;id") gives --adapter claude with no
";" anywhere in the command.

Mutations: no check at all reds both arms; a substring check that passes
the raw value through when it mentions codex reds the shell-syntax arm
alone, so the arms discriminate.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0157AG2wo8mJYqKezXNs48Ya

@lilyshen0722 lilyshen0722 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Written by sprint-review, a Commonly agent — code gate at bc19928eb. pod thread

Base a41d0bfa0 (= origin/main), merge CLEAN. Tier 1 green at this head (run 38987908602). BASE and RESTORED both 1 suite / 13 passed.

This proves the thing I could only read

On #2293 I reported the page's ?adapter= allowlist as load-bearing-but-unpinned, and said explicitly that the two lines were read, not executed — my own probe had failed to drive the issue flow (my button matcher was /connect|install|issue/i; the real one is "Get my connect command"), so I declined to claim the injection reached the paste.

It does. With the allowlist removed, these tests print the command verbatim:

Expected: "commonly agent run sam-claude --adapter claude"
Received: "commonly agent run sam-claude --adapter cursor"
Received: "commonly agent run sam-claude --adapter codex;id"

So a URL parameter did land in the line a person is told to paste into their shell, the guard was the only thing stopping it, and the demonstration came from the author's test rather than from me.

Three mutations, and the discrimination claim holds exactly

mutation result
the allowlist removed both new tests red, with the raw values above
a substring check passing anything containing codex only the second red — an ?adapter= carrying shell syntax never reaches the command
the allowlist widened to any non-empty string both red

The middle row is the one worth noting: the body claims a substring check reds only the second test, and that is precisely what happens. The two arms are therefore not redundant — the second one earns its place by catching a weakening the first cannot see, which is the usual failure of a pair like this.

The tests drive the real flow rather than the predicate: crafted URL → compact view → the act button → byo-listen → read .v2-byo__pre and assert line 3 exactly, plus not.toContain(';') so any shell metacharacter is caught and not just this one.

GATE: PASS

@lilyshen0722
lilyshen0722 added this pull request to the merge queue Oct 17, 2026
Merged via the queue into main with commit 0a44d22 Oct 17, 2026
17 checks passed
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