Skip to content

ci: fail builds on high/critical dependency advisories - #61

Merged
Comp0te merged 4 commits into
masterfrom
ci/dependency-audit-gate
Jul 22, 2026
Merged

ci: fail builds on high/critical dependency advisories#61
Comp0te merged 4 commits into
masterfrom
ci/dependency-audit-gate

Conversation

@Comp0te

@Comp0te Comp0te commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Description

Adds a dependency-audit enforcement gate to the CI build job:

- name: Audit dependencies (fail on high/critical)
  if: matrix.node == '22'
  run: yarn npm audit --all --severity high --recursive

It audits the whole tree (dev + transitive) and fails the build on any high/critical advisory. Low/moderate are intentionally not gated — they are noise and would erode trust in the check.

Because the audit covers the whole tree, a new unfixable high would go red on every branch. So .yarnrc.yml gains an npmAuditIgnoreAdvisories escape hatch — empty by policy, currently holding a single documented, consciously accepted entry: the lodash _.template advisory (GHSA-r5fr-rjxr-66jc), a dev-only advisory pulled transitively by the ESLint preset, on the latest published lodash with no fix. Each entry must name its package, GHSA, and reason. (Yarn 4 matches the numeric advisory id, not the GHSA slug.)

Motivation

Dependabot only detects vulnerabilities and opens PRs; nothing stops vulnerable code from being merged. This gate is the enforcement half — it blocks merges that introduce new high/critical advisories.

Related issues

Stacked on #60. This PR targets fix/dependabot-and-code-scanning-alerts (which clears the current high/critical set so the gate is green); retarget to master once #60 merges.

Notes for reviewers

Verified locally: the gate command exits 0 on this tree, still exits non-zero at --severity moderate (the ignore is narrow, not a blanket disable), yarn install --immutable passes, and both YAML files parse. The step uses only static run: — no github.event.* input.


  • Commits are signed off (DCO)

Comp0te added 4 commits July 22, 2026 13:49
Bump vulnerable dependencies and resolve two CodeQL warnings.

Dependencies (via resolutions + recursive lockfile bumps):
- axios ^1.16.0 -> ^1.18.1 and form-data -> ^4.0.6 (ship to consumers via
  apisauce and casper-js-sdk): CRLF injection, prototype pollution, proxy
  and maxBodyLength bypasses, and formDataToJSON DoS advisories.
- Dev-only tooling to patched versions: brace-expansion, js-yaml, minimatch,
  picomatch, tar, undici, flatted, @babel/core.

Code scanning:
- address.ts: drop the useless initial assignment in formatAddress by
  returning directly from each branch.
- validators.ts: remove the always-true minAmount guard in getMinAmount.

Signed-off-by: Dmytro Vynnyk <simbiatoff@gmail.com>
Add a dependency-audit enforcement gate to the CI build job that runs
`yarn npm audit --all --severity high --recursive` and fails on any
high/critical advisory across the whole tree (dev + transitive). This
complements Dependabot, which only detects and opens PRs, by preventing
vulnerable code from being merged.

Only high/critical are gated; low/moderate are intentionally not enforced.

Because the audit covers the whole tree, a new unfixable high would go red
on every branch, so .yarnrc.yml gains an npmAuditIgnoreAdvisories escape
hatch — empty by policy, currently holding one documented, consciously
accepted entry: lodash _.template code injection (GHSA-r5fr-rjxr-66jc), a
dev-only advisory pulled transitively by the ESLint preset, on the latest
published lodash with no fix available.

Signed-off-by: Dmytro Vynnyk <simbiatoff@gmail.com>
@Comp0te Comp0te self-assigned this Jul 22, 2026
@Comp0te
Comp0te changed the base branch from fix/dependabot-and-code-scanning-alerts to master July 22, 2026 12:20
@Comp0te
Comp0te merged commit 3e7212f into master Jul 22, 2026
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.

1 participant