Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
9f0e515
Add stuff
another-rex Oct 1, 2025
a66ef4b
chore: v2.2.3 changelog (#2255)
jess-lowe Oct 1, 2025
90bfff6
MCP MVP
another-rex Oct 1, 2025
239e084
Update workflows
another-rex Oct 1, 2025
e4e83b6
Fix lints
another-rex Oct 1, 2025
e0aeca0
test: update snapshots (#2258)
osv-robot Oct 2, 2025
48b2543
test: update snapshots (#2260)
osv-robot Oct 2, 2025
3501572
ci: create pr for updating scalibr even if tests fail (#2261)
G-Rath Oct 2, 2025
a3d1e1d
Mostly works
another-rex Oct 3, 2025
8e95e1c
chore: enable all `govet` checks by default (#2257)
G-Rath Oct 5, 2025
bcb606b
chore(deps): update workflows (#2264)
renovate-bot Oct 5, 2025
460ef0c
fix(deps): update osv-scanner minor (#2263)
renovate-bot Oct 5, 2025
ddacd76
chore(deps): lock file maintenance (#2265)
renovate-bot Oct 5, 2025
f936425
test: use a different name for the default config file and ensure all…
G-Rath Oct 7, 2025
8d06eb3
Fix description
another-rex Oct 7, 2025
807fac8
chore: add ignore file for javareach artifact testdata (#2266)
G-Rath Oct 8, 2025
983341d
test: introduce a `locks-many-with-insecure` collection of testdata (…
G-Rath Oct 8, 2025
67b0984
ci: ensure filenames don't have undesired characters (#2268)
G-Rath Oct 8, 2025
7d157e1
chore: add gemini config.yaml file (#2270)
michaelkedar Oct 9, 2025
943fc2c
Update prompt with more accurate steps
another-rex Oct 10, 2025
17129b6
test: update snapshots (#2277)
osv-robot Oct 13, 2025
4912aa1
fix(deps): update osv-scanner minor (#2276)
renovate-bot Oct 13, 2025
1508bad
test: update snapshots (#2280)
osv-robot Oct 14, 2025
882bb12
Merge remote-tracking branch 'upstream/main' into scanner-mcp
another-rex Oct 15, 2025
344dbd0
move and update
another-rex Oct 15, 2025
ad22449
small tweak
another-rex Oct 17, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .gemini/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
have_fun: false
code_review:
disable: false
comment_severity_threshold: MEDIUM
max_review_comments: -1
pull_request_opened:
help: false
summary: false
code_review: false
include_drafts: true
ignore_patterns: []
14 changes: 12 additions & 2 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ name: Checks

on:
push:
branches: [main, v1]
branches: ["main", "v1", "mcp"]
pull_request:
# The branches below must be a subset of the branches above
branches: [main, v1]
branches: ["main", "v1", "mcp"]
workflow_dispatch:

concurrency:
Expand All @@ -42,6 +42,16 @@ jobs:
with:
persist-credentials: false
- run: scripts/report_uncleaned_snapshots.py
filenames:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- run: |
find . -mindepth 1 ! -regex '.*/[#@A-Za-z0-9._-]*' -print0 \
| xargs -0 -I{} bash -c \
'printf "::error file=%q::This filename contains undesired characters\n" "$1" && false' _ {}
format:
permissions:
contents: read # to fetch code (actions/checkout)
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
go-version-file: go.mod
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@3599b3baa15b485a2e49ef411a7a4bb2452e7f93 # v3.30.5
uses: github/codeql-action/init@64d10c13136e1c5bce3e5fbde8d4906eeaafc885 # v3.30.6
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -59,7 +59,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@3599b3baa15b485a2e49ef411a7a4bb2452e7f93 # v3.30.5
uses: github/codeql-action/autobuild@64d10c13136e1c5bce3e5fbde8d4906eeaafc885 # v3.30.6

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
Expand All @@ -73,4 +73,4 @@ jobs:
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@3599b3baa15b485a2e49ef411a7a4bb2452e7f93 # v3.30.5
uses: github/codeql-action/analyze@64d10c13136e1c5bce3e5fbde8d4906eeaafc885 # v3.30.6
2 changes: 1 addition & 1 deletion .github/workflows/dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
go get github.com/google/osv-scalibr@"$latest_commit"
echo "latest_scalibr_commit=$latest_commit" >> "$GITHUB_ENV"
go mod tidy
- run: go test ./cmd/osv-scanner/ -run 'Test_run$'
- run: go test ./cmd/osv-scanner/ -run 'Test_run$' || true
env:
TEST_ACCEPTANCE: true
UPDATE_SNAPS: always
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/osv-scanner-unified-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ name: OSV-Scanner Scheduled Scan

on:
pull_request:
branches: ["main", "v1"]
branches: ["main", "v1", "mcp"]
schedule:
- cron: "12 12 * * 1"
push:
branches: ["main", "v1"]
branches: ["main", "v1", "mcp"]

# Restrict jobs in this workflow to have no permissions by default; permissions
# should be granted per job as needed using a dedicated `permissions` block
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/scorecards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
persist-credentials: false

- name: "Run analysis"
uses: ossf/scorecard-action@05b42c624433fc40578a4040d5cf5e36ddca8cde # v2.4.2
uses: ossf/scorecard-action@4eaacf0543bb3f2c246792bd56e8cdeffafb205a # v2.4.3
with:
results_file: results.sarif
results_format: sarif
Expand Down Expand Up @@ -68,6 +68,6 @@ jobs:

# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@3599b3baa15b485a2e49ef411a7a4bb2452e7f93 # v3.30.5
uses: github/codeql-action/upload-sarif@64d10c13136e1c5bce3e5fbde8d4906eeaafc885 # v3.30.6
with:
sarif_file: results.sarif
2 changes: 1 addition & 1 deletion .github/workflows/staleness.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/stale@3a9db7e6a41a89f618792c92c0e97cc736e1b13f # v10.0.0
- uses: actions/stale@5f858e3efba33a5ca4407a664cc011ad407f2008 # v10.1.0
with:
days-before-stale: 60
days-before-close: 14
Expand Down
5 changes: 5 additions & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ linters:
gocritic:
disabled-checks:
- ifElseChain
govet:
enable-all: true
disable:
- fieldalignment
- shadow
nlreturn:
block-size: 2
revive:
Expand Down
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
# v2.2.3

### Features:

- [Feature #2209](https://github.com/google/osv-scanner/pull/2209) Add support for resolving git packages that have a version specified.
- [Feature #2210](https://github.com/google/osv-scanner/pull/2210) Make the `--experimental-plugins` flag additive by default, and introduce a new `--experimental-no-default-plugins` flag.
- [Feature #2203](https://github.com/google/osv-scanner/pull/2203) Update `osv-scalibr` to 0.3.4 for improved dependency extraction. See osv-scalibr changelog for additional information.

### Fixes:

- [Bug #2214](https://github.com/google/osv-scanner/pull/2214) Fix issue where `input.Path` was incorrectly constructed on Windows when using the `-L` flag.
- [Fix #2241](https://github.com/google/osv-scanner/pull/2241) **Performance:** Greatly reduce memory usage in the local matcher by only loading advisories relevant to the packages being scanned.

# v2.2.2

### Features:
Expand Down
4 changes: 1 addition & 3 deletions cmd/osv-scanner/__snapshots__/main_test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ OPTIONS:
---

[Test_run/version - 1]
osv-scanner version: 2.2.2
osv-scanner version: 2.2.3
osv-scalibr version: 0.3.4
commit: n/a
built at: n/a
Expand All @@ -50,7 +50,6 @@ Warning: `scan` exists as both a subcommand of OSV-Scanner and as a file on the
[Test_run_SubCommands/with_no_subcommand - 1]
Scanning dir ./testdata/locks-many/composer.lock
Scanned <rootdir>/testdata/locks-many/composer.lock file and found 1 package
Loaded filter from: <rootdir>/testdata/locks-many/osv-scanner.toml
No issues found

---
Expand All @@ -62,7 +61,6 @@ No issues found
[Test_run_SubCommands/with_scan_subcommand - 1]
Scanning dir ./testdata/locks-many/composer.lock
Scanned <rootdir>/testdata/locks-many/composer.lock file and found 1 package
Loaded filter from: <rootdir>/testdata/locks-many/osv-scanner.toml
No issues found

---
Expand Down
33 changes: 0 additions & 33 deletions cmd/osv-scanner/fix/testdata/in-place-npm/osv-scanner.toml
Original file line number Diff line number Diff line change
@@ -1,35 +1,2 @@
[[PackageOverrides]]
name = "chownr"
ecosystem = "npm"
ignore = true
reason = "This is an intentionally vulnerable test project"

[[PackageOverrides]]
name = "concat-stream"
ecosystem = "npm"
ignore = true
reason = "This is an intentionally vulnerable test project"

[[PackageOverrides]]
name = "hosted-git-info"
ecosystem = "npm"
ignore = true
reason = "This is an intentionally vulnerable test project"

[[PackageOverrides]]
name = "request"
ecosystem = "npm"
ignore = true
reason = "This is an intentionally vulnerable test project"

[[PackageOverrides]]
name = "semver"
ecosystem = "npm"
ignore = true
reason = "This is an intentionally vulnerable test project"

[[PackageOverrides]]
name = "tough-cookie"
ecosystem = "npm"
ignore = true
reason = "This is an intentionally vulnerable test project"
21 changes: 0 additions & 21 deletions cmd/osv-scanner/fix/testdata/override-maven/osv-scanner.toml
Original file line number Diff line number Diff line change
@@ -1,23 +1,2 @@
[[PackageOverrides]]
name = "commons-io:commons-io"
ecosystem = "Maven"
ignore = true
reason = "This is an intentionally vulnerable test project"

[[PackageOverrides]]
name = "org.apache.httpcomponents:httpclient"
ecosystem = "Maven"
ignore = true
reason = "This is an intentionally vulnerable test project"

[[PackageOverrides]]
name = "org.codehaus.plexus:plexus-utils"
ecosystem = "Maven"
ignore = true
reason = "This is an intentionally vulnerable test project"

[[PackageOverrides]]
name = "org.jsoup:jsoup"
ecosystem = "Maven"
ignore = true
reason = "This is an intentionally vulnerable test project"
3 changes: 3 additions & 0 deletions cmd/osv-scanner/fix/testmain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@ import (
"github.com/google/osv-scanner/v2/cmd/osv-scanner/fix"
"github.com/google/osv-scanner/v2/cmd/osv-scanner/internal/cmd"
"github.com/google/osv-scanner/v2/cmd/osv-scanner/internal/testcmd"
"github.com/google/osv-scanner/v2/internal/config"
"github.com/google/osv-scanner/v2/internal/testlogger"
"github.com/google/osv-scanner/v2/internal/testutility"
)

func TestMain(m *testing.M) {
config.OSVScannerConfigName = "osv-scanner-test.toml"

slog.SetDefault(slog.New(testlogger.New()))
testcmd.CommandsUnderTest = []cmd.CommandBuilder{fix.Command}
m.Run()
Expand Down
2 changes: 2 additions & 0 deletions cmd/osv-scanner/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (

"github.com/google/osv-scanner/v2/cmd/osv-scanner/fix"
"github.com/google/osv-scanner/v2/cmd/osv-scanner/internal/cmd"
"github.com/google/osv-scanner/v2/cmd/osv-scanner/mcp"
"github.com/google/osv-scanner/v2/cmd/osv-scanner/scan"
"github.com/google/osv-scanner/v2/cmd/osv-scanner/update"
)
Expand All @@ -15,6 +16,7 @@ func main() {
scan.Command,
fix.Command,
update.Command,
mcp.Command,
}),
)
}
Loading
Loading