Skip to content

fix: distrust compromised eMudhra certificate chains - #123

Merged
ChiragAgg5k merged 1 commit into
mainfrom
fix/emudhra-ca-trust
Oct 21, 2026
Merged

ChiragAgg5k merged 1 commit into
mainfrom
fix/emudhra-ca-trust

Conversation

@ChiragAgg5k

Copy link
Copy Markdown
Member

Change

The compromised eMudhra intermediate CA keys can authenticate forged certificates for arbitrary domains. Require Alpine ca-certificates and ca-certificates-bundle version 20261020-r0 or newer, and regenerate the trust bundle before any build-time downloads or runtime connections. A build fails if the security update is unavailable.

Compilation and runtime now inherit a shared trusted-base stage, so both use the updated trust store.

References: Cloudflare report, published test endpoints and patched packages.

The independent Go builder for git-remote-entire also installs the patched packages before fetching Git sources and Go modules. The Xdebug image inherits the runtime fix.

Validation

  • Built the actual trusted-base target locally on arm64.
  • Observed the check fail against the unmodified pinned PHP 8.5 image: PHP cURL and OpenSSL HTTPS streams both accepted https://dv-g3b-emudhra.we-have-a-problem.com/.
  • Both transports reject that endpoint and the alternate https://dv-g3b-aaa-emudhra.we-have-a-problem.com/ chain after the change, while still accepting https://example.com/. Certificate verification stayed enabled throughout.
  • docker build --check . and git diff --check.

Full extension builds and container structure tests were not run locally; CI covers the full image. This PR does not publish a release or redeploy consumers. After release, downstream images must bump their base reference, rebuild, and redeploy. Independent Composer build images and bundled application trust stores require their own updates.

@ghost

ghost commented Oct 21, 2026 •

Copy link
Copy Markdown

🔵 Tier A · Mergeable after minor fixes

The change has a minor test-coverage gap for the security behavior it introduces.

The Dockerfile adds a shared trusted-base stage that installs the patched Alpine CA packages and regenerates the trust bundle before PHP build and runtime stages. It also updates certificates in the independent Go builder before fetching its sources and modules, while the Xdebug image inherits the fixed runtime stage.

Verdict New comments Fixed Still open
✅ Approved 1 0 0
Finding Where
🟡 Add a regression check for compromised-chain rejection Dockerfile:9
Fix with agent prompt
### Issue 1
Dockerfile:9
**Add a regression check for compromised-chain rejection**

The build now updates the CA bundle, but the container tests do not assert that the reported compromised chains are rejected by PHP/OpenSSL. If a later bundle or package change leaves those chains trusted while still satisfying this version constraint, CI could pass and publish an image that misses the security fix; please add a regression assertion for the reported endpoint behavior.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
📂 Walkthrough · 1
File Change
Dockerfile Adds patched CA packages and trust-bundle regeneration to the PHP base and Go builder stages.

Reviewed 2470297 · Details · Comment @hansi-codes review to re-run, or mention @hansi-codes with a question.

@ghost ghost left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Tier A · Looks good to merge. Summary

Comment thread Dockerfile

# Distrust the compromised eMudhra chains before build-time or runtime HTTPS.
RUN apk add --no-cache 'ca-certificates>=20261020-r0' 'ca-certificates-bundle>=20261020-r0' && \
update-ca-certificates

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Add a regression check for compromised-chain rejection

The build now updates the CA bundle, but the container tests do not assert that the reported compromised chains are rejected by PHP/OpenSSL. If a later bundle or package change leaves those chains trusted while still satisfying this version constraint, CI could pass and publish an image that misses the security fix; please add a regression assertion for the reported endpoint behavior.

Prompt To Fix With AI
This is a comment left during a code review.
Path: Dockerfile
Line: 9

Comment:
**Add a regression check for compromised-chain rejection**

The build now updates the CA bundle, but the container tests do not assert that the reported compromised chains are rejected by PHP/OpenSSL. If a later bundle or package change leaves those chains trusted while still satisfying this version constraint, CI could pass and publish an image that misses the security fix; please add a regression assertion for the reported endpoint behavior.

---

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

🟡 Minor · testing · Reply if this doesn't apply.

@ChiragAgg5k
ChiragAgg5k merged commit 46dc285 into main Oct 21, 2026
8 of 9 checks passed
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