#62812 closed enhancement (fixed)
Make it easier to update bundled certificates
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 6.8 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Security | Keywords: | has-patch needs-testing |
Focuses: | Cc: |
Description (last modified by )
The ca-bundle.crt
file is a combination of the upstream Mozilla certificate bundle and some legacy 1024-bit certificates that remain for backwards compatibility (see [35919]).
#50828 was opened to update the certificate bundle for the 5.5 release, and discussion overflowed into how to make this process easier. This ticket is to continue the second part of the discussion.
Change History (11)
This ticket was mentioned in PR #8137 on WordPress/wordpress-develop by @desrosj.
5 weeks ago
#2
- Keywords has-patch added
Adds exact copies of Mozilla certificates, splits out the legacy 1024-bit certificates included for backwards compatibility, and introduces a Grunt task that combines the two for shipping.
Trac ticket: https://core.trac.wordpress.org/ticket/62812
#3
@
5 weeks ago
I've created a PR that takes the same approach as detailed by @ayeshrajans on #50828 and adds a Grunt task for combining the files into the current file.
Still to do:
- Confirm that the order of the certificates is not important (the legacy ones previously were included near the top).
- Add a way to pull in updates to the files automatically.
#4
@
5 weeks ago
- Keywords needs-testing added
Updated the PR. It now pulls the latest certificate files when running npm run grunt update-certificates
.
@johnbillion commented on PR #8137:
3 weeks ago
#5
Ooh we could add https://github.com/composer/ca-bundle as a dev dependency, extract the cert bundle from that, and keep it updated via Dependabot. No need to roll our own solution.
3 weeks ago
#6
Thanks @johnbillion, hadn't thought of checking Composer. Updated the PR to utilize that package as a dependency.
@johnbillion commented on PR #8137:
3 weeks ago
#7
I think composer/ca-bundle
will need to be pinned to protect us against a theoretical future problem. My understanding is that the build server on dotorg doesn't use Composer, but if a change was made so that it _does_ then there's a chance that a newer version of composer/ca-bundle
would get pulled in and deployed during the build.
- Latest version of `composer/ca-bundle is currently 1.5.6
- Build server runs
composer install
and pulls in a theoretical version 1.5.6 - Build server runs
npm run build
which callsgrunt build
which callsgrunt build:certificates
which callsgrunt concat:certificates
which concatenates version 1.5.6 ofvendor/composer/ca-bundle/res/cacert.pem
intowp-includes/certificates/cacert.pem
- Build server deploys WordPress with version 1.5.6 of the cert despite 1.5.5 being present in the source
Does that make sense?
3 weeks ago
#8
It does. I have set up the script to only copy the cert files from vendor
when running grunt update-certificates
, though.
If I have done it correctly, then when build
is run it should not have any impact if the version of the Composer package is changed some how. It should only use the versioned revision of the file in the src/wp-includes/certificates
folder.
This was mainly to ensure someone could still run npm build
without also having to run composer (install|update)
. But this shoudl also cover the scenario you are describing, if I understand correctly.
@johnbillion commented on PR #8137:
3 weeks ago
#9
Ah yes you are correct. copy:certificates
is what copies the cert from the vendor directory, and that doesn't get run during the build. All good.
Referencing comment:ticket:50828:7 and comment:ticket:50828:8 as a potential implementation here.