Skip to content

Security & quality: patch deps, add CodeQL + Dependabot, harden Actions - #17

Merged
davide-pi merged 7 commits into
mainfrom
fix/security-alerts
Jul 31, 2026
Merged

Security & quality: patch deps, add CodeQL + Dependabot, harden Actions#17
davide-pi merged 7 commits into
mainfrom
fix/security-alerts

Conversation

@davide-pi

@davide-pi davide-pi commented Jul 31, 2026

Copy link
Copy Markdown
Owner

Addresses the repository's Security & Quality setup, in four parts.

1. Fix open Dependabot alerts (package-lock.json)

npm audit fix — bumps within existing semver ranges, lockfile only, no package.json change:

Package → version Severity Advisory
postcss 8.5.25 High GHSA-r28c-9q8g-f849 (source-map path traversal)
brace-expansion 1.1.18 / 2.1.4 High ReDoS / OOM DoS
ajv 6.15.0 Moderate ReDoS with $data
dompurify 3.4.12 Low GHSA-c2j3-45gr-mqc4 (custom-element bypass)

Closes the 4 open alerts. Lint + build verified green.

Note on npm audit noise: after the fix, npm audit reports ~11 "high" findings for minimatch/eslint/typescript-eslint. These are a false positive — the installed brace-expansion (1.1.18 / 2.1.4) is already ≥ the patched versions; npm's synthetic advisory range (<=5.0.7) over-matches and proposes a spurious eslint@10 major bump. Dependabot uses exact version matching and will not flag these. Not chased here (it would be a breaking devDependency upgrade).

2. CodeQL code scanning (.github/workflows/codeql.yml)

Advanced setup with the security-and-quality query suite for JavaScript/TypeScript, on push, PR, and a weekly schedule.

⚠️ Uses code scanning advanced setup. If "Default setup" is later enabled in repo settings it will conflict — keep code scanning on the workflow, not both.

3. Dependabot version updates (.github/dependabot.yml)

Weekly updates for npm and github-actions, grouped to reduce PR noise (npm minor/patch grouped; majors individual). Complements the automatic security updates already running.

4. Harden the Actions workflow (build-and-deploy.yml)

  • Per-job timeout-minutes and least-privilege permissions on the deploy jobs.
  • Actions pinned to version tags (@v4, @v3, @v3.2.1) for readability; Dependabot (part 3) tracks updates. (Full commit-SHA pinning was considered for stronger supply-chain protection but tags were preferred.)

Coordination note

This branch is cut from main, so it does not include the cleanup job from PR #15. Both PRs touch build-and-deploy.yml but in disjoint regions (this PR: lint/build/deploy-*; #15: an appended cleanup job), so they should merge without conflict in either order.

🤖 Opened with Claude Code

Bumps within existing semver ranges (lockfile only, no package.json change):
- postcss  -> 8.5.25  (fixes GHSA-r28c-9q8g-f849, high: source-map path traversal)
- brace-expansion -> 1.1.18 / 2.1.4  (fixes GHSA-*, high: ReDoS/OOM DoS)
- dompurify -> 3.4.12  (fixes GHSA-c2j3-45gr-mqc4, low: custom-element bypass)
- ajv -> 6.15.0  (fixes moderate ReDoS with $data)

Closes the 4 open Dependabot alerts. Lint + build verified green.

Co-Authored-By: Claude AI
- Pin all actions to full-length commit SHAs (with version comments) to
  prevent mutable-tag supply-chain attacks; Dependabot keeps them current.
- Add per-job least-privilege `permissions` and `timeout-minutes`.

Co-Authored-By: Claude AI
Static analysis for JavaScript/TypeScript on push, PR, and weekly schedule,
using GitHub's extended "security-and-quality" query suite. Actions pinned to SHA.

Co-Authored-By: Claude AI
Weekly updates, grouped to reduce PR noise (npm minor/patch grouped; majors
individual). Complements the existing automatic Dependabot security updates.

Co-Authored-By: Claude AI
@github-advanced-security

Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

Per preference, use readable major/version tags (@v4, @V3, @v3.2.1) rather
than full-length SHA pins. Kept the other hardening (per-job timeouts,
least-privilege permissions on deploy jobs). Dependabot still tracks updates.

Co-Authored-By: Claude AI
Code scanning is enabled via CodeQL "default setup" (Security and quality
suite) in repo settings, not a workflow file. Dependency version updates
are not configured. Keeps only the security dependency patch in this PR.

Co-Authored-By: Claude AI
Reduces PR #17 to only the security dependency patch.

Co-Authored-By: Claude AI
@davide-pi
davide-pi merged commit 68d8a7a into main Jul 31, 2026
4 checks passed
@davide-pi
davide-pi deleted the fix/security-alerts branch July 31, 2026 11:09
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.

2 participants