From 08c78bfb4033caaf9ec83e9857efcd1be0ba290d Mon Sep 17 00:00:00 2001 From: Mohd Kaif <98801504+KaifAhmad1@users.noreply.github.com> Date: Sun, 30 Aug 2026 20:58:39 +0530 Subject: [PATCH] fix(security): resolve Scorecard vulnerability and token-permission alerts (#1280) - Bump explorer's brace-expansion (minimatch dep) 5.0.8 -> 5.0.9 and nanoid (postcss dep) 3.3.16 -> 3.3.18, fixing GHSA-rgw5-rvv9-x895 and GHSA-2v37-7h3g-55p8 (both DoS via unbounded input, both within the existing caret ranges declared by their parents). - Move codeql.yml and defender-for-devops.yml's security-events: write (and codeql.yml's actions: read) from workflow-level down to their single job, matching Scorecard's Token-Permissions ideal of a read-only top-level default with sensitive scopes granted only where used. --- .github/workflows/codeql.yml | 6 ++++-- .github/workflows/defender-for-devops.yml | 4 +++- explorer/package-lock.json | 12 ++++++------ 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 41433fbd..a0de4e1f 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -10,13 +10,15 @@ on: permissions: contents: read - security-events: write - actions: read jobs: analyze: name: Analyze Python runs-on: ubuntu-latest + permissions: + contents: read + security-events: write # for github/codeql-action/upload-sarif below + actions: read # for github/codeql-action/init's CodeQL bundle cache lookup steps: - name: Checkout repository diff --git a/.github/workflows/defender-for-devops.yml b/.github/workflows/defender-for-devops.yml index f8adfcfb..9d2e6076 100644 --- a/.github/workflows/defender-for-devops.yml +++ b/.github/workflows/defender-for-devops.yml @@ -28,12 +28,14 @@ on: permissions: contents: read - security-events: write jobs: MSDO: # currently only windows-latest is supported runs-on: windows-latest + permissions: + contents: read + security-events: write # for github/codeql-action/upload-sarif below steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 diff --git a/explorer/package-lock.json b/explorer/package-lock.json index c1dc30f4..e0018353 100644 --- a/explorer/package-lock.json +++ b/explorer/package-lock.json @@ -2083,9 +2083,9 @@ } }, "node_modules/brace-expansion": { - "version": "5.0.8", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.8.tgz", - "integrity": "sha512-JZyDyq3D4AUifKTPOB7DELf6XsB3WdPuNxCtob1vFXPsSXhdAiHBWJ/tJ8HAc9aH84BK+5JFZLNkJKx3G9kzQg==", + "version": "5.0.9", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.9.tgz", + "integrity": "sha512-ScQ4IuvIEF1TMlP7Zt+vjJ//9zlPb2SDcxWxM3bk8s6t6GGdJ7KO1dCcTidOPJKePW30LE/2cT7wCyPho9/Wxg==", "dev": true, "license": "MIT", "dependencies": { @@ -4250,9 +4250,9 @@ "license": "MIT" }, "node_modules/nanoid": { - "version": "3.3.16", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.16.tgz", - "integrity": "sha512-bzlKTyNJ7+LdGIIwy8ijFpIqEQIvafahV7eYykJ8Cvh42EdJeODoJ6gUJXpQJvej1BddH8OqTXZNE/KfbWAu8Q==", + "version": "3.3.18", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.18.tgz", + "integrity": "sha512-DTg4MJbGMWkfi6VZFdNt2/caMbQy4Ou+Op/hJQvGEWcnVfoA1QA+xzRKAzw9jD6+GVOOeYr/mIcuDSdug6F6+w==", "dev": true, "funding": [ {