feat: add VSIX module for parsing VS Code extensions#540
feat: add VSIX module for parsing VS Code extensions#540dguido wants to merge 6 commits intoVirusTotal:mainfrom
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Add a new module for parsing Visual Studio Code Extension (VSIX) files,
enabling YARA rules to match on extension metadata and security-relevant
properties.
Fields exposed:
- Identity: name, display_name, publisher, version, id, description
- Entry points: main, browser (security-critical)
- Activation: activation_events array
- Metadata: vscode_version, repository, homepage, license, categories, keywords
- Archive: files list
Functions:
- activationhash(): SHA-256 hash of sorted activation events
- has_activation_event(event): Check for specific activation event (e.g., "*")
Example rule to detect wildcard activation:
```
import "vsix"
rule wildcard_activation {
condition:
vsix.is_vsix and vsix.has_activation_event("*")
}
```
202cb55 to
1137cd2
Compare
Address code review feedback about file.name() usage. The warning about path traversal applies to extraction operations, not metadata reading. File names are stored as opaque strings for YARA rule matching and never used as filesystem paths.
58018b0 to
e882e9f
Compare
|
Hey @plusvic , let me know if you want some help testing this feature out. I have a few rules I can share. I also put together a repository of known malicious VS Code extensions here: https://github.com/trailofbits/vsix-zoo |
|
The code looks good, my only request is implementing the tests cases in the same way that the rest of the modules. A few VSIX test files and their expected output. The reason is twofold:
|
|
Sounds good. I'll work on that tomorrow. |
Summary
Add a new module for parsing Visual Studio Code Extension (VSIX) files, enabling YARA rules to match on extension metadata and security-relevant properties.
This module is designed for security analysis of VS Code extensions, similar to how the existing
crxmodule handles Chrome extensions.Fields exposed
name,display_name,publisher,version,idmain,browseractivation_eventsvscode_versionrepository,homepage,licensecategories,keywordsfilesFunctions
activationhash()has_activation_event(event)Example rules
Test plan
cargo test -p yara-x vsix🤖 Generated with Claude Code