Repository navigation
Ensure devtoolsOptionsUri points to a served extension - #10088
Merged
Merged
Conversation
johnpryan
requested review from
a team,
bkonyi and
kenzieschmoll
as code owners
November 12, 2026 17:27
Contributor
There was a problem hiding this comment.
Code Review
This pull request enhances security and robustness when handling devtoolsOptionsUri in the extension enablement API. It restricts options lookup to currently served extensions, rejects symlinked devtools_options.yaml files, and prevents recursive directory creation when the parent directory does not exist. A review comment suggests optimizing the validation logic in _devtools_extensions.dart to avoid unnecessary allocations and synchronous I/O operations by performing a fast-path string comparison first.
recursive directory creation. This ensures that `handleExtensionEnabledState` checks that `devtools_options.yaml` matches the actual path of an extension that is currently served by `ExtensionsManager`, resolving symbolic links on the parent directory and rejecting `devtools_options.yaml` if it is a symbolic link. This also ensures that `DevToolsOptions._lookupOptionsFile` does not recursively create directories or follow symbolic links if the parent directory does not exist or `devtools_options.yaml` is a symbolic link, preventing `api/extensionEnabledState` from creating directories or writing files outside served extension package roots.
johnpryan
force-pushed
the
confine-devtools-options-uri
branch
from
November 12, 2026 17:30
8cd4d88 to
ce294d6
Compare
* Iterate over extensionsManager.devtoolsExtensions. * Return `true` immediately to avoid extra calls to `_resolveOptionsFilePath`.
srawlins
approved these changes
Nov 12, 2026
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.
This makes sure that
devtoolsOptionsUripoints to a served extension and prevents recursive directory creation.This ensures that
handleExtensionEnabledStatechecks thatdevtools_options.yamlmatches the actual path of an extension that is currently served byExtensionsManager, resolving symbolic links on the parent directory and rejectingdevtools_options.yamlif it is a symbolic link.This also ensures that
DevToolsOptions._lookupOptionsFiledoes not recursively create directories or follow symbolic links if the parent directory does not exist ordevtools_options.yamlis a symbolic link, preventingapi/extensionEnabledStatefrom creating directories or writing files outside served extension package roots.This makes progress towards: