Skip to content

kodi: use cacert bundle instead of vendored CA bundle - #578592

Merged
aanderse merged 1 commit into
NixOS:masterfrom
irgolic:cacert/kodi
Oct 25, 2026
Merged

aanderse merged 1 commit into
NixOS:masterfrom
irgolic:cacert/kodi

Conversation

@irgolic

@irgolic irgolic commented Oct 25, 2026 •

Copy link
Copy Markdown
Member

Part of #576541.

Kodi installs a bundled CA file, share/kodi/system/certs/cacert.pem, from system/certs/cacert.pem of the source. The file has 143 certificates. 23 of these certificates are not in cacert. 12 certificates are in cacert, but they are not TLS roots of cacert. 10 TLS roots of cacert are not in the file. The file has the root emSign ECC Root CA - G3. On Windows, Android, darwin and webOS, Kodi sets SSL_CERT_FILE to this file. On Linux, Kodi reads the file only when catrustfile in advancedsettings.xml or an add-on points to it. This change replaces the file with a symlink to the ca-bundle.crt file of cacert, in postInstall of unwrapped.nix.

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.

nix run github:irgolic/nix-cacert-harness -- kodi --pr 578592 --emudhra
Output of harness: kodi
[1/2] static check + eMudhra chains: offline, reproducible
base (before) = dac5e22db3ed2be013da0eba8050c05140bd3f30
reference: fprs4zi8r6227x12qbsd1grvfrpz6201-nss-cacert-3.131.1 TLS roots=118 all=169
==================================================================
ATTR kodi
before: dac5e22db3ed2be013da0eba8050c05140bd3f30   after: worktree <worktree>
before ok (0 built, 2s)
        drv /nix/store/cayi1ib9vwfbwmvdvpjn42dsb99jw89p-kodi-21.3.drv
after  ok (0 built, 3s)
        drv /nix/store/pw57448rj5b7shlhccf6vp244ksna2jy-kodi-21.3.drv

| output:path | before | after |
|---|---|---|
| out:/share/kodi/system/certs/cacert.pem | pem 143 certs: 23 not in cacert, 12 in cacert but not for TLS, 10 cacert TLS roots missing; scanner: ECC G3 | 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 (35 total), e.g.:
  - C=IN, OU=emSign PKI, O=eMudhra Technologies Limited, CN=emSign ECC Root CA - G3
  - C=US, OU=emSign PKI, O=eMudhra Inc, CN=emSign ECC Root CA - C3
  - C=US, OU=emSign PKI, O=eMudhra Inc, CN=emSign Root CA - C1
  - C=AT, O=e-commerce monitoring GmbH, CN=GLOBALTRUST 2020
  - C=BM, O=QuoVadis Limited, CN=QuoVadis Root CA 2
  - C=BM, O=QuoVadis Limited, CN=QuoVadis Root CA 3
  - C=CH, O=SwissSign AG, CN=SwissSign Gold CA - G2
  - C=ES, O=Firmaprofesional SA, CN=FIRMAPROFESIONAL CA ROOT-A WEB
  - C=FR, O=Dhimyotis, CN=Certigna
VERDICT kodi: 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 |
|---|---|---|
| out:/share/kodi/system/certs/cacert.pem | pem: accepted 7/14 (g3: 7/7, aaa: 0/7, noct: 1/2) | symlink->cacert:ca-bundle.crt pem: accepted 0/14 |
VERDICT kodi emudhra: FIXED: before accepted 7/14 compromised eMudhra chains (g3: 7/7, aaa: 0/7, noct: 1/2); after 0/14

[2/2] live eMudhra test hosts: needs network, NOT reproducible offline
(no shims/kodi.{nix,sh} or shims/live/kodi.{nix,sh}: live check skipped)

The harness tests the package with the 14 certificate chains of the eMudhra incident (only the certificates, not the keys). Before this change, the bundled file accepts 7 of the 14 chains (accepted 7/14). It accepts all 7 chains through emSign ECC Root CA - G3. It accepts no chain through the Sectigo cross-sign by AAA Certificate Services. After this change, the file accepts no chain (accepted 0/14). The harness has no live test for Kodi, thus the output has no second part.

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 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
@aanderse

Copy link
Copy Markdown
Member

please check the "Basic functionality of all binary files, usually in ./result/bin/" once you have tested this and let me know which addons and functionality your have tested thank you 🙇‍♂️

@irgolic

irgolic commented Oct 25, 2026

Copy link
Copy Markdown
Member Author

Hi, I ran nix run github:irgolic/nixpkgs/cacert/kodi#kodi on x86_64-linux, then downloaded and launched the Advanced MAME Launcher. The add-on seems to download and install fine. Forgive the light testing, I don't use Kodi – I'm a Jellyfin maintainer :)

This is a small change that looks the same as most other fixes deployed in scope of #576541. It makes it so that Kodi uses the system trust store instead of the bundle crt to check what CAs it trusts, making it no longer trust the compromised eMudhra CA.

@aanderse aanderse added the backport release-26.05 Backport PR automatically label Oct 25, 2026

@aanderse aanderse left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

i understand the change

and i appreciate that you took the effort to run a command and validate your change... after i put in the effort of reading the wall of text that was generated for you

don't take this as a hostile comment or anything... i am simply saying i appreciate that you took the time to actually validate this ❤️


i have applied a backport label because we need to land this in stable as well

@aanderse
aanderse added this pull request to the merge queue 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
Merged via the queue into NixOS:master with commit 1bdb0c8 Oct 25, 2026
37 checks passed
@nixpkgs-ci

nixpkgs-ci Bot commented Oct 25, 2026

Copy link
Copy Markdown
Contributor

Successfully created backport PR for release-26.05:

@github-actions github-actions Bot added the 8.has: port to stable This PR already has a backport to the stable release. label Oct 25, 2026
@irgolic

irgolic commented Oct 25, 2026 •

Copy link
Copy Markdown
Member Author

Thanks, for merging, and for the feedback – sorry for the wall of text!

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 8.has: port to stable This PR already has a backport to the stable release. 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. backport release-26.05 Backport PR automatically llm-assisted Contributions that include code generation with LLMs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants