Repository navigation
fix: close access gaps found in a security pass - #239
Merged
kalaspuff merged 12 commits intoOct 23, 2026
Merged
Conversation
- A session's Claude credential runs it only while its person may still run it: message it as a project editor, or through a share (`spec::credential_serves`). Before, a member demoted to viewer, or taken out of a project, still had their old sessions there run on their subscription and on their own runners, which got the project's secrets and fresh GitHub tokens. GitHub token refreshes check it too, and FleetDO stops such sessions when someone's access changes. - Replacing a runner's token is refused while a workspace it serves is closed to its owner by that workspace's two-factor requirement, so a password alone no longer gets a runner token for everyone's sessions. - Registering a runner for a workspace and replacing a runner's token take confirming it's you, as adding a runner to a workspace does: otherwise a stolen session registered a new runner instead. - Deleting or disallowing a workspace's primary admin no longer passes the role to the instance admin who did it, unless they are one of the workspace's admins already. - Only the primary instance owner makes someone an instance admin, as only they invite or allow addresses as admins.
A review runs on its operator's Claude subscription with their token in the sandbox, and Claude acts on what the pull request says. Every pull request started one, so text in anyone's pull request on a public repository could have the review agent hand the operator's token over, with nobody in the project having looked at it. GitHub's deliveries now start reviews only of pull requests whose authors may write to the repository, and of fctl's own agents'; people in the project ask for the others' (the Reviews tab, `fctl review start`). ADR 0046 records it, and ADR 0045 the runner confirmation of the previous commit.
…belong - Notices from a session's uplink no longer carry what became of pull requests (`follow_up`), which only the control plane tells, with people's comments: what runs in a sandbox can pose as the agent, and could put a comment in someone's name. A posted review's link is kept only as GitHub's own link to the pull request, or a comment or review on it (`fctl_domain::reviews::posted_link`); the web app opens such links only on GitHub too. - Pictures in GitHub comments, shown as links, go through `textLink` like any link, so a comment can't link to the app's device approval page or API in a picture's place. - Pictures in agents' answers load from the app's own address only as published screenshots, and avatars come from other sites: the browser sends the reader's cookies to the app, so such a picture acted for everyone who saw it (ran their export, used up their device codes).
- `GET /api/v1/github/repos` lists a workspace's repositories, private ones too, to its admins and to maintainers of one of its projects, who choose them, not to every member. - A workspace's audit log keeps the IP addresses of the caller's own actions only, as the web app shows it: its admins see who did what there, not where its members were. - The export's notes, schedules and followed sessions come from the projects and sessions the person still sees: others keep them up to date, and they were taken out of the others. - Where the instance sends no email, an admin's password reset link for someone comes back to the admin and signs in as them: it takes confirming it's you, as deleting their account does. - Names leave out control characters and the ones that turn text around, which made a device asking to sign in read as another.
A review's findings went to a session listing the pull request in any workspace connected to a GitHub login of that name, where comments, checks and merges go only to workspaces connected to the same account by GitHub's id. A workspace whose connection is to a login that changed hands since (renamed, then taken by someone else) could get the findings of the new account's pull requests. They now follow the same rule: the account the review's own workspace connected, by its id.
…e app - A session's viewer socket whose access wasn't checked for two minutes (it stopped pinging, which the apps do every 25 seconds) closes at the next broadcast, rather than after five: a client that stops pinging once its person lost access hears little more of the session. - The web app's Content-Security-Policy says `object-src 'none'`: it embeds no plugins, and otherwise `<object>` fell back to `'self'`.
The device approval page signs a CLI in as you with one click, and a link can fill in its code: whoever sends you `/device?code=…` gets your account if you approve. It now says to approve only a sign-in you started yourself, just now, and shows the client's user agent beside where it asked from, which the API already returned. docs/security.md also says plainly what the sandbox model implies: whoever can message a session's agent can have it hand over the Claude token of the person it runs as.
…ses it to their person
…gh-full-security-pass-of-the
This comment has been minimized.
This comment has been minimized.
The settings form sends the avatar with every save, so someone whose stored avatar is on the app's host, from before avatars had to come from another one, couldn't save anything else until they cleared it. Such an avatar now stays as it is, which the web app doesn't load; changing it still takes another host.
kalaspuff
previously approved these changes
Oct 23, 2026
…gh-full-security-pass-of-the # Conflicts: # docs/adr/README.md # web/src/components/session/follow-up.tsx
kalaspuff
approved these changes
Oct 23, 2026
kalaspuff
deleted the
fctl/184-run-a-thorough-full-security-pass-of-the
branch
October 23, 2026 17:35
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.
A security pass over fctl: the control plane (sign-in, permissions, Durable Objects, runners, the GitHub integration), the host, the in-sandbox agent, the CLI, the standalone server and the web app. Six reviews ran in parallel, one per area. I checked each finding in the code before changing anything, and reproduced the main ones against
cargo xtask dev. Nothing critical turned up: the sign-in, token, passkey, webhook and token-minting paths held. What follows is what didn't.Fixed, most severe first
spec::credential_serves). So someone made a viewer of a project, or taken out of it, still had their sessions there run on their subscription when anyone messaged them or a follow-up woke them, and on their own runner, which got the project's secrets and fresh GitHub tokens. Changing a project role stopped nothing. Now a credential runs a session only while its person may still message it, for GitHub token refreshes too. FleetDO also stops such sessions as soon as someone's access changes (/workspaces-changed, which removing a share now calls too).POST /api/v1/runners/{id}/tokenonly checked that the caller registered the runner. Someone holding the password of an admin without a second factor got a token for every session the runner ran, in a workspace that requires two-factor sign-in. Replacing the token is now refused while a workspace the runner serves is closed to its owner.POST /api/v1/workspaces/{id}/runners,POST /api/v1/runners) and replacing a runner's token weren't, so a stolen session did those instead. Both now ask, and the CLI asks in the terminal duringfctl host install(ADR 0046 records the change to ADR 0039).fctl review start) once they've looked at them. This changes what ADR 0040 decided, so it is yours to accept or reject: it is its own commit (8f35482), recorded in ADR 0047.PATCH /api/v1/admin/users/{id}), though only the primary owner may invite or allowlist admins, and the web app already greyed the option out. Only the primary owner does that now. And when an instance admin deleted a workspace's primary admin, or removed the allowlist entry that admitted them, the role passed to the longest-standing member, which could be that same instance admin. Instance admins can't give themselves that role directly (check_assign_primary). It no longer passes to them unless they are an admin of the workspace already, and a workspace with no one else waits for one (needs_primary).follow_up, and a review's link is kept only as GitHub's own link to the pull request or a comment on it (fctl_domain::reviews::posted_link). The web app opens those links only on GitHub too.textLink, so a comment could put the device approval page with an attacker's code behind a picture. They now go through it. Pictures in agents' answers loaded from the app's own address, and so did avatars: each viewer's browser sent its cookies there, which ran their export or used up their device codes. Pictures now load from the app's address only as published screenshots, and avatars must come from another host (validate::avatar_url), with the web app skipping stored ones that don't.GET /api/v1/github/repos, which lists every repository of a workspace's GitHub accounts, private ones included, is now for the workspace's admins and maintainers of one of its projects, not every member.object-src 'none'.Not changed: for you to decide
claude setup-token. Only the sandbox model can change that;docs/security.mdnow says it plainly.fctl self update, the host's agent download and the installer check a SHA-256 fetched from the same server as the binary, with no signature.app.<domain>, the app suggestscurl https://<domain>/install | sh.connect-srcallows WebSockets to any host.Verified
cargo xtask checkpasses. There are new unit tests for review links, avatar addresses, names and instance roles, and web tests for Markdown pictures and GitHub links.cargo xtask dev, with scripts against the API:verification_requiredregistering a runner (both routes), replacing a runner's token and making a reset link, and succeeded afterPOST /auth/verify.needs_primary, with themselves still a member.rv::trustedandposted_link, which have unit tests.Screenshots
At 18b9209, from
cargo xtask dev, 900 px wide.The device approval page, which a link can open with someone else's code filled in. It now warns against approving a sign-in you didn't start, and shows the client's user agent:
At a phone width, dark:
A project's Reviews tab before review agents are on, which now says that outsiders' pull requests wait for someone to ask:
hyperstructure/fctl-site#49 updates the privacy policy to match: who gets reviews of outsiders' pull requests, and the addresses workspace admins see in their audit log.
Session: https://app.fctl.sh/s/ses_01M5MHK862G56BT579VMMJHQVZ