Skip to content

fix(build): patch zlib and libexpat for the 1.7 GA - #1283

Merged
scttbnsn merged 1 commit into
dev/v1.7from
fix/v1.7-ga-image-security
Oct 2, 2026
Merged

scttbnsn merged 1 commit into
dev/v1.7from
fix/v1.7-ga-image-security

Conversation

@scttbnsn

@scttbnsn scttbnsn commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

The published candidates contain vulnerable Alpine zlib and libexpat packages. This updates libexpat to 2.8.5-r0 and builds zlib 1.3.2 with upstream commit df84af25, the two-line fix the upstream maintainer confirmed resolves CVE-2026-85091. Application source and npm dependencies are unchanged.

The zlib APK keeps its upstream version and uses the unique local revision 2026092401. Source, patch and regression checksums are verified by abuild. Installation verifies the build's APK signature using a temporary read-only public-key mount, with no network access or permanent trust key. OpenVEX records the fix only for this exact APK revision and CVE; the original Alpine package remains a HIGH finding. Remove the backport and VEX when Alpine publishes the fix.

Validation: the failed-write-state regression failed against unpatched zlib, then passed with the upstream patch. Upstream static/shared/64-bit tests passed during both architecture builds. ARM64 and AMD64 application images built, passed the September 27 Grype HIGH/CRITICAL gate with the exact VEX evidence retained in ignored matches, and passed live startup, UI-serving, API, healthcheck and installed-package checks. The full normal pre-push gate passed, including configured app/UI coverage and builds.

This prepares the image security fix only. Release metadata and publication follow separately. The owner authorized immediate GA promotion after verification, using the existing recorded soak override rather than waiting another seven days.

Changelog

  • 🔒 Security: Added a local zlib 1.3.2 APK with the upstream fix for CVE-2026-85091. The APK uses local revision 2026092401.
  • 🔒 Security: Added an OpenVEX statement scoped to CVE-2026-85091 and the exact zlib APK revision. Configured Grype to load the statement.
  • 🔧 Changed: Added a pinned Alpine build stage to build and sign the zlib APK. The runtime stage installs it locally with signature verification and --no-network.
  • 🔧 Changed: Added an APKBUILD, upstream patch, checksums, and documentation for the temporary backport and its removal.
  • 🐛 Fixed: Reset zlib’s input-buffer state after a failed gz_write.
  • ✨ Added: Added a regression test for failed writes to /dev/full.
  • 🔧 Changed: The PR description reports that libexpat is updated to 2.8.5-r0. It also reports passing zlib regression checks, upstream tests, architecture builds, image checks, and the normal pre-push gate.

Concerns or issues

  • Independent test results are not available in the supplied change summary.

@vercel

vercel Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
drydock-website Ready Ready Preview Sep 27, 2026 11:19pm UTC
drydockdemo-website Ready Ready Preview Sep 27, 2026 11:19pm UTC

@coderabbitai

coderabbitai Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: CodesWhat/drydock/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: e10258dd-0e23-431f-bbe3-4935f81f535e

📥 Commits

Reviewing files that changed from the base of the PR and between 9b40cc1 and 898e58f.

⛔ Files ignored due to path filters (1)
  • CHANGELOG.md is excluded by !CHANGELOG.md
📒 Files selected for processing (7)
  • .grype.yaml
  • Dockerfile
  • docker/zlib/APKBUILD
  • docker/zlib/CVE-2026-85091.patch
  • docker/zlib/README.md
  • docker/zlib/fixed.vex.json
  • docker/zlib/write-error-state.c

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The Dockerfile builds a patched Alpine zlib package and installs it in the runtime image using its exported signing key without network access. The package build runs upstream checks and a regression test for gzip input state after a failed write. Grype loads a VEX document that marks CVE-2026-85091 fixed for the specified package revision. The README documents the backport and the VEX statement's scope.

Priority: ⬆️ High

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 898e5

The package, image, and scan configuration show no identified issue requiring a fix before merge.

Architecture Summary

Architecture risk: 🔵 Low · up to 898e5

The change affects 2 systems.

Changed systems: docker, Dockerfile

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — docker (service) was modified; 5 changed files map to changed impact.
  • observed — Dockerfile (service) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in Dockerfile: Adds a pinned Alpine build stage that installs pinned build tools, builds the local zlib package, and exports the versioned APK and generated public key.
  • observed — Modified behavior in Dockerfile: Removes libexpat from the repository package upgrade and adds installation of the locally built zlib APK using its exported key with network access disabled.
  • observed — Modified behavior in docker/zlib/APKBUILD: Adds Alpine package metadata for zlib 1.3.2 release 2026092401, declares static, development, and documentation subpackages, lists the source archive, CVE patch, and test helper, and records CVE-2026-85091 and earlier secfixes.
  • observed — Modified behavior in docker/zlib/APKBUILD: Adds a build function that appends -O2 to CFLAGS, configures shared zlib for /usr with --disable-crcvx, and runs make.
🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@scttbnsn

Copy link
Copy Markdown
Contributor Author

@greptileai Review exact head 898e58f50ad6850f916cfe8eefd4d23a2d32e14d. Review the zlib upstream security backport, APK signature verification and exact-version OpenVEX scope. Check Alpine ABI and both architecture behavior. Threat model: Docker container update manager with trusted repository maintainers; focus on accidental missing fixes or overly broad vulnerability suppression, not hostile maintainer scenarios.

@greptile-apps

greptile-apps Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 4/5

[Critical risk] Rebuilds the Docker image with a custom-compiled security patch.

The PR appears safe to merge, with a non-blocking correction recommended for the APK's architecture metadata.

Findings

  1. P2 Compiled library marked architecture-independent ▶
Fix with agent prompt
### Issue 1
docker/zlib/APKBUILD:7
The APK contains a compiled `libz.so.1`, but `arch="all"` says it can be installed on any architecture. The current build makes a separate APK for each platform, so this is not a failure in that build. It does mean APK metadata would not catch an AMD64 package accidentally reused on ARM64, or vice versa. Declare the supported architectures to retain that check.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
Summary

The PR builds a locally revised zlib APK with a failed-write backport, installs it using a temporary signing-key mount, pins libexpat, and adds an exact-revision OpenVEX statement.

  • The APK's architecture metadata should reflect its compiled shared library.

Reviews (1) · Last reviewed commit: "fix(build): backport zlib security fix a..."

Comment thread docker/zlib/APKBUILD
pkgver=1.3.2
pkgrel=2026092401
pkgdesc="A compression/decompression library (Drydock CVE-2026-85091 backport)"
arch="all"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Compiled library marked architecture-independent The APK contains a compiled libz.so.1, but arch="all" says it can be installed on any architecture. The current build makes a separate APK for each platform, so this is not a failure in that build. It does mean APK metadata would not catch an AMD64 package accidentally reused on ARM64, or vice versa. Declare the supported architectures to retain that check.

Prompt To Fix With AI
This is a comment left during a code review.
Path: docker/zlib/APKBUILD
Line: 7

Comment:
**Compiled library marked architecture-independent** The APK contains a compiled `libz.so.1`, but `arch="all"` says it can be installed on any architecture. The current build makes a separate APK for each platform, so this is not a failure in that build. It does mean APK metadata would not catch an AMD64 package accidentally reused on ARM64, or vice versa. Declare the supported architectures to retain that check.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In APKBUILD, arch="all" means build on every supported architecture, not architecture-independent output. That is arch="noarch". Alpine itself uses arch="all" for zlib. Our scanned APK metadata is architecture-specific: aarch64 for ARM64 and x86_64 for AMD64. See the arch definition in https://github.com/alpinelinux/abuild/blob/master/APKBUILD.5.scd and https://github.com/alpinelinux/aports/blob/3.24-stable/main/zlib/APKBUILD.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right — I conflated arch="all" with an architecture-independent (noarch) package. In Alpine APKBUILD, all means build for every supported architecture, while the resulting APK remains architecture-specific; the scanned aarch64 and x86_64 metadata confirms that here. Since this also matches Alpine's upstream zlib APKBUILD, the finding is invalid and no change is needed.

@codecov

codecov Bot commented Sep 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@scttbnsn
scttbnsn merged commit 338f652 into dev/v1.7 Oct 2, 2026
36 checks passed
@scttbnsn
scttbnsn deleted the fix/v1.7-ga-image-security branch October 2, 2026 02:40
scttbnsn added a commit that referenced this pull request Oct 2, 2026
Forward-port of #1283: local zlib 1.3.2 APK with the upstream CVE-2026-85091 fix and its VEX evidence, and libexpat 2.8.5-r0 for CVE-2026-93990.

This branch was successfully deployed

2 active deployments
Preview – drydockdemo-website — 898e58f5 Deployed Sep 27, 2026 by vercel[bot]
Preview – drydock-website — 898e58f5 Deployed Sep 27, 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.

2 participants