Skip to content

fix(malysis): support VS Code and OpenVSX ecosystems in OSV reports#751

Open
syf2211 wants to merge 2 commits into
safedep:mainfrom
syf2211:fix/report-osv-vscode-extensions-651
Open

fix(malysis): support VS Code and OpenVSX ecosystems in OSV reports#751
syf2211 wants to merge 2 commits into
safedep:mainfrom
syf2211:fix/report-osv-vscode-extensions-651

Conversation

@syf2211

@syf2211 syf2211 commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Add VS Code marketplace and OpenVSX extension support to the OpenSSF malicious package OSV report generator used by vet inspect malware --report-osv.

Fixes #651

Motivation

--report-osv failed with unsupported ecosystem for VS Code / OpenVSX extension malware analysis. OSSF malicious-packages already maintains advisories under osv/malicious/vscode and osv/malicious/vscode:open-vsx.org, but the generator only mapped npm, PyPI, RubyGems, Go, Maven, and crates.io.

Changes

  • Map ECOSYSTEM_VSCODE to file path vscode and OSV JSON ecosystem VSCode
  • Map ECOSYSTEM_OPENVSX to file path vscode:open-vsx.org and OSV JSON ecosystem VSCode:https://open-vsx.org
  • Use ECOSYSTEM range type for VS Code marketplaces (same rationale as PyPI)
  • Add unit tests for path generation and report output for both ecosystems

Tests

  • go test ./pkg/malysis/... -count=1 — pass (all tests including new VS Code / OpenVSX cases)

Notes

  • Ecosystem strings and directory layout verified against live ossf/malicious-packages samples.
  • Reviewed with composer-2.5 subagent before submission (APPROVE).

Add vscode and vscode:open-vsx.org path/ecosystem mappings to the
OpenSSF malicious package report generator so --report-osv works for
IDE extension malware analysis.

Fixes safedep#651
@safedep

safedep Bot commented Jul 4, 2026

Copy link
Copy Markdown

SafeDep Report Summary

Green Malicious Packages Badge Green Vulnerable Packages Badge Green Risky License Badge

No dependency changes detected. Nothing to scan.

View complete scan results →

This report is generated by SafeDep Github App

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the OpenSSF malicious package OSV report generator (used by vet inspect malware --report-osv) to support VS Code Marketplace and OpenVSX ecosystems, aligning generated report paths and OSV ecosystem strings with OpenSSF’s malicious-packages layout.

Changes:

  • Treat VS Code / OpenVSX ecosystems as Range_ECOSYSTEM when generating range-based OSV affected data.
  • Add path + OSV-ecosystem mappings for VS Code (vscode / VSCode) and OpenVSX (vscode:open-vsx.org / VSCode:https://open-vsx.org).
  • Add unit tests covering relative path generation and report output for both ecosystems.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
pkg/malysis/ossf.go Adds ecosystem mappings and range-type selection for VS Code/OpenVSX OSV report generation.
pkg/malysis/ossf_test.go Adds test coverage for VS Code/OpenVSX path generation and OSV report output.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pkg/malysis/ossf.go
Comment thread pkg/malysis/ossf_test.go
Comment thread pkg/malysis/ossf_test.go
Comment on lines +412 to +413
},
setup: func(t *testing.T, dir string) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread pkg/malysis/ossf_test.go Outdated
Comment on lines +430 to +431
assert.Len(t, vuln.Affected[0].Versions, 1)
assert.Equal(t, "4.5.6", vuln.Affected[0].Versions[0])

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@KunalSin9h

Copy link
Copy Markdown
Member

@syf2211 can you check some comment from copilot that i tagged you

Add UseRange=true to the OpenVSX test case and assert Range_ECOSYSTEM
instead of explicit Versions, per maintainer review feedback on safedep#751.
@syf2211

syf2211 commented Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @KunalSin9h — updated the OpenVSX test case in abb3dd2 to use UseRange: true and assert Range_ECOSYSTEM instead of explicit Versions, matching the VS Code marketplace test pattern.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

report-osv for vscode extension is broken

3 participants