Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tools: fix release URL computation in update-root-certs.mjs #56843

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

joyeecheung
Copy link
Member

Previously this would compute the release tag to be something like FIREFOX_134_0.2_RELEASE which would not lead to a valid URL, failing to pull the latest NSS updates from the Firefox release. It should replace all the dots with underscores to compute something like FIREFOX_134_0_2_RELEASE instead.

Before when I ran it locally:

Fetching Firefox release data from https://nucleus.mozilla.org/rna/all-releases.json.
Fetching NSS tag from https://hg.mozilla.org/releases/mozilla-release/raw-file/FIREFOX_134_0.2_RELEASE/security/nss/TAG-INFO.
Failed to fetch https://hg.mozilla.org/releases/mozilla-release/raw-file/FIREFOX_134_0.2_RELEASE/security/nss/TAG-INFO: 404: Not Found

After:

Fetching Firefox release data from https://nucleus.mozilla.org/rna/all-releases.json.
Fetching NSS tag from https://hg.mozilla.org/releases/mozilla-release/raw-file/FIREFOX_134_0_2_RELEASE/security/nss/TAG-INFO.
Found tag NSS_3_107_RTM.
Updating to NSS version 3.107
Fetching https://raw.githubusercontent.com/nss-dev/nss/refs/tags/NSS_3_107_RTM/lib/ckfw/builtins/certdata.txt

# logs from actually parsing and computing the update

Previously this would compute the release tag to be something
like FIREFOX_134_0.2_RELEASE which would not lead to a valid
URL, failing to pull the latest NSS updates from the Firefox
release. It should replace all the dots with underscores to
compute something like FIREFOX_134_0_2_RELEASE instead.
@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/security-wg

@nodejs-github-bot nodejs-github-bot added the tools Issues and PRs related to the tools directory. label Jan 31, 2025
@richardlau
Copy link
Member

FWIW the failing GHA workflow is #56063 (comment).

@joyeecheung
Copy link
Member Author

By the way I wonder what we think about migrating away from tools/mk-ca-bundle.pl, I am thinking about updating it to output the certificate data in octal literals in #56832 to skip the unnecessary serdes cost, but then if we are changing it substantially, we might as well just rewrite it in JavaScript instead of invoking a Perl script from JavaScript (and the Perl script already has some modifications from our side, like omitting TrustCor CAs)

@richardlau
Copy link
Member

By the way I wonder what we think about migrating away from tools/mk-ca-bundle.pl, I am thinking about updating it to output the certificate data in octal literals in #56832 to skip the unnecessary serdes cost, but then if we are changing it substantially, we might as well just rewrite it in JavaScript instead of invoking a Perl script from JavaScript (and the Perl script already has some modifications from our side, like omitting TrustCor CAs)

I think if we're not planning to resync to upstream curl's version of the tool at any point in the future (I think it was tried once and abandoned) then rewriting in something other than Perl would be a plus.

@richardlau
Copy link
Member

By the way I wonder what we think about migrating away from tools/mk-ca-bundle.pl, I am thinking about updating it to output the certificate data in octal literals in #56832 to skip the unnecessary serdes cost, but then if we are changing it substantially, we might as well just rewrite it in JavaScript instead of invoking a Perl script from JavaScript (and the Perl script already has some modifications from our side, like omitting TrustCor CAs)

I think if we're not planning to resync to upstream curl's version of the tool at any point in the future (I think it was tried once and abandoned) then rewriting in something other than Perl would be a plus.

Maybe this discussion should be an issue to itself. FWIW https://blog.mozilla.org/security/2021/05/10/beware-of-applications-misusing-root-stores/ recommends https://www.ccadb.org/resources rather than parsing certdata.txt.

@joyeecheung
Copy link
Member Author

joyeecheung commented Feb 7, 2025

There is an old issue about the storing as DER idea #45768 - I added a comment to reference the conversations here.

@bnoordhuis
Copy link
Member

The actual download is https://ccadb.my.salesforce-sites.com/mozilla/IncludedRootsPEMTxt?TrustBitsInclude=Websites which is a domain name that doesn't exactly instill a warm fuzzy sense of security.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tools Issues and PRs related to the tools directory.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants