public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Andrei Radchenko <aradchen@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/nodejs22] f44: Backport pacote fix for CVE-2026-9496
Date: Fri, 30 Oct 2026 11:40:39 GMT	[thread overview]
Message-ID: <179336043926.1.5773759179082115680.rpms-nodejs22-d140752371e8@fedoraproject.org> (raw)

            A new commit has been pushed.

            Repo   : rpms/nodejs22
            Branch : f44
            Commit : d140752371e8a02cd2fc59100e4ec88a24129b74
            Author : Andrei Radchenko <aradchen@redhat.com>
            Date   : 2026-10-30T12:40:14+01:00
            Stats  : +35/-0 in 2 file(s)
            URL    : https://src.fedoraproject.org/rpms/nodejs22/c/d140752371e8a02cd2fc59100e4ec88a24129b74?branch=f44

            Log:
            Backport pacote fix for CVE-2026-9496

Backports the upstream addGitSha fix (npm/pacote ce804fb) to the bundled
pacote 19.0.2. Replaces the ReDoS-prone `rawSpec.replace(/#.*$/, '')`
committish stripping with indexOf/slice, preventing denial of service via
a crafted spec.rawSpec value. The upstream fix ships in pacote 21.5.1,
which cannot be dropped into npm 10.9.9, so the change is backported.

Resolves: rhbz#2533203

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

---
diff --git a/0001-npm-backport-pacote-fix-for-CVE-2026-9496.patch b/0001-npm-backport-pacote-fix-for-CVE-2026-9496.patch
new file mode 100644
index 0000000..62c592a
--- /dev/null
+++ b/0001-npm-backport-pacote-fix-for-CVE-2026-9496.patch
@@ -0,0 +1,34 @@
+From 373af361b9194dc8bfe4e80318bd273ec02a7c5a Mon Sep 17 00:00:00 2001
+From: Andrei Radchenko <aradchen@redhat.com>
+Date: Thu, 22 Oct 2026 15:02:43 +0200
+Subject: [PATCH] npm backport pacote fix for CVE-2026-9496
+
+---
+ deps/npm/node_modules/pacote/lib/util/add-git-sha.js | 7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/deps/npm/node_modules/pacote/lib/util/add-git-sha.js b/deps/npm/node_modules/pacote/lib/util/add-git-sha.js
+index 843fe5b6..39893b47 100644
+--- a/deps/npm/node_modules/pacote/lib/util/add-git-sha.js
++++ b/deps/npm/node_modules/pacote/lib/util/add-git-sha.js
+@@ -3,12 +3,15 @@ const addGitSha = (spec, sha) => {
+   if (spec.hosted) {
+     const h = spec.hosted
+     const opt = { noCommittish: true }
+-    const base = h.https && h.auth ? h.https(opt) : h.shortcut(opt)
++    const base = h.https && (h.auth || h.default === 'https') ? h.https(opt) : h.shortcut(opt)
+ 
+     return `${base}#${sha}`
+   } else {
+     // don't use new URL for this, because it doesn't handle scp urls
+-    return spec.rawSpec.replace(/#.*$/, '') + `#${sha}`
++    // strip the committish with indexOf/slice to avoid a regexp redos
++    const hashIndex = spec.rawSpec.indexOf('#')
++    const base = hashIndex === -1 ? spec.rawSpec : spec.rawSpec.slice(0, hashIndex)
++    return `${base}#${sha}`
+   }
+ }
+ 
+-- 
+2.56.0
+

diff --git a/nodejs22.spec b/nodejs22.spec
index c218531..68188ee 100644
--- a/nodejs22.spec
+++ b/nodejs22.spec
@@ -168,6 +168,7 @@ Source101:      nodejs.srpm.macros
 0001-npm-update-ip-address-to-10.7.4.patch
 0001-npm-update-brace-expansion-to-2.1.7.patch
 0001-deps-update-brace-expansion-to-5.0.12.patch
+0001-npm-backport-pacote-fix-for-CVE-2026-9496.patch
 0001-fix-build-with-shared-brotli.patch
 
 %description

                 reply	other threads:[~2026-10-30 11:40 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179336043926.1.5773759179082115680.rpms-nodejs22-d140752371e8@fedoraproject.org \
    --to=aradchen@redhat.com \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox