Skip to content

fix(docker): reduce Docker Scout CVEs with slim stable Nginx base - #295

Open
ThisIs-Developer wants to merge 4 commits into
mainfrom
fix/docker-scout-security-20261115
Open

ThisIs-Developer wants to merge 4 commits into
mainfrom
fix/docker-scout-security-20261115

Conversation

@ThisIs-Developer

@ThisIs-Developer ThisIs-Developer commented Nov 15, 2026 •

Copy link
Copy Markdown
Owner

What changes

  • Use the official nginx:1.31.8-alpine3.24-slim runtime in place of nginx:alpine, removing optional package dependencies that contributed to Docker Scout findings.
  • Apply available Alpine stable-release updates via apk upgrade --no-cache (do not install edge packages).
  • Rebuild with --pull, add a real HTTP container smoke test and Nginx config check, upload full Trivy JSON findings, and fail CI for fixable Critical/High issues.

HTTP-only: Keeps port 80 inside the image and http://localhost:8080 for the user's existing docker run -p 8080:80 command. Does not add HTTPS, certificates, Caddy, or additional Compose files.

Maintainer Docker Scout ZIP independently inspected (2026-11-15)

The maintainer's full locally exported Docker Scout ZIP was inspected (SARIF + SPDX SBOM + Scout policy summary + recommendations). This is actual baseline evidence, not a count inferred from a screenshot:

  • Target: ghcr.io/thisis-developer/markdown-viewer:latest, linux/amd64, image ID sha256:3aaa210b4cc8093feaef203bf2591a56eb9b6072133d763acfd4a116ba3d7168, scan at 2026-11-15 17:52 IST, Docker Scout v1.28.0.
  • 22 SARIF results in 5 Alpine packages: zlib 1.3.2-r1 (1 Critical), libxslt 1.1.43-r3 (3 High/1 Medium), libxml2 2.13.9-r2 (1 High/5 Medium/5 Low), musl 1.2.6-r3 (1 High), and openssl 3.5.9-r0 (5 Unspecified). Eleven findings are marked with advisory fix versions; eleven libxml2 findings say not fixed.
  • Baseline policy: FAILED, score E (28%), 2/7 passed. Beyond CVEs, Scout flags root-user execution, copyleft licenses in packages, and missing supply-chain attestations. These are independent issues and are not claimed resolved in this narrowly scoped PR.
  • The actual PR fix(docker): reduce Docker Scout CVEs with slim stable Nginx base #295 Trivy JSON artifact from CI #43713210188 was also inspected: image ID sha256:24af787445861cc33dd49800b6ca361b32ece54f290df05dcc5e7e6e66b9d2f2 (Alpine 3.24.4), with zero Trivy findings. Its inventory has zlib 1.4-r0, no libxml2 or libxslt package, musl 1.2.6-r3, and libcrypto3/libssl3 3.5.9-r0 still present.
  • Important: A related feat(docker): reliable HTTP 8080 and opt-in local/public HTTPS with full smoke tests #294 image and now the actual PR fix(docker): reduce Docker Scout CVEs with slim stable Nginx base #295 image were both independently scanned using Docker Scout and each showed 6 CVEs in musl/OpenSSL. Trivy's 0 is not a promise of 0 Scout. Alpine's v3.24 musl security advisory identifies 1.2.6-r3 as fixed, contrasting with Scout's cross-branch 1.2.6-r6 suggestion; Alpine v3.24 OpenSSL is still 3.5.9-r0. Don't mix Alpine edge packages into stable, and don't suppress the outstanding OpenSSL results.

Follow-up: The exact PR #295 Docker Scout SARIF scan has now been performed and compared below. The separate docker scout policy text export did not complete correctly because the Windows PowerShell collector captured a Docker Scout version notice on stderr as an exception; its policy grade has not been established. The present PR does not touch production latest unless merged and published.

Independent PR #295 Docker Scout regression scan (2026-11-15, 18:55–18:58 IST)

The maintainer ran Test-MarkdownViewer-PR295-DockerScout.ps1 against fix/docker-scout-security-20261115 and supplied the resulting 9-file verification ZIP. I independently parsed the two actual Scout SARIF reports and the new image inspect/HTTP probes.

Original latest PR #295 local image
Image ID (prefix) 3aaa210b4cc8 96abf6712ea1
Docker Scout 22 total (1 Critical, 5 High, 6 Medium, 5 Low, 5 Unspecified) 6 total (0 Critical, 1 High, 0 Medium, 0 Low, 5 Unspecified)
CVEs no longer reported — 16 of 22 removed (no new CVE IDs)
HTTP probes Existing local image /, /styles.css, /script.js all 200 on loopback port 8081
Architecture linux/amd64 linux/amd64

The 6 remaining exact IDs are:

  • musl 1.2.6-r3: CVE-2026-107891 (Scout: High, suggests 1.2.6-r6), but Alpine v3.24's branch-specific security advisory states 1.2.6-r3 already contains the fix: https://osv.dev/vulnerability/ALPINE-CVE-2026-107891 . Treat the cross-branch Scout mismatch as likely a false positive, not a reason to install Alpine edge libraries.
  • openssl 3.5.9-r0: CVE-2026-107496, CVE-2026-88822, CVE-2026-88823, CVE-2026-95691, CVE-2026-95692 (Scout: Unspecified; its advisory suggests 3.5.9-r1). Alpine v3.24 stable currently lists 3.5.9-r0: https://pkgs.alpinelinux.org/packages?arch=x86_64&branch=v3.24&name=openssl&repo=main . Track these findings and rebuild/retest when a stable patch is released; don't substitute Alpine edge libraries.

The verification collector's optional text outputs (quickview, policy, recommendations, human-readable CVEs) contain a PowerShell exception triggered by a Docker Scout v1.28.0 update notice on stderr. The structured SARIF is intact and valid, and so are the image metadata and HTTP checks. Therefore do not claim a current PR #295 Scout policy score; root-user default also remains (no explicit Config.User).

Result: 72.7% fewer reported CVEs under the same Docker Scout scanner; existing Critical/Medium/Low reports disappear. PR remains HTTP-only and unmerged. No complete remediation or zero-CVE claim.

Final CI verification of SBOM/provenance change (2026-11-15)

  • Final GitHub Actions Docker workflow #43714981846 — SUCCESS, including Docker build, Nginx validation, HTTP checks, Trivy full JSON export, fixable Critical/High gate, and PR-only Buildx build configured with provenance: mode=max and sbom: true.
  • I downloaded and parsed the final Trivy JSON artifact: 0 reported CVEs, Alpine 3.24.4, build image ID sha256:5f8fb82286000b147f7552a0550fb59708034f3ac4e6d5c185177f8add0cd179; scanned at 2026-11-15 12:40:17 UTC.
  • Confirm registry-attached SBOM/provenance attestations after merge/publish, because PR builds do not push an attested image to GHCR. Do not infer a successful registry attestation from a PR-only build.
  • Same-scanner local Docker Scout SARIF rescan of this branch completed: 6 remaining vs. 22 in original latest; 16 no longer reported. See independent regression results above.

HTTP-only remains the default. The image is not merged or republished; the Nginx runtime still defaults to root and does not claim to pass the non-root policy.

Why this PR

The published ghcr.io/thisis-developer/markdown-viewer:latest image was reported by Docker Scout with 22 vulnerabilities (1 Critical, 5 High, 6 Medium, 5 Low, 5 Unspecified). The identical slim-base and stable-upgrade approach was separately tested in closed, unmerged PR #294: an earlier GitHub Actions workflow succeeded (https://github.com/ThisIs-Developer/Markdown-Viewer/actions/runs/43618088864), with Trivy reporting zero for the audited image. A subsequent Docker Scout rescan of the PR #294 candidate still found 6 CVEs (0 Critical, 1 High, 5 Unspecified) in musl/OpenSSL; these should not be described as eliminated.

Verification

Security caveat

Trivy and Docker Scout may disagree about vendor advisory severities/fixed versions. The previous candidate's remaining OpenSSL findings should be tracked until stable security updates exist. A passing Trivy gate is not a claim of zero CVEs or of zero exploitation risk. The original Dockerfile's missing asset/precache issues are outside this security-only PR.

Related: #290, #292, and closed PR #294.

@vercel

vercel Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
markdown-viewer Ready Ready Preview Nov 15, 2026 12:39pm UTC

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

Deploying markdownviewer with  Cloudflare Pages  Cloudflare Pages

Latest commit: 87730b2
Status: ✅  Deploy successful!
Preview URL: https://95e6de65.markdownviewer.pages.dev
Branch Preview URL: https://fix-docker-scout-security-20.markdownviewer.pages.dev

View logs

This branch was successfully deployed

1 active deployment
Preview — 87730b2a Deployed Nov 15, 2026 by vercel[bot]
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