Repository navigation
fix(control): stop sign-in leftovers from outliving roles and passwords - #327
Conversation
…password Four ways in outlived what should have ended them: - An address's allowlist entry kept the admin role after its account disconnected the address, and demoting or deleting the account only touched the addresses it still had: an admin could disconnect the address they were invited with, and once demoted or deleted sign up with it again, with Google, as an admin. Disconnecting an address now turns an admin's entry for it into a member's. - Signing up gave an admin's invitation the admin role even when the allowlist now admitted the address only as a member. The role is now the lower of the two. - A password reset link sent to an address kept working for its hour after the address left the account. Disconnecting an address, by its person or because no entry admits it any more, now uses up the account's waiting links. - A CLI sign-in the person approved, but no CLI had picked up yet, still signed a CLI in after a password change or reset revoked their tokens. Revoking someone's tokens now refuses those codes too. Setting up the instance also no longer leaves an admin's allowlist entry for the address of a setup that lost a concurrent race. Verified in cargo xtask dev: disconnecting an address with an admin entry leaves a member's entry and uses up a reset link; an approved device code polls as denied after a password change; an admin invitation whose address is now allowed as a member signs up a member.
…ing for codes Someone's own choice to have Google sign-ins ask for a code from their authenticator app could be turned off with a session or token alone, with nothing to confirm and nothing said, unlike the instance's setting, which takes confirming it's you. Turning it off is now that same sensitive action, and emails the person when email is set up. Verified in cargo xtask dev: with confirmation on, an unconfirmed token gets verification_required, and turns it off once it confirmed.
Adding a passkey outside a fresh sign-in took the password, even for an account with an authenticator app: someone with a stolen session and the password, as malware that steals browsers' cookies and saved passwords has together, could add a passkey of their own, which then signs in without the app's code, long after the session was revoked. Outside a fresh sign-in it now takes what a sign-in with the password would: a code from the authenticator app where the account has one, a fresh sign-in where passkeys are the second factor a password sign-in asks for, else the password as before. The web app already asks for whichever the answer names. Verified in cargo xtask dev: an account with an authenticator app is asked for a code instead of its password, and gets the options with one; an account without a second factor still adds one with its password.
|
Partly addressed as of fctl reviewed On lines the diff doesn't show:
Reviewed by fctl · Review agent settings |
…ign-ins An admin's invitation to an address with a member's allowlist entry left the entry a member's, so that, with sign-up now taking the lower of the two roles, it signed up a member though inviting reported an admin's invitation. An admin's invitation now makes such an entry an admin's, as an invitation's, and revoking it takes the entry back to what the other invitations need: a member's, or none at all. Setting up a first authenticator app took the password, also on an account whose password sign-ins ask for a passkey already, so that a stolen session with the password could set up an app of its own and get past them. It now takes a fresh sign-in there, as without a password (fctl_domain::two_factor::setup_proof). The docs, the passkey options' documentation and the web app's comment say what adding a passkey takes now. Verified in cargo xtask dev: a member's invitation, then an admin's, make the entry an admin's; revoking the admin's makes it a member's again; and an admin's invitation signs up an admin. Unit tests cover setting up a first app.
|
Finding 3, from the review's summary, is fixed in a7e9c7d: docs/architecture.md (both places), docs/security.md, the |
This comment has been minimized.
This comment has been minimized.
The setup form showed a refusal only for fields it has, so one that asks for a fresh sign-in, which a first app on an account whose passkeys are its second factor now takes, showed nothing at all and the button just came back. Refusals the form has no field for now show as a banner, with a test.
|
Fixed in bf5883d: the setup form shows refusals it has no field for, the |
This comment has been minimized.
This comment has been minimized.
A setup started within 15 minutes of signing in asks for no password, but confirming it after those minutes does, and the form had no field for it: it showed nothing. Once confirming asks for the password, the form now shows the field, with what was said, and sends it.
|
fctl reviewed The new commit (60c7ff7) is fine: once confirming refuses for the password, the form shows the password field and sends what's typed, which matches On lines the diff doesn't show:
Reviewed by fctl · Review agent settings |
An admin's invitation made any member's entry for its address an admin's, marked as an invitation's, so that revoking it deleted an entry an admin had added by hand, with its note. Only an earlier invitation's entry is raised now; inviting an address as an admin while an entry an admin added allows it as a member asks to remove that entry first. docs/cli.md also names turning off codes on Google sign-in among the actions that ask to confirm it's you.
This comment has been minimized.
This comment has been minimized.
…ry to go docs/architecture.md and docs/cli.md say what an admin's invitation does to the address's entry, and that one an admin added by hand as a member's has to go first; the refusal names fctl admin disallow beside Admin → Access.
This comment has been minimized.
This comment has been minimized.
…ember's An admin's invitation adds an entry for its address that says admin, and when the invitation ran out unused the entry stayed one, so that a Google sign-up, which needs no invitation, still made an admin. The hourly job now makes such an entry a member's once no admin's invitation to the address is left and no account has it, as revoking the invitation does. The note in docs/cli.md about admins' hand-made entries moves beside the fctl admin invite examples, where it applies.
…es (#87) ## Summary app.fctl.sh will email people when a Claude subscription is connected to their account, and when their Google sign-ins stop asking for a code. Both come from fixes in fctl's security pass. The privacy policy's list of the notices app.fctl.sh sends now names both, and its date moves to today. Merge it together with the two fctl pull requests that add those emails, which reach app.fctl.sh with the next release: - hyperstructure/fctl#326 - hyperstructure/fctl#327 [fctl session](https://app.fctl.sh/s/ses_01M62HVCXZDZV6GJJP8DDQGDFF) Co-authored-by: fctl-sh[bot] <343971779+fctl-sh[bot]@users.noreply.github.com>
…#329) ## Summary Hosts trust the control plane with what runs in sandboxes, but not with the machine around them, as their update checks already show. A few names it sends still reached the host's paths unchecked: - Sandbox names came from the session's id, and a Claude sign-in's from its job's, as the control plane sent them. The process driver keeps each sandbox in a directory of that name and removes it afterwards, so an id with slashes and dots named any directory on the machine. Names now keep only letters, digits and dashes; real ids name the same sandboxes as before. - A project's Dockerfile and build directory, and the path of its dev container configuration, which the paths that configuration names are relative to, went to the build as they came: the control plane checks them, but the host didn't, so a directory like `../..` would have built from the host's own files, and a configuration path with `..` parts named another repository's file in GitHub's API. The host now checks every one of them as a path in the repository before anything reads it. The standalone control plane also makes its state directory, which holds D1 and every Durable Object's SQLite files, readable by its own user alone, and says in its log when it can't, for a directory another user owns. Verified with new unit tests for both names and build paths, the host's tests and the standalone server's tests. The other fixes from the same security pass: - #325 - #326 - #327 - #328 [fctl session](https://app.fctl.sh/s/ses_01M62HVCXZDZV6GJJP8DDQGDFF) --------- Co-authored-by: fctl-sh[bot] <343971779+fctl-sh[bot]@users.noreply.github.com>
…328) ## Summary The Linear integration showed and let through more than people and agents should reach: - The workspace's Linear tab and a project's Tickets tab listed every project that takes a Linear workspace's tickets, with its name and address, to members who can't see those projects. They now list the ones the person sees, within an access token's places. - Any member could list a connected Linear workspace's teams, workflows and open projects, at a cost of thousands of points against an API that every fctl workspace connected to it shares. Now only the workspace's admins and its projects' maintainers, who choose teams, can; the web app asks only for them. - A Linear team kept while the tracker was GitHub's, and never checked, was taken unchecked when only the tracker turned to Linear (`fctl_domain::tickets::linear_changed`). - A ticket call that failed gave its place within its limit back, though it had asked Linear or GitHub all the same, so a sandbox could loop failing writes without end and use up a shared Linear API. Failed writes now count against a limit of their own, 60 an hour, which every write needs room in, and a call names at most 20 labels, since GitHub takes each label removed in a request of its own. - A comment's `reply_to` went to Linear unchecked; it now has to be one of the ticket's own comments. A delivery for a Linear agent session also moves on only a thread of its own Linear workspace. Verified in `cargo xtask dev` with its Linear stand-in: a member without a role in a project doesn't see it in the lists, and only admins and maintainers list teams; turning only the tracker to Linear checks the team; the 61st failing update in an hour is refused while reads go on; a reply under another comment and a 25-label update are refused; and a viewer's Tickets tab shows the saved team, and names the states as what they are, without asking for the teams. New tests cover the tracker check, the label limit and what a viewer sees. With `main` merged in, the checks and limits hold for projects of several Linear teams (#331), whose Tickets tab already lists the teams only for those who choose them; the domain, CLI and web tests pass on the merge. The other fixes from the same security pass: - #325 - #326 - #327 - #329 ## Worth confirming - **Decision:** members who neither administer the workspace nor maintain one of its projects can no longer list a connected Linear workspace's teams; they see their projects' saved teams instead. - **Decision:** a session's agent writes nothing more to its tracker after 60 writes that failed in an hour, and a call names at most 20 labels. [fctl session](https://app.fctl.sh/s/ses_01M62HVCXZDZV6GJJP8DDQGDFF) --------- Co-authored-by: fctl-sh[bot] <343971779+fctl-sh[bot]@users.noreply.github.com> Co-authored-by: fctl-sh[bot] <fctl-sh[bot]@users.noreply.github.com>
#326) ## Summary Connecting a Claude token or a full Claude login makes it the person's default at once, and a full login's Claude account sees the sessions that run on it (Remote Control). With a stolen browser session or CLI token, someone could connect their own Claude login to the victim's account, with nothing to confirm and nothing said to the person, and from then on watch and message every session the victim started, whose agents hold the sessions' GitHub tokens and the projects' secrets, long after the stolen token was revoked. Connecting a Claude subscription is now a sensitive action (`Sensitive::ConnectClaude`), whether with a token, a sign-in through a host, or the token kept on one's runners. The web app and the CLI already confirm such actions with a passkey or a code where the instance asks for it. A new connection also emails the person when email is set up, saying what was connected, as a best effort that never fails the connection. Verified in `cargo xtask dev`: with confirmation on and an authenticator app, an unconfirmed access token gets `verification_required` for a token, a sign-in and a runners token, and connects once it confirmed with a code. The privacy policy lists the new email in: - hyperstructure/fctl-site#87 The other fixes from the same security pass: - #325 - #327 - #328 - #329 ## Worth confirming - **Decision:** like every sensitive action, this asks only where the primary instance owner turned on confirming it's you, which is off by default; elsewhere the email is what tells the person. - **Decision:** choosing the default connection, or a workspace's, stays unconfirmed: it only chooses among connections the person already has. [fctl session](https://app.fctl.sh/s/ses_01M62HVCXZDZV6GJJP8DDQGDFF) --------- Co-authored-by: fctl-sh[bot] <343971779+fctl-sh[bot]@users.noreply.github.com>
…in (#325) ## Summary A workspace admin could invite another address they hold, as an admin or a member, and keep that invitation for its 30 days. Once the other admins removed or demoted them, or their account was disabled, accepting it, or signing up with that address, brought them back into the workspace, or back as an admin: removing someone deleted only the invitations addressed to them, and joining gave the invitation's role whoever had sent it. An invitation now counts only while whoever sent it is still an active admin of the workspace (`workspaces::INVITER_STILL_ADMIN`). Joining checks it, the lists invitees and admins see and the public invitation preview leave the others out, and removing or demoting an admin deletes the invitations they sent. The same check covers invitations sent before this change. Verified in `cargo xtask dev` with three accounts: an admin's invitation to another account stops working once they are removed, demoted or disabled, and a current admin's invitation still joins. The other fixes from the same security pass: - #326 - #327 - #328 - #329 ## Worth confirming - **Decision:** a demoted admin's member invitations go too, not only their admin ones, since only admins invite; the remaining admins can send them again. [fctl session](https://app.fctl.sh/s/ses_01M62HVCXZDZV6GJJP8DDQGDFF) Co-authored-by: fctl-sh[bot] <343971779+fctl-sh[bot]@users.noreply.github.com>
Summary
A few ways in outlived what should have ended them, or got past a second factor:
Verified in
cargo xtask dev: disconnecting an address with an admin entry leaves a member's entry and uses up a reset link; an approved device code polls as denied after a password change; an admin invitation signs up an admin, and one whose address is now allowed as a member signs up a member; an account with an authenticator app is asked for a code, not its password, to add a passkey; and an unconfirmed token can't turn off Google codes where confirming is on. Unit tests cover setting up a first app.The privacy policy lists the new Google codes email in:
The other fixes from the same security pass:
Worth confirming
fctl session