-
Notifications
You must be signed in to change notification settings - Fork 0
CLI control of browser extensions #24
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CLI control of browser extensions #24
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Performed full review of c1e1cc6...5aec0a9
Analysis
-
CRITICAL SECURITY VULNERABILITY: The
Unzip
function inpkg/util/zip.go
contains a directory traversal vulnerability. The current path validation approach is insufficient and could allow attackers to write files outside the intended directory when processing malicious zip files. -
Improved Resource Management Needed: In
cmd/extensions.go
, the defer cleanup should useos.Remove(tmpName)
directly in the defer function rather than the current implementation to ensure cleanup happens even during panic scenarios. -
Consider Additional Security Measures: While the architecture includes some security considerations, additional validation may be needed beyond the CUID regex validation to fully secure extension management operations.
-
Test for Edge Cases: Ensure robust testing of error paths and edge cases, particularly around extension validation and zip/unzip functionality where security vulnerabilities were identified.
Tip
⚡ Quick Actions
This review was generated by Mesa.
Actions:
Slash Commands:
/review
- Request a full code review/review latest
- Review only changes since the last review/describe
- Generate PR description. This will update the PR body or issue comment depending on your configuration/help
- Get help with Mesa commands and configuration options
9 files reviewed | 0 comments | Review on Mesa | Edit Reviewer Settings
…d-browser-extensions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
overall lgtm ^^
blocking merge until we can update the deps
kernel extensions <list|delete|download|download-web-store>
for managing extensions and also downloading them as unpacked extensions from the chrome web storekernel browsers extensions upload
to do an ad-hoc upload to a running browser instanceAlong the way:
browsers list
browsers delete
TL;DR
This PR introduces CLI commands to manage browser extensions, allowing users to list, delete, download from the Chrome Web Store, and upload extensions to browser instances.
Why we made these changes
This addresses a feature request for programmatic control over browser extensions. It enables users to automate the setup of browser profiles with necessary extensions, improving developer workflow and consistency across environments.
What changed?
extensions
command:kernel extensions
for managing the extension registry withlist
,delete
,download
, anddownload-web-store
subcommands, implemented incmd/extensions.go
.browsers
command:browsers extensions upload
to install an extension in a running browser.--extension
flag tobrowsers create
to install extensions on creation.-o/--output json
option tobrowsers list
.browsers delete
to accept multiple session IDs.Unzip
utility inpkg/util/zip.go
to handle extension packages.go.mod
to replace thekernel-go-sdk
dependency.README.md
to document the new commands.cmd/extensions_test.go
.Validation
kernel extensions list
correctly displays registered extensions.kernel extensions delete
successfully removes an extension.kernel extensions download-web-store
downloads and unpacks an extension correctly.kernel browsers extensions upload
successfully installs an extension in a running browser.Description generated by Mesa. Update settings