Skip to content

gnustep-base: use cacert bundle instead of vendored CA file - #578593

Merged
r-vdp merged 1 commit into
NixOS:masterfrom
irgolic:cacert/gnustep-base
Oct 25, 2026
Merged

r-vdp merged 1 commit into
NixOS:masterfrom
irgolic:cacert/gnustep-base

Conversation

@irgolic

@irgolic irgolic commented Oct 25, 2026 •

Copy link
Copy Markdown
Member

Part of #576541.

gnustep-base has a bundled CA file, GSTLS/ca-certificates.crt, in the resource bundle of the library, in the lib output. When the GSTLSCAFile user default, GS_TLS_CA_FILE and SSL_CERT_FILE are not set, GSTLS gives this file to GnuTLS as the default CA file. GSTLS uses the file when it checks the certificate of a server. By default, GNUstep does not check server certificates, thus to use the file, an application must set GSTLSVerifyServer, GS_TLS_VERIFY_S or the GSTLSVerify option of a request. This change replaces the file with a symlink to the ca-bundle.crt file of cacert in postInstall.

Note

AI Disclosure: Claude Code made the code change, the commit message and the first version of this pull request description, with patchix. Claude Code used Claude Opus 5.5. This pull request description is written in ASD-STE100 (Simplified Technical English), examined with memelint in strict mode. As the automation/AI policy requires, I established confidence in this output: by manual review of the code change and of this description, and with the verification tooling that this description discloses.

Test

nix-cacert-harness examines the package before and after this change. A local copy of nixpkgs is not necessary. The harness builds gnustep-base from source after this change, and this build is approximately 8 minutes long.

nix run github:irgolic/nix-cacert-harness -- gnustep-base --pr 578593 --emudhra
Output of harness: gnustep-base
$ nix run github:irgolic/nix-cacert-harness -- gnustep-base --base 8915027df75d0403ef013dd0cbf09ff3c602fd03 --after github:irgolic/nixpkgs/1a14d4d6b92dd1f0ec4ed367959fdf70cf3ed344 --emudhra
[1/2] static check + eMudhra chains: offline, reproducible
base (before) = 8915027df75d0403ef013dd0cbf09ff3c602fd03
reference: fprs4zi8r6227x12qbsd1grvfrpz6201-nss-cacert-3.131.1 TLS roots=118 all=169
==================================================================
ATTR gnustep-base
before: 8915027df75d0403ef013dd0cbf09ff3c602fd03   after: github:irgolic/nixpkgs/1a14d4d6b92dd1f0ec4ed367959fdf70cf3ed344
before ok (0 built, 2s)
        drv /nix/store/…-gnustep-base-1.29.0.drv
after  ok (0 built, 2s)
        drv /nix/store/…-gnustep-base-1.29.0.drv

| output:path | before | after |
|---|---|---|
| lib:/lib/GNUstep/Libraries/gnustep-base/Versions/1.29/Resources/GSTLS/ca-certificates.crt | pem 180 certs: 157 not in cacert, 15 in cacert but not for TLS, 110 cacert TLS roots missing; scanner: AAA | symlink->cacert:ca-bundle.crt pem 169 certs (118 TLS roots + 51 non-TLS, i.e. cacert's own trust-rules bundle) |

cacert in runtime closure (before): no
cacert in runtime closure (after): yes
CAs trusted before but not trusted for TLS by cacert (172 total), e.g.:
  - C=GB, O=Comodo CA Limited, CN=AAA Certificate Services
  - C=AT, O=A-Trust Ges. f. Sicherheitssysteme im elektr. Datenverkehr GmbH, OU=A-Trust-nQual-03, CN=A-Trust-nQual-03
  - C=AT, O=A-Trust Ges. f. Sicherheitssysteme im elektr. Datenverkehr GmbH, OU=A-Trust-Qual-02, CN=A-Trust-Qual-02
  - C=AT, O=A-Trust Ges. für Sicherheitssysteme im elektr. Datenverkehr GmbH, OU=A-Trust-Qual-01, CN=A-Trust-Qual-01
  - C=AT, O=A-Trust, OU=A-Trust-nQual-01, CN=A-Trust-nQual-01
  - C=BE, CN=Belgium Root CA
  - C=BE, CN=Belgium Root CA2
VERDICT gnustep-base: FIXED: before trusted CAs outside cacert; after: 1 store(s) == cacert, none with extra CAs

eMudhra chains (--emudhra; offline and reproducible): the 14 chains in fixtures/emudhra,
each leaf verified against each store (openssl verify -purpose sslserver, at 2026-10-23):
| output:path | before | after |
|---|---|---|
| lib:/lib/GNUstep/Libraries/gnustep-base/Versions/1.29/Resources/GSTLS/ca-certificates.crt | pem: accepted 7/14 (g3: 0/7, aaa: 7/7, noct: 1/2) | symlink->cacert:ca-bundle.crt pem: accepted 0/14 |
VERDICT gnustep-base emudhra: FIXED: before accepted 7/14 compromised eMudhra chains (g3: 0/7, aaa: 7/7, noct: 1/2); after 0/14

[2/2] live eMudhra test hosts: needs network, NOT reproducible offline
==================================================================
LIVE gnustep-base: needs network; NOT reproducible offline (the static and behavioral checks are)
before: 8915027df75d0403ef013dd0cbf09ff3c602fd03   after: github:irgolic/nixpkgs/1a14d4d6b92dd1f0ec4ed367959fdf70cf3ed344
shim: shims/live/gnustep-base.nix   hosts: https://<host>-emudhra.we-have-a-problem.com/, one request per host per side, 10s timeout
before ok (0 package drvs built, 1s)
        wrapper /nix/store/…-ca-live-gnustep-base
after  ok (0 package drvs built, 2s)
        wrapper /nix/store/…-ca-live-gnustep-base
system store: visible: /etc/ssl/certs/ca-certificates.crt -> nss-cacert-3.126/etc/ssl/certs/ca-bundle.crt /etc/pki/tls/certs/ca-bundle.crt -> nss-cacert-3.126/etc/ssl/certs/ca-bundle.crt
              rejects every served chain, so it cannot make a cell CONNECTED
              but it holds the root of dv-g3b,dv-g3b-aaa,dv-g3c,dv-g3c-aaa with a trust rule that REJECTS it (OpenSSL "certificate rejected"):
              a program that loads it next to its own store (OpenSSL's default paths, e.g. excon) is
              REFUSED there whatever its own store says; --no-system-store shows the package's store alone
control dv-g3b: ok: HTTP 200, served chain == fixtures/emudhra/dv-g3b-emudhra.we-have-a-problem.com.pem (3 certs, valid for the host up to emSign ECC Root CA - G3), stock cacert rejects it
control dv-g3b-aaa: ok: HTTP 200, served chain == fixtures/emudhra/dv-g3b-aaa-emudhra.we-have-a-problem.com.pem (2 certs, valid for the host up to AAA Certificate Services), stock cacert rejects it
control dv-g3c: ok: HTTP 200, served chain == fixtures/emudhra/dv-g3c-emudhra.we-have-a-problem.com.pem (3 certs, valid for the host up to emSign ECC Root CA - G3), stock cacert rejects it
control dv-g3c-aaa: ok: HTTP 200, served chain == fixtures/emudhra/dv-g3c-aaa-emudhra.we-have-a-problem.com.pem (2 certs, valid for the host up to AAA Certificate Services), stock cacert rejects it
  before dv-g3b      REFUSED        | error: TLS verification: remote certificate is not trusted.
  before dv-g3b-aaa  CONNECTED      | status 200
  before dv-g3c      REFUSED        | error: TLS verification: remote certificate is not trusted.
  before dv-g3c-aaa  CONNECTED      | status 200
  after  dv-g3b      REFUSED        | error: TLS verification: remote certificate is not trusted.
  after  dv-g3b-aaa  REFUSED        | error: TLS verification: remote certificate is not trusted.
  after  dv-g3c      REFUSED        | error: TLS verification: remote certificate is not trusted.
  after  dv-g3c-aaa  REFUSED        | error: TLS verification: remote certificate is not trusted.

gnustep-base  (live; before 8915027df75d0403ef013dd0cbf09ff3c602fd03, after github:irgolic/nixpkgs/1a14d4d6b92dd1f0ec4ed367959fdf70cf3ed344)
         | dv-g3b         | dv-g3b-aaa     | dv-g3c         | dv-g3c-aaa
before   | REFUSED        | CONNECTED      | REFUSED        | CONNECTED
after    | REFUSED        | REFUSED        | REFUSED        | REFUSED
VERDICT gnustep-base live: PASS: before CONNECTED to 2/4 host(s) serving a compromised eMudhra chain (dv-g3b-aaa,dv-g3c-aaa); after REFUSED on all 4

The harness tests the package with the certificate chains of the eMudhra incident, from https://emudhra.we-have-a-problem.com/ (only the certificates, not the keys). Before this change, the bundled file accepts 7 of the 14 chains (accepted 7/14). Thus, the file accepts the eMudhra intermediate certificates through the Sectigo cross-sign by AAA Certificate Services. After this change, the file accepts no chain (accepted 0/14). In the second part of the output, a small Objective-C test sends one GET request to each of four test servers with NSURLConnection. The test sets GS_TLS_VERIFY_S=YES, because without this variable GSTLS does not check the server certificate. Before this change, the test connects to the two servers with the AAA chain. After this change, the test connects to no server.

Things done

Assisted-by: Claude Code (Claude Opus 5.5) with patchix
@irgolic irgolic added the 1.severity: security Issues which raise a security issue, or PRs that fix one label Oct 25, 2026
@zimbatm zimbatm mentioned this pull request Oct 25, 2026
66 of 95 tasks
@nixpkgs-ci
nixpkgs-ci Bot requested review from ashalkhakov and dblsaiko October 25, 2026 01:44
@nixpkgs-ci nixpkgs-ci Bot added 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux. 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. llm-assisted Contributions that include code generation with LLMs labels Oct 25, 2026
@nixpkgs-ci nixpkgs-ci Bot added 12.approvals: 1 This PR was reviewed and approved by one person. 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in any of the changed packages. labels Oct 25, 2026
@r-vdp
r-vdp added this pull request to the merge queue Oct 25, 2026
Merged via the queue into NixOS:master with commit 59e68fa Oct 25, 2026
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1.severity: security Issues which raise a security issue, or PRs that fix one 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux. 12.approvals: 1 This PR was reviewed and approved by one person. 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in any of the changed packages. llm-assisted Contributions that include code generation with LLMs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants