feat: add Snyk agent-scan for dynamic skill scanning based on toxicskills#310
Open
lirantal wants to merge 6 commits intoopenclaw:mainfrom
Open
feat: add Snyk agent-scan for dynamic skill scanning based on toxicskills#310lirantal wants to merge 6 commits intoopenclaw:mainfrom
lirantal wants to merge 6 commits intoopenclaw:mainfrom
Conversation
Contributor
|
@lirantal is attempting to deploy a commit to the Amantus Machina Team on Vercel. A member of the Team first needs to authorize it. |
Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
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.
The Prompt Request here is essentially: use Snyk's mcp-scan Python package via
uvx mcp-scan --skills <path-to-skill-directory> --jsonto dynamically evaluate whether a skill is malicious or adds risk, based on the JSON output show a yes/no prompt to the user asking them to confirm if they wish to proceed with installing the skillIn this PR I am following up on Jamieson O'Reilly's request to create a PR that adds a dynamic skill scanning capability that goes beyond static database checks/heuristics. Initially I would like to add this to the clawhub CLI, hence a PR to this repository, and later evaluate this security scanning powering OpenClaw directly.
Summary
clawhubCLI for theinstallcommand with an extra skill check (after the VirusTotal check)clawhub install <skill>command runsuvx mcp-scan@latest --skills <path-to-skill-directory> --jsonclawhubintegration finds potentially undesired behavior in a real skill on clawhub.ai that isn't picked up by VirusTotal or OpenClaw security controls.Note: this change assumes
uvx(the python command-line tool) is available in the user's environment. We're evaluating at Snyk exposing an API for this instead, so may consider this PR as WIP until next week and I'll post an update.Testing
How to test this PR:
bun run test -- packages/clawdhub/src/cli/commands/skills.test.tsDemo
agent-scan-with-openclaw-cli-integration-video.mov
Greptile Overview
Greptile Summary
This PR integrates Snyk's
mcp-scantool to add dynamic security analysis of skills during installation, complementing the existing VirusTotal static checks. The implementation adds acheckSkillSecurityfunction that executesuvx mcp-scanon downloaded skill files and filters violations against an ignore list.Key Changes:
checkSkillSecurityfunction usingexecSyncto run Snyk's agent-scan toolcmdInstallafter zip extraction but before lockfile writesCritical Issues Found:
targetPathis interpolated directly into a shell command without sanitization, allowing potential code execution if malicious slugs are provided--forceflag behavior (lines 173-192): The error message claims--forcebypasses Snyk violations in non-interactive mode, but the flag is not actually checkedConsiderations:
uvxis available in the user's environment (noted as WIP in PR description)execSyncdependencyConfidence Score: 1/5
execSyncusage creates a critical attack vector. The--forceflag logic inconsistency is also a bug that needs correction. These issues significantly outweigh the security benefits this PR aims to provide.Last reviewed commit: d59c6e9
(3/5) Reply to the agent's comments like "Can you suggest a fix for this @greptileai?" or ask follow-up questions!