devtools
515a608b - Validate extension file system access (#10083)

Commit
22 days ago
Validate extension file system access (#10083) * Ensure that extensions that are found in `ExtensionsManager._addExtensionsForRoot()` return `DevToolsExtensionConfig` objects with valid `extensionAssetsPath` URIs. * On Windows, Dart's Uri.toFilePath() translates a non-empty host (e.g., `file://attacker.example/share/proj`) into a Universal Naming Convention (UNC) path (`\\attacker.example\share\proj`), causing the OS to initiate a network connection. This is checked in the `assertUriFormat` helper function. * Disallow relative paths in `config['buildLocation']` In `ExtensionsManager._addExtensionsForRoot`. This prevents `path.join()` from wiping out preceding path components and pointing `extensionAssetsPath` at a parent directory. * Prevent extensions from using symlinks to gain arbitrary filesystem access. `path.isWithin()` doesn't inspect the disk, so we check that `pageRoot` and `location` are resolved using `Directory.resolveSymbolicLink` before calling `path.isWithin`. * Skip entries in extension build folder that are not symlinks * Add release note to DevTools extension updates section
Author
Parents
Loading