Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix(security)!: path-based app sharing changes#5772

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
deansheather merged 5 commits intomainfromdean/path-app-security
Jan 18, 2023

Conversation

deansheather
Copy link
Member

@deansheatherdeansheather commentedJan 18, 2023
edited
Loading

This commit disables path-based app sharing by default. It is possible for a workspace app on a path (not a subdomain) to make API requests to the Coder API. When accessing your own workspace, this is not much of a problem. When accessing a shared workspace app, the workspace owner could include malicious javascript in the page that makes requests to the Coder API on behalf of the visitor.

This vulnerability does not affect subdomain apps.

  • Disables path-based app sharing by default. Previous behavior can be restored using the--dangerous-allow-path-app-sharing flag which is not recommended.

  • Disables users with the site "owner" role from accessing path-based apps from workspaces they do not own. Previous behavior can be restored using the--dangerous-allow-path-app-site-owner-access flag which is not recommended.

  • Adds a flag--disable-path-apps which can be used by security-conscious admins to disable all path-based apps across the entire deployment. This check is enforced at app-access time, not at template-ingest time.

Note: After this is merged we will immediately release a minor release.

Updating the tests required a lot of massaging, since the workspaces were being made by the site owner in almost all of them.

https://github.com/coder/security/issues/3

This commit disables path-based app sharing by default. It is possiblefor a workspace app on a path (not a subdomain) to make API requests tothe Coder API. When accessing your own workspace, this is not much of aproblem. When accessing a shared workspace app, the workspace ownercould include malicious javascript in the page that makes requests tothe Coder API on behalf of the visitor.This vulnerability does not affect subdomain apps.- Disables path-based app sharing by default. Previous behavior can be  restored using the `--dangerous-allow-path-app-sharing` flag which is  not recommended.- Disables users with the site "owner" role from accessing path-based  apps from workspaces they do not own. Previous behavior can be  restored using the `--dangerous-allow-path-app-site-owner-access` flag  which is not recommended.- Adds a flag `--disable-path-apps` which can be used by  security-conscious admins to disable all path-based apps across the  entire deployment. This check is enforced at app-access time, not at  template-ingest time.
@deansheatherdeansheather requested a review froma team as acode ownerJanuary 18, 2023 18:49
@deansheatherdeansheather requested review frompresleyp and removed request fora teamJanuary 18, 2023 18:49
@github-actionsgithub-actionsbot added the release/breakingThis label is applied to PRs to detect breaking changes as part of the release process labelJan 18, 2023
@deansheatherdeansheather removed the request for review frompresleypJanuary 18, 2023 18:50
@mafredrimafredri added the securityArea: security labelJan 18, 2023
},
DisablePathApps:&codersdk.DeploymentConfigField[bool]{
Name:"Disable Path Apps",
Usage:"Disable workspace apps that are not served from subdomains. Path-based apps can make requests to the Coder API and pose a security risk when the workspace serves malicious Javascript. This is recommended for security purposes if a --wildcard-access-url is configured.",
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Usage:"Disable workspace apps that are not served from subdomains. Path-based apps can make requests to the Coder API and pose a security risk when the workspace serves maliciousJavascript. This is recommended for security purposes if a --wildcard-access-url is configured.",
Usage:"Disable workspace apps that are not served from subdomains. Path-based apps can make requests to the Coder API and pose a security risk when the workspace serves maliciousJavaScript. This is recommended for security purposes if a --wildcard-access-url is configured.",

Should this be default if--wildcard-access-url is enabled? I think it'd be preferable if we were secure-by-default in most configurations.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Maybe we could make that change in the future, but the other changes in this PR of disabling sharing for path-based apps will mitigate this problem in almost all cases.

mafredri reacted with thumbs up emoji
Copy link
Member

@EmyrkEmyrk left a comment

Choose a reason for hiding this comment

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

I approve the way we interact with authz.

Unfortunately to do this entirely in authz RBAC checks would require dynamic permissions , scopes, or roles.

Dynamic roles is not something we should really get into prematurely, so doing a static check if theworkspace.OwnerID == roles.ID is just something we have to live with right now.

Another opther option looked into was making a new resource for Path based apps, but still has the issue of making dynamic permissions based on mutable flags 😢. If we did this, we could implement the permissions such that there is no security vulnerability (by not giving perms for path based apps), but then users cannot share path based apps which is a great feature for small deployments and demos 🤷.

UX vs security is always a fun battle.


👍

Comment on lines +170 to +173
typeDangerousConfigstruct {
AllowPathAppSharing*DeploymentConfigField[bool]`json:"allow_path_app_sharing" typescript:",notnull"`
AllowPathAppSiteOwnerAccess*DeploymentConfigField[bool]`json:"allow_path_app_site_owner_access" typescript:",notnull"`
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it would be nice to include the dangerous ratelimits flag in this config.

@deansheatherdeansheatherenabled auto-merge (squash)January 18, 2023 22:50
@deansheatherdeansheather merged commit0374af2 intomainJan 18, 2023
@deansheatherdeansheather deleted the dean/path-app-security branchJanuary 18, 2023 22:56
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsJan 18, 2023
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

@mafredrimafredrimafredri left review comments

@EmyrkEmyrkEmyrk approved these changes

@kylecarbskylecarbsAwaiting requested review from kylecarbs

+1 more reviewer

@coadlercoadlercoadler approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

release/breakingThis label is applied to PRs to detect breaking changes as part of the release processsecurityArea: security

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

4 participants

@deansheather@mafredri@Emyrk@coadler

[8]ページ先頭

©2009-2025 Movatter.jp