-
Notifications
You must be signed in to change notification settings - Fork 2.4k
feat: initial implementation of extension malware check #4272
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
feat: initial implementation of extension malware check #4272
Conversation
| let mut headers = HeaderMap::new(); | ||
| headers.insert( | ||
| USER_AGENT, | ||
| HeaderValue::from_static("goose-osv-check/1.1 (+https://osv.dev)"), |
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.
This was an idea from Goose. But I actually really liked it! Just in-case the OSV team want to identify us and/or hit us up
| return Err(ExtensionError::ConfigError(format!( | ||
| "Blocked malicious package: {name}@{ver} ({ecosystem}). OSV MAL advisories: {details}" |
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.
should we consider making the error more actionable? I was curious how to deal with false positives. Looks like the recommended way is to create a GH issue
https://github.com/ossf/malicious-packages/blob/main/README.md#false-positives
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.
message could say to "contact your adminstrator" which ... I hate when I see that as it is often me!
|
I think this is ok - will need some fmt done and I think needs a timeout, but we can try it. |
037ca86 to
9aa5e3d
Compare
|
Awesome! Did you mean to pull in the other commits to this branch? |
Bad rebase. Fixing it 🙏 |
Signed-off-by: Alex Rosenzweig <[email protected]>
827e453 to
6227baf
Compare
michaelneale
left a comment
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.
nice! got it there
…nscribing * 'main' of github.com:block/goose: update tetrate blog date to today (#4368) tetrate signup: blog/launch post (#4313) Implement graceful recipe error handling with filename display (#4363) docs: airgapped operation by bypassing hermit for desktop app (#4063) remove Ollama card from welcome screen (#4348) feat: initial implementation of extension malware check (#4272) Add Tetrate Agent Router Service to Provider Registry (#4354) Goose Simple Compact UX (#4202) Refactor Extensions Install Modal (#4328) fix: url path trailing slash for custom-providers (#4345) docs: update available and onboarding providers list (#4356)
* 'main' of github.com:block/goose: Fix eleven labs audio transcription and added more logging (#4358) feat: re-introduce session sharing (#4370) remove duplicate blog post (#4369) fix focus ring under form submits (#4332) Trigger docs deployment update tetrate blog date to today (#4368) tetrate signup: blog/launch post (#4313) Implement graceful recipe error handling with filename display (#4363) docs: airgapped operation by bypassing hermit for desktop app (#4063) remove Ollama card from welcome screen (#4348) feat: initial implementation of extension malware check (#4272) Add Tetrate Agent Router Service to Provider Registry (#4354) Goose Simple Compact UX (#4202)
* main: (38 commits) feat: linux computer control for android (termux) (#3890) feat: Added scroll state support for chat-session-list navigation (#4360) docs: typo fix (#4376) blog: goose janitor (#4131) Fix eleven labs audio transcription and added more logging (#4358) feat: re-introduce session sharing (#4370) remove duplicate blog post (#4369) fix focus ring under form submits (#4332) Trigger docs deployment update tetrate blog date to today (#4368) tetrate signup: blog/launch post (#4313) Implement graceful recipe error handling with filename display (#4363) docs: airgapped operation by bypassing hermit for desktop app (#4063) remove Ollama card from welcome screen (#4348) feat: initial implementation of extension malware check (#4272) Add Tetrate Agent Router Service to Provider Registry (#4354) Goose Simple Compact UX (#4202) Refactor Extensions Install Modal (#4328) fix: url path trailing slash for custom-providers (#4345) docs: update available and onboarding providers list (#4356) ...
Signed-off-by: Alex Rosenzweig <[email protected]> Co-authored-by: Michael Neale <[email protected]> tested it a few ways, surgical change. Signed-off-by: Dorien Koelemeijer <[email protected]>
Description
Goose users need to install extensions in order to get the full utility they desire. However, our stdio MCPs are quite often coming from package ecosystems that can contain malware.
Though it's not possible to completely protect users from all forms of Malware (and other Supply Chain Attacks) implementing some basic checks for known bad packages better protects all Goose users! ❤️
Implementation
When a user attempts to activate an extension we will parse out the name of the package and/or version information (where possible) and attempt to query the OSV API to understand if the package contains malware (identified by MAL in the formatting).
If the http call fails for some reason and/or we have issues parsing we opt to fail open to ensure this doesn't present a disruption to users.
Note: This implementation only supports PyPi and NPM as package manager formats
Handling of non-provided package versions
One key choice here was we @latest syntax and no version provided syntax by checking if any version of the package has malware. Broadly speaking it's going to be rare that an extension is compromised, malware finding filed and then persisted on those versions but it "could" happen and I'm open to adjusting the approach if we have major upfront concerns
OSV/Malicious Packages
The OSV project contains vulnerability information and malware information for open-source packages. The Malware information is populated via https://github.com/ossf/malicious-packages and broadly is a trustworthy datasource.
Though OSV does contain vulnerability data we're strictly only checking for Malware in this case. We could potentially inform users of CVEs in the future using this interface but we'd want to make the product interface there much easier to understand for all users!
Testing