Repository navigation
fix!: validate workspace app URLs on the server - #31262
Merged
Merged
Conversation
Contributor
Docs previewCheck off each page once it's been reviewed. If a page changes in a later push, its checkbox clears automatically so it gets a fresh look. Pages not yet wired into the docs navigation aren't listed here. |
EhabY
force-pushed
the
fix/validate-workspace-app-urls
branch
from
October 26, 2026 11:39
0c664b6 to
396b457
Compare
EhabY
marked this pull request as ready for review
October 26, 2026 11:44
EhabY
force-pushed
the
fix/validate-workspace-app-urls
branch
from
October 26, 2026 11:46
396b457 to
37fb1d8
Compare
untra
approved these changes
Oct 26, 2026
nickvigilante
approved these changes
Oct 26, 2026
nickvigilante
left a comment
Collaborator
There was a problem hiding this comment.
My agent found a few things worth considering, but overall, docs LGTM
Reject external app URLs with script, data, blob, or file schemes, or with control characters, in coderd for both template and sub-agent apps. Strip the $SESSION_TOKEN placeholder from sub-agent app URLs, and drop app status URIs that aren't http, https, or file links.
EhabY
force-pushed
the
fix/validate-workspace-app-urls
branch
from
October 27, 2026 11:08
37fb1d8 to
5c1013a
Compare
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Validate workspace app URLs in coderd, not only in the provisioner.
ValidateExternalURLalso rejectsjavascript,vbscript,data,blob,fileandfilesystemschemes, and control characters anywhere in the URL.insertAgentAppruns it for external template apps, so builds from older or external provisioners get the same check.CreateSubAgentstrips$SESSION_TOKENfrom app URLs (clients already never fill it in for sub-agent apps) and validates external URLs. A bad URL becomes a per-appurlerror; the sub-agent still starts.UpdateAppStatuskeeps onlyhttp,httpsandfileURIs. Anything else is dropped and the status is still saved.Breaking changes
coder_appURL uses one of the blocked schemes or contains control characters. With an older or external provisioner, URLs without a scheme or host now also fail in coderd.$SESSION_TOKENis removed from the stored URL, and external apps with an invalid URL are no longer created.http,httpsandfile(for examplevscode://orn/a) are no longer stored.Existing stored apps and statuses are unchanged.
Decision log
zed://,coder://, new IDEs), so an allowlist can't be complete and would fail builds. Same approach as OAuth2 redirect URIs (codersdk/oauth2_validation.go).ftpis left out since browsers no longer open it.file://as text, sohttp,https,fileis complete.$SESSION_TOKENrather than reject: keeps existingdevcontainer.jsonbuttons working.