ci: add OWASP Dependency-Check and fix its CVSS 7+ findings (#17)

### Description

This PR adds [OWASP
Dependency-Check](https://devguide.owasp.org/en/05-implementation/02-dependencies/01-dependency-check/)
to CI. It also fixes the findings that would otherwise fail the check.

**`.github/workflows/dependency-check.yml`**

- Runs on pull requests, on pushes to `main`, every Monday at 04:17 UTC,
and on manual dispatch.
- Uses `dependency-check/Dependency-Check_Action`. The action image
ships the vulnerability database and runs with `--noupdate`, so the
workflow needs no NVD API key.
- Scans `pnpm-lock.yaml` without `pnpm install`. The scan includes
devDependencies.
- Fails on findings with a CVSS score of 7 or higher (`--failOnCVSS 7`).
- Uploads all report formats as the `dependency-check-reports` artifact.
- Uploads the SARIF report to code scanning. Pull requests from forks
skip this step because their token is read-only.
- Pins every action to a commit SHA, like the other workflows.

**`pnpm-lock.yaml`**

After the merge of #15 and #16, the scan reported 3 findings at CVSS 7
or higher. All 3 are indirect dependencies whose parent ranges already
accept the fixed release:

| Package | From | To | Advisory | Via |
|---|---|---|---|---|
| `lodash-es` | 4.17.21 | 4.18.1 | GHSA-r5fr-rjxr-66jc | `naive-ui` |
| `defu` | 6.1.4 | 6.1.7 | GHSA-737v-mqg7-c878 | `unconfig` |
| `browserslist` | 4.24.3 | 4.29.5 | GHSA-c83g-rgw3-j3cx |
`@babel/helper-compilation-targets` |

`package.json` does not change.

### Additional context

Verification on Node 26.13.0, following the procedure in
`docs/dependency-upgrade-plan.md`:

1. `pnpm install --frozen-lockfile`: passed. The peer dependency
warnings match the warnings before the change.
2. `pnpm lint`: passed.
3. `pnpm test`: 36 files and 208 tests passed.
4. `pnpm typecheck`: passed.
5. `pnpm build`: passed.
6. A local Dependency-Check run with the action image: exit code 0, 7
findings, none at CVSS 7 or higher.
7. `pnpm audit`:

| Severity | Before | After |
|---|---|---|
| Critical | 0 | 0 |
| High | 10 | 6 |
| Moderate | 8 | 7 |
| Low | 2 | 2 |

The 6 remaining high advisories come from `js-yaml` (via
`unplugin-vue-markdown`) and `nanoid` 3.3.6 (via `@it-tools/bip39`).
Dependency-Check scores them below 7, so they do not fail the check.

The first CI run on this PR confirmed two points:

- The scan ran and passed. The action's entrypoint appends a stray
`ci.yml` argument, and the CLI ignores it.
- The SARIF upload to code scanning succeeded.

---

### What is the purpose of this pull request?

- [ ] Bug fix
- [ ] New Feature
- [ ] Documentation update
- [x] Other

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01PEUYi2tUG18ZAD3PgqPU64

---------

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Destan Sarpkaya 2026-11-04 23:18:24 +01:00 • committed by GitHub
parent 3b2e54394b
commit d7de73fb63
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 60 additions and 48 deletions

51
.github/workflows/dependency-check.yml vendored Normal file
View file

@ -0,0 +1,51 @@
name: Dependency check
on:
pull_request:
push:
branches:
- main
schedule:
# Weekly: new CVEs appear without code changes.
- cron: '17 4 * * 1'
workflow_dispatch:
permissions:
contents: read
jobs:
dependency-check:
runs-on: ubuntu-latest
permissions:
contents: read
# The SARIF upload writes to code scanning.
security-events: write
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
# The scan reads pnpm-lock.yaml, so it needs no `pnpm install`.
# The action image ships the vulnerability database and runs with --noupdate.
- name: Run OWASP Dependency-Check
uses: dependency-check/Dependency-Check_Action@1e54355a8b4c8abaa8cc7d0b70aa655a3bb15a6c # main
with:
project: toolbox
path: '.'
format: 'ALL'
out: reports
args: >
--failOnCVSS 7
- name: Upload the reports
if: always()
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: dependency-check-reports
path: reports
# Pull requests from forks get a read-only token, so they skip the upload.
- name: Upload SARIF to code scanning
if: always() && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository)
uses: github/codeql-action/upload-sarif@33d7b85da1a04171e211befe2c739303b9a4c066 # v4.39.3
with:
sarif_file: reports/dependency-check-report.sarif
category: dependency-check

57
pnpm-lock.yaml generated
View file

@ -2810,11 +2810,6 @@ packages:
resolution: {integrity: sha512-YovQ3rzhaLMIrDjNDMkNS01tea93qhEhG5xy8f6+R0l+dw3Ki+5sCoIoI942iuLZTHWogWktgwVDhU09iNEimQ==}
engines: {node: 20 || >=22}
browserslist@4.24.3:
resolution: {integrity: sha512-1CPmv8iobE2fyRMV97dAcMVegvvWKxmq94hkLiAkUGwKVTyDLw33K+ZxiFrREKmmps4rIw6grcCFCnTMSZ/YiA==}
engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7}
hasBin: true
browserslist@4.29.5:
resolution: {integrity: sha512-khTmKu5NGYTotqcYo8Bew2k4RAE9PuXRSFRXG2lQBrCEQHyeQ/vX6gKMxfokwywBsLiXZMnHsmWMG1pnO8J7uQ==}
engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7}
@ -2850,9 +2845,6 @@ packages:
resolution: {integrity: sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==}
engines: {node: '>=6'}
caniuse-lite@1.0.30001688:
resolution: {integrity: sha512-Nmqpru91cuABu/DTCXbM2NSRHzM2uVHfPnhJ/1zEAJx/ILBRVmz3pzH4N7DZqbdG0gWClsCC05Oj0mJ/1AWMbA==}
caniuse-lite@1.0.30001820:
resolution: {integrity: sha512-gfWD6MxqVCqAOwmODfZf7DchWvlrA+SRdNX7ceLfg3xRqe5ssjjpF7EgslC/0tiLiNTajdaNN/q8c/5u/7Gz8w==}
@ -3108,8 +3100,8 @@ packages:
resolution: {integrity: sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==}
engines: {node: '>= 0.4'}
defu@6.1.4:
resolution: {integrity: sha512-mEQCMmwJu317oSz8CwdIOdwf3xMif1ttiM8LTufzc3g6kR+9Pe236twL8j3IYT1F7GfRgGcW6MWxzZjLIkuHIg==}
defu@6.1.7:
resolution: {integrity: sha512-7z22QmUWiQ/2d0KkdYmANbRUVABpZ9SNYyH5vx6PZ+nE5bcC0l7uFvEfHlyld/HcGBFTL536ClDt3DEcSlEJAQ==}
dequal@2.0.3:
resolution: {integrity: sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==}
@ -3191,9 +3183,6 @@ packages:
electron-to-chromium@1.5.476:
resolution: {integrity: sha512-LnPnRZ0esKB9NjsSIaC+mffW+5dAtBui6kbK5f9Qykblj4Q33cn6yIhuCcTVjwpvL3YJPqqQ4IlsNyriGNpyFQ==}
electron-to-chromium@1.5.73:
resolution: {integrity: sha512-8wGNxG9tAG5KhGd3eeA0o6ixhiNdgr0DcHWm85XPCphwZgD1lIEoi6t3VERayWao7SF7AAZTw6oARGJeVjH8Kg==}
email-normalizer@1.0.0:
resolution: {integrity: sha512-wZYuuMtL4kUOmg/TPtCrf9hAZjbFq+FcjWA85Z5nr2lGllRnWJPxCJw3gy4Cx+adMoyVw4VJfGGvt/OHgIW+qg==}
@ -4203,8 +4192,8 @@ packages:
resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==}
engines: {node: '>=10'}
lodash-es@4.17.21:
resolution: {integrity: sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==}
lodash-es@4.18.1:
resolution: {integrity: sha512-J8xewKD/Gk22OZbhpOVSwcs60zhd95ESDwezOFuA3/099925PdHJ7OFHNTGtajL3AlZkykD32HykiMo+BIBI8A==}
lodash.debounce@4.0.8:
resolution: {integrity: sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==}
@ -4521,9 +4510,6 @@ packages:
resolution: {integrity: sha512-P6wzfh6t70avmV8FrVEAd/36sOPJQ+hkaJVX1Laap9J/77m7M0eyozDvc8SwnDf4P7MP94gwbAAo0rg3YVXT+g==}
engines: {node: '>= 6.13.0'}
node-releases@2.0.19:
resolution: {integrity: sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw==}
node-releases@2.0.63:
resolution: {integrity: sha512-6li2QanLsAXpIH2R6j77MzRyvOyrvdTqlKtO4CgBdHGNvN99ZZfyxszHc5o5+IZBWD5u6Hzwg83JoGXmqZNG9Q==}
engines: {node: '>=18'}
@ -5469,12 +5455,6 @@ packages:
resolution: {integrity: sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg==}
engines: {node: '>=4'}
update-browserslist-db@1.1.1:
resolution: {integrity: sha512-R8UzCaa9Az+38REPiJ1tXlImTJXlVfgHZsglwBD/k6nj76ctsH1E3q4doGrukiLQd3sGQYu56r5+lo5r94l29A==}
hasBin: true
peerDependencies:
browserslist: '>= 4.21.0'
update-browserslist-db@1.3.4:
resolution: {integrity: sha512-t8wonIOdQyOjtPd2VktlBu6QjTVTks6v8bSi7kd0r2Vll8TK1JYDZtRRdbmCHOAMphkZgrzK+L+vXK4pyZ8t4A==}
hasBin: true
@ -5997,7 +5977,7 @@ snapshots:
dependencies:
'@babel/compat-data': 7.29.7
'@babel/helper-validator-option': 7.29.7
browserslist: 4.24.3
browserslist: 4.29.5
lru-cache: 5.1.1
semver: 6.3.2
@ -8373,13 +8353,6 @@ snapshots:
dependencies:
balanced-match: 4.0.4
browserslist@4.24.3:
dependencies:
caniuse-lite: 1.0.30001688
electron-to-chromium: 1.5.73
node-releases: 2.0.19
update-browserslist-db: 1.1.1(browserslist@4.24.3)
browserslist@4.29.5:
dependencies:
baseline-browser-mapping: 2.11.35
@ -8421,8 +8394,6 @@ snapshots:
camelcase@5.3.1: {}
caniuse-lite@1.0.30001688: {}
caniuse-lite@1.0.30001820: {}
ccount@2.0.1: {}
@ -8642,7 +8613,7 @@ snapshots:
has-property-descriptors: 1.0.2
object-keys: 1.1.1
defu@6.1.4: {}
defu@6.1.7: {}
dequal@2.0.3: {}
@ -8719,8 +8690,6 @@ snapshots:
electron-to-chromium@1.5.476: {}
electron-to-chromium@1.5.73: {}
email-normalizer@1.0.0:
dependencies:
typescript: 5.5.4
@ -9864,7 +9833,7 @@ snapshots:
dependencies:
p-locate: 5.0.0
lodash-es@4.17.21: {}
lodash-es@4.18.1: {}
lodash.debounce@4.0.8: {}
@ -10360,7 +10329,7 @@ snapshots:
evtd: 0.2.4
highlight.js: 11.12.0
lodash: 4.18.1
lodash-es: 4.17.21
lodash-es: 4.18.1
seemly: 0.3.10
treemate: 0.3.11
vdirs: 0.1.8(vue@3.5.44(typescript@6.0.3))
@ -10407,8 +10376,6 @@ snapshots:
node-forge@1.4.3: {}
node-releases@2.0.19: {}
node-releases@2.0.63: {}
nopt@10.0.1:
@ -11268,7 +11235,7 @@ snapshots:
unconfig@7.5.0:
dependencies:
'@quansync/fs': 1.1.0
defu: 6.1.4
defu: 6.1.7
jiti: 2.7.0
quansync: 1.0.0
unconfig-core: 7.5.0
@ -11517,12 +11484,6 @@ snapshots:
upath@1.2.0: {}
update-browserslist-db@1.1.1(browserslist@4.24.3):
dependencies:
browserslist: 4.24.3
escalade: 3.2.0
picocolors: 1.1.1
update-browserslist-db@1.3.4(browserslist@4.29.5):
dependencies:
browserslist: 4.29.5