microsoft / microsoft/cates

Trivy scan fails on main: CRITICAL/HIGH CVE in floating node:20-alpine base image

Open
#21 3 comments 1 reaction 2 assignees View on GitHub

Nobody has claimed this yet.

bug ci security
Dominant language
TypeScript
Stars
14
Forks
8
Avg merge
4m
Merged PRs (30d)
3

Description

Summary

The scan job in .github/workflows/trivy.yml (Trivy image scan, severity: CRITICAL,HIGH, exit-code: 1, ignore-unfixed: true) fails because the built image contains at least one fixable CRITICAL/HIGH vulnerability.

This is pre-existing and unrelated to feature PRs: the workflow has failed on main across multiple recent runs.

Root cause

The Dockerfile builds from a floating base tag:

ARG NODE_IMAGE=node:20-alpine

Because the tag is not pinned to a digest, the scanned base image rolls forward to whatever node:20-alpine currently resolves to (Alpine 3.23.x at last scan). As new CVEs are disclosed and fixes published, ignore-unfixed: true + exit-code: 1 causes the scan to fail intermittently on main without any code change in the repo.

Suggested remediation

  • Bump/pin the base image to a current patched digest (the Dockerfile already documents the pinned-digest pattern in a comment), and re-pin periodically (or via Dependabot for Docker), and/or
  • Identify the specific failing CVE(s) from the scan SARIF and remediate the affected OS/library package.

Evidence (failing on main, not PR-caused)

Note: the Trivy and CodeQL code-scanning upload checks pass; it is specifically the scan job's gating exit-code: 1 that fails.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.