Repository navigation
fix: tighten sign-in, authorization and outbound request checks - #361
Merged
Merged
Conversation
…serName Scimitar applies a PUT through the schema's mutability only and never consults scim_mutable_attributes, so a full-resource replace reached scim_user_name= and rewrote the shared User#email. An existing membership now ignores the incoming address; the rest of the PUT (such as active: false) still applies. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Artem Petrov <[email protected]>
… verified domain User#name is shared across every company a person belongs to, yet any directory could set it for any membership it provisioned, including an invited outsider. The name is now applied after save, and only when the membership is active and the address sits in the company's verified domain. Owning the domain for SCIM auto-acceptance now also requires that verification, as domain auto-join already does. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Artem Petrov <[email protected]>
The profile usage page serialized a colleague's sessions without a viewer, and TerminalSessionResource read a missing viewer as the owner: unredacted prompt and metadata, the owner-only container URLs, and container tickets issued in the owner's name. The page now passes the viewer, and the session, step-run and session-list resources treat a missing viewer as a stranger and issue no ticket. Every owner-scoped caller passes `viewer: current_user` so owners keep full data. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Artem Petrov <[email protected]>
A company-scoped provider could attach itself to an existing account whenever the address matched the company's claimed email domain, even before the company had proved it owns that domain. Promotion now also requires the domain to be verified, matching domain auto-join. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Artem Petrov <[email protected]>
The catalog's project picker and duplicate looked projects up across every company the user belongs to, while the role check covered only the current one, so a copy could land in a project of a company where the user only views. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Artem Petrov <[email protected]>
Validate the issuer at save (https, public address, no query or fragment) and send discovery, JWKS and token requests through SafeHttp so each is dialed only at the vetted address, over https, without following redirects. Transport and discovery errors now end the sign-in as oauth_failed instead of an error page. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Artem Petrov <[email protected]>
The AWS connection endpoints and project-less session launches had no company context, so their viewer check fell back to "a viewer in every company". A viewer of the acting company who works elsewhere could bind a Bedrock connection there and launch project-less agent sessions billed to it. The connection endpoints now authorize against the current company, and a project-less launch against the company the session is billed to; auth_setup sessions stay open to viewers. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Artem Petrov <[email protected]>
Domain auto-join ran on whatever address an assertion carried, including Microsoft's `mail`, which any Entra tenant can set to an address at another organisation's domain. DomainAutoJoin now takes an explicit `verified:` and joins nobody, not even as a pending request, without it. Microsoft still never proves the mailbox, but it now reports when the tenant has shown it owns the address's domain: the address equals the `upn` (whose suffix Entra requires to be DNS-verified in that tenant) or `xms_edov` vouches for the `email` claim. That is enough to place someone in the company owning the same domain, and it never promotes onto an existing account. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Artem Petrov <[email protected]>
A non-trusted Coder host with no public IPv4 used to fall back to the system resolver, whose answer can differ from the one checked when the URL was saved. Refuse instead, judge literal addresses with blocked_ip?, and pin the connection to the chosen address rather than rewriting the URL, so Host, SNI and certificate checks stay the instance's own. resolve_public_ipv4 now skips every address blocked_ip? rejects (0.0.0.0/8, 100.64.0.0/10, ...), and the coder CLI re-checks the URL before each run. Trusted hosts keep using internal DNS. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Artem Petrov <[email protected]>
Asset and workflow run asset names are relative paths under /workspace/assets. Validate them as such, check the resolved target at both container download points so rows stored before the validation are skipped instead of written elsewhere, and reduce Slack file names to their last segment. Template packages with such names are refused. The workflow step download now creates the parent directory, so nested prior-step outputs reach the next step. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Artem Petrov <[email protected]>
…gan it The login state was signed and single use but tied to nothing on the client, so a callback link from one person's login completed in any browser within the state's lifetime. The state nonce is now kept in the session at the start of the flow and must match on callback before the server-side entry is consumed. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Artem Petrov <[email protected]>
…trols trigger_task_workflow with force cancelled the task's in-flight run for any project writer, while cancel_workflow_run and the run screen reserve that to the run's starter or a company admin. The forced path now applies the same rule and returns the same refusal before cancelling anything. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Artem Petrov <[email protected]>
The web tree sends a session that has not proved a method the company accepts to step-up; /api/v1 served it anyway. The API now answers 403 step_up_required for the company the request acts in (the project's, then the session's), naming that company's step-up page, and apiFetch follows it. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Artem Petrov <[email protected]>
The token reached every company the user belongs to, whatever that company's sign-in policy. It now records the methods the issuing session proved and reaches only companies those methods satisfy; a token issued before this counts as a password sign-in. Signing out everywhere ends the token too. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Artem Petrov <[email protected]>
A colleague's usage lives on the company users screen, which renders it for a viewer; the profile page no longer takes a user_id. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Artem Petrov <[email protected]>
…ied domain Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Artem Petrov <[email protected]>
…ring Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Artem Petrov <[email protected]>
…dded or enabled A company connection now only attaches to accounts inside a verified domain, so on an unverified one it could never be proved or used; say so up front instead of failing at sign-in. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Artem Petrov <[email protected]>
artempartos
force-pushed
the
fix/access-hardening
branch
from
September 30, 2026 03:58
3283bdc to
2e6ede2
Compare
artempartos
added a commit
that referenced
this pull request
Sep 30, 2026
The rebase onto #361 put Project.for_user where Project.where(company_id: membership_company_ids) used to be. for_user spans every active membership, while membership_company_ids is the token's proven set, so the bare scope would list the projects of a company whose sign-in policy the token does not satisfy. The resolution keeps both; this pins it. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Artem Petrov <[email protected]>
artempartos
added a commit
that referenced
this pull request
Sep 30, 2026
…w lists (#371) * feat(assets): enhance asset creation with file validation and error handling - Added validation to ensure the uploaded file is an actual file and not a string. - Improved error handling to return specific messages when asset creation fails due to validation errors. - Updated tests to cover scenarios for successful file uploads, rejection of invalid file types, and handling of validation failures. Signed-off-by: Evgeniy Yagnenkov <[email protected]> Signed-off-by: Artem Petrov <[email protected]> * feat(auth): enhance auth error detection for binary logs - Introduced a `normalize` method in `AuthErrorDetector` to handle terminal bytes and ensure compatibility with ASCII-8BIT logs, preventing encoding errors during pattern matching. - Updated the `detect` and `extract_message` methods to utilize the new normalization process. - Enhanced tests to verify correct behavior when processing binary logs, including scenarios with and without auth banners. Signed-off-by: Evgeniy Yagnenkov <[email protected]> Signed-off-by: Artem Petrov <[email protected]> * feat(tests): optimize project access checks in PersonalMCPTest - Added a test to ensure that listing projects does not re-check access for each project, reducing unnecessary database queries and improving performance. - Introduced a test to verify that all projects in a company administered by the caller are included in the project list. - Updated the `accessible_projects` method to utilize a single query for project access, enhancing efficiency. Signed-off-by: Evgeniy Yagnenkov <[email protected]> Signed-off-by: Artem Petrov <[email protected]> * feat(skills): enhance null byte handling in skill markdown processing - Updated the `normalize` method to remove null bytes from content, ensuring valid UTF-8 encoding before processing. - Added tests to verify that null bytes are stripped from skill names and descriptions, preventing errors during database operations. - Enhanced existing tests to confirm that frontmatter parsing correctly handles content with null bytes. Signed-off-by: Evgeniy Yagnenkov <[email protected]> Signed-off-by: Artem Petrov <[email protected]> * fix(company_membership): prevent refresh on errored credentials in agent model fetching - Updated the `agent_models_for_props` method to return an empty array if the credential is marked as errored, preventing unnecessary refresh attempts and associated errors. - Added a test to verify that the method does not attempt to refresh a credential already marked as an error, ensuring stability in the agent model loading process. Signed-off-by: Evgeniy Yagnenkov <[email protected]> Signed-off-by: Artem Petrov <[email protected]> * feat(workflows): optimize workflow run statistics retrieval - Introduced a new method `attach_run_stats` in the `Workflow` model to efficiently gather run statistics (count, last run time, last state, and active status) in a single query, reducing database load. - Updated `WorkflowResource` to utilize the new run statistics instead of loading runs directly, improving performance and reducing unnecessary data loading. - Modified various controllers to leverage the new statistics, ensuring that workflows are rendered with accurate run data without excessive queries. - Enhanced tests to verify the correctness of the new run statistics functionality and ensure that workflows are displayed correctly without counting runs per workflow in certain contexts. Signed-off-by: Evgeniy Yagnenkov <[email protected]> Signed-off-by: Artem Petrov <[email protected]> * test(mcp): keep list_projects to the companies the token was issued for The rebase onto #361 put Project.for_user where Project.where(company_id: membership_company_ids) used to be. for_user spans every active membership, while membership_company_ids is the token's proven set, so the bare scope would list the projects of a company whose sign-in policy the token does not satisfy. The resolution keeps both; this pins it. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Artem Petrov <[email protected]> --------- Signed-off-by: Evgeniy Yagnenkov <[email protected]> Signed-off-by: Artem Petrov <[email protected]> Co-authored-by: Artem Petrov <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
4 of 5 tasks
aixle-com Bot
pushed a commit
that referenced
this pull request
Nov 26, 2026
Refs #361 Signed-off-by: Aixle Flow <[email protected]>
aixle-com Bot
pushed a commit
that referenced
this pull request
Nov 26, 2026
Refs #361 Signed-off-by: Aixle Flow <[email protected]>
artempartos
pushed a commit
that referenced
this pull request
Nov 27, 2026
* feat(tasks): edit task title, description and properties separately (#361) Refs #361 Signed-off-by: Aixle Flow <[email protected]> * fix(frontend): satisfy lint and update drawer title test for single header title Signed-off-by: Aixle Flow <[email protected]> * fix(frontend): apply prettier formatting to task description color Signed-off-by: Aixle Flow <[email protected]> * fix(tasks): autosave properties, keep pencils for title and description Refs #361 Signed-off-by: Aixle Flow <[email protected]> * test(tasks): drop stale properties assertion from title edit test Refs #361 Signed-off-by: Aixle Flow <[email protected]> --------- Signed-off-by: Aixle Flow <[email protected]> Co-authored-by: Aixle Flow <[email protected]>
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.
Summary
A set of access-control and input-handling fixes, one commit per change.
Sign-in and identity
PUTcan no longer change an existing member's email. It also writes a member's display name only for an active member inside the company's verified domain.upnclaim equal to the email, orxms_edov.SafeHttp. The issuer is validated when it is saved, and a failed request now redirects withoauth_failedinstead of returning a 500.Authorization
vieweras a non-owner. Every caller now passesviewer: current_user./profile/usageshows only the signed-in user; it no longer acceptsuser_id(a colleague's usage is on the company users screen)./api/v1enforces the company sign-in policy (SSO-only / step-up) for the company the request acts in. A refusal returns403 { error: "step_up_required", stepUpUrl }, andapiFetchredirects the browser there.trigger_task_workflow force: truecancels only runs the caller controls.Containers and integrations
/workspace/assets, and nested prior-step outputs now get their directory created.coderCLI host is checked before each exec.Deploy notes
users.mcp_token_proof_provider_ids(nullable bigint array). It is additive and safe for a rolling deploy.step_up_required. It shows the error toast instead of redirecting, which is harmless.upn(orxms_edov) in the ID token. Otherwise new Microsoft users are created but do not auto-join any company. Check the app registration before deploying.oauth_faileduntil an admin edits the issuer.URL_SAFETY_TRUSTED_HOSTS.After deploy
List identities linked through company-scoped connections whose company domain is not verified, and review them:
Test plan
app/frontend/shared/lib: 126 passed. tsc and eslint report no errors in changed files.🤖 Generated with Claude Code