public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/nodejs22] rawhide: Update internal brace-expansion package to 2.1.6
@ 2026-10-15 14:06 Andrei Radchenko
  0 siblings, 0 replies; only message in thread
From: Andrei Radchenko @ 2026-10-15 14:06 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/nodejs22
            Branch : rawhide
            Commit : 9f6beedc2868653a7a97902db716e8a9308088d5
            Author : Andrei Radchenko <aradchen@redhat.com>
            Date   : 2026-10-13T14:16:49+02:00
            Stats  : +472/-204 in 4 file(s)
            URL    : https://src.fedoraproject.org/rpms/nodejs22/c/9f6beedc2868653a7a97902db716e8a9308088d5?branch=rawhide

            Log:
            Update internal brace-expansion package to 2.1.6

Resolves: rhbz#2550225 rhbz##2550333
Fixes: CVE-2026-102276 CVE-2026-102278

---
diff --git a/0001-Update-brace-expansion-to-version-2.1.6.patch b/0001-Update-brace-expansion-to-version-2.1.6.patch
new file mode 100644
index 0000000..3202c1f
--- /dev/null
+++ b/0001-Update-brace-expansion-to-version-2.1.6.patch
@@ -0,0 +1,471 @@
+From d0ba62621ddc25435419afc81e862141ceb546f8 Mon Sep 17 00:00:00 2001
+From: Andrei Radchenko <aradchen@redhat.com>
+Date: Tue, 13 Oct 2026 14:12:18 +0200
+Subject: [PATCH] Update brace-expansion to version 2.1.6
+
+---
+ .../npm/node_modules/brace-expansion/index.js | 371 +++++++++++++-----
+ .../node_modules/brace-expansion/package.json |   2 +-
+ 2 files changed, 274 insertions(+), 99 deletions(-)
+
+diff --git a/deps/npm/node_modules/brace-expansion/index.js b/deps/npm/node_modules/brace-expansion/index.js
+index 254ca75d..7e754076 100644
+--- a/deps/npm/node_modules/brace-expansion/index.js
++++ b/deps/npm/node_modules/brace-expansion/index.js
+@@ -8,6 +8,30 @@ var escClose = '\0CLOSE'+Math.random()+'\0';
+ var escComma = '\0COMMA'+Math.random()+'\0';
+ var escPeriod = '\0PERIOD'+Math.random()+'\0';
+ 
++var EXPANSION_MAX = 100000
++
++// `EXPANSION_MAX` caps the *number* of expansions, but not their length. An
++// input like `'{a,b}'.repeat(1500)` stays under that count - its output is
++// truncated to 100k results - while making every result ~1500 characters
++// long. The result set, and the intermediate arrays built while combining
++// brace sets, then grow large enough to exhaust memory and crash the process
++// (CVE-2026-14257). `EXPANSION_MAX_LENGTH` bounds the total number of
++// characters the accumulator may hold at any point, so memory stays flat no
++// matter how many brace groups are chained. The limit sits well above any
++// realistic expansion (100k results hitting `EXPANSION_MAX` measure ~1M
++// characters) so legitimate input is unaffected.
++var EXPANSION_MAX_LENGTH = 4000000
++
++// `expand` recurses once per level of brace *nesting* - both when expanding a
++// set's comma members and when re-wrapping a set whose body is a single part.
++// The CVE-2026-14257 fix made the *tail* iterative (recursion on `m.post`, one
++// level per chained group), which left nesting depth unbounded: about 3,100
++// levels of `{{{...a,b...}}}` - only ~6KB of input - exhausted the native stack
++// and crashed the process. `EXPANSION_MAX_DEPTH` bounds how deep the parser
++// will follow nesting. It sits far above any realistic pattern and well below
++// the depth at which the stack runs out.
++var EXPANSION_MAX_DEPTH = 1000
++
+ function numeric(str) {
+   return parseInt(str, 10) == str
+     ? parseInt(str, 10)
+@@ -31,40 +55,65 @@ function unescapeBraces(str) {
+ }
+ 
+ 
++// Like `target.push(...items)` but doesn't overflow the stack
++function pushAll(target, items) {
++  for (var i = 0; i < items.length; i++) {
++    target.push(items[i]);
++  }
++}
++
+ // Basically just str.split(","), but handling cases
+ // where we have nested braced sections, which should be
+ // treated as individual members, like {a,{b,c},d}
+ function parseCommaParts(str) {
+-  if (!str)
+-    return [''];
+-
+   var parts = [];
+-  var m = balanced('{', '}', str);
+ 
+-  if (!m)
+-    return str.split(',');
++  // Walk the brace groups iteratively. Recursing on `post` once per group let a
++  // chain of them exhaust the stack - the parsing-side counterpart to
++  // the `expand` overflow fixed for CVE-2026-14257, and not something `max` or
++  // `maxLength` can bound, since it happens before expansion.
++  //
++  // The part the next chunk continues
++  var carry = '';
+ 
+-  var pre = m.pre;
+-  var body = m.body;
+-  var post = m.post;
+-  var p = pre.split(',');
++  for (;;) {
++    var m = balanced('{', '}', str);
+ 
+-  p[p.length-1] += '{' + body + '}';
+-  var postParts = parseCommaParts(post);
+-  if (post.length) {
+-    p[p.length-1] += postParts.shift();
+-    p.push.apply(p, postParts);
+-  }
++    if (!m) {
++      var tail = str.split(',');
++      tail[0] = carry + tail[0];
++      pushAll(parts, tail);
++      return parts;
++    }
+ 
+-  parts.push.apply(parts, p);
++    var pre = m.pre;
++    var body = m.body;
++    var post = m.post;
++    var p = pre.split(',');
++
++    p[0] = carry + p[0];
++    p[p.length-1] += '{' + body + '}';
++
++    if (!post.length) {
++      pushAll(parts, p);
++      return parts;
++    }
+ 
+-  return parts;
++    carry = p.pop();
++    pushAll(parts, p);
++    str = post;
++  }
+ }
+ 
+-function expandTop(str) {
++function expandTop(str, options) {
+   if (!str)
+     return [];
+ 
++  options = options || {};
++  var max = options.max == null ? EXPANSION_MAX : options.max;
++  var maxLength = options.maxLength == null ? EXPANSION_MAX_LENGTH : options.maxLength;
++  var maxDepth = options.maxDepth == null ? EXPANSION_MAX_DEPTH : options.maxDepth;
++
+   // I don't know why Bash 4.3 does this, but it does.
+   // Anything starting with {} will have the first two bytes preserved
+   // but *only* at the top level, so {},a}b will not expand to anything,
+@@ -75,7 +124,7 @@ function expandTop(str) {
+     str = '\\{\\}' + str.substr(2);
+   }
+ 
+-  return expand(escapeBraces(str), true).map(unescapeBraces);
++  return expand(escapeBraces(str), max, maxLength, maxDepth, 0, true).map(unescapeBraces);
+ }
+ 
+ function embrace(str) {
+@@ -92,24 +141,153 @@ function gte(i, y) {
+   return i >= y;
+ }
+ 
+-function expand(str, isTop) {
+-  var expansions = [];
++// Build `{ acc[a] + pre + values[v] }` for every combination, capping the
++// number of results at `max` and the total number of characters at `maxLength`.
++// This is the one place output grows, so bounding it here keeps the single
++// accumulator - and therefore memory - flat regardless of how many brace groups
++// are combined (CVE-2026-14257).
++function combine(
++  acc,
++  pre,
++  values,
++  max,
++  maxLength,
++  dropEmpties
++) {
++  var out = []
++  var length = 0
++  for (var a = 0; a < acc.length; a++) {
++    for (var v = 0; v < values.length; v++) {
++      if (out.length >= max) return out
++      var expansion = acc[a] + pre + values[v]
++      // Bash drops empty results at the top level. Skip them before they count
++      // against `max`, so `max` bounds the number of *kept* results.
++      if (dropEmpties && !expansion) continue
++      if (length + expansion.length > maxLength) return out
++      out.push(expansion)
++      length += expansion.length
++    }
++  }
++  return out
++}
++
++// The expansion values of a single numeric (`1..5`) or alphabetic (`a..e..2`)
++// sequence body.
++function expandSequence(
++  body,
++  isAlphaSequence,
++  max,
++  maxLength
++) {
++  var n = body.split(/\.\./)
++  var N = []
++  // A sequence body always splits into two or three parts, but the compiler
++  // can't know that.
++  /* c8 ignore start */
++  if (n[0] === undefined || n[1] === undefined) {
++    return N
++  }
++  /* c8 ignore stop */
++  var x = numeric(n[0])
++  var y = numeric(n[1])
++  var width = Math.max(n[0].length, n[1].length)
++  var incr =
++    n.length === 3 && n[2] !== undefined ?
++      Math.max(Math.abs(numeric(n[2])), 1)
++    : 1
++  var test = lte
++  var reverse = y < x
++  if (reverse) {
++    incr *= -1
++    test = gte
++  }
++  var pad = n.some(isPadded)
++
++  var length = 0
++  for (var i = x; test(i, y) && N.length < max; i += incr) {
++    var c
++    if (isAlphaSequence) {
++      c = String.fromCharCode(i)
++      if (c === '\\') {
++        c = ''
++      }
++    } else {
++      c = String(i)
++      if (pad) {
++        var need = width - c.length
++        if (need > 0) {
++          var z = new Array(need + 1).join('0')
++          if (i < 0) {
++            c = '-' + z + c.slice(1)
++          } else {
++            c = z + c
++          }
++        }
++      }
++    }
++    if (length + c.length > maxLength) break
++    N.push(c)
++    length += c.length
++  }
++  return N
++}
++
++function expand(
++  str,
++  max,
++  maxLength,
++  maxDepth,
++  depth,
++  isTop
++) {
++  // Too deeply nested to keep following: treat the rest as literal, the same
++  // way a group that cannot expand is already handled. Truncating rather than
++  // throwing keeps expansion total, matching `max` and `maxLength`.
++  if (depth > maxDepth) {
++    return [str];
++  }
+ 
+-  var m = balanced('{', '}', str);
+-  if (!m) return [str];
++  // Consume the string's top-level brace groups left to right, threading a
++  // running set of combined prefixes (`acc`). Expanding the tail iteratively -
++  // rather than recursing on `m.post` once per group - keeps the native stack
++  // depth constant, so deeply chained input (`'{a,b}'.repeat(3000)`) can no
++  // longer overflow the stack, and leaves a single accumulator whose size
++  // `maxLength` bounds directly (CVE-2026-14257).
++  var acc = ['']
+ 
+-  // no need to expand pre, since it is guaranteed to be free of brace-sets
+-  var pre = m.pre;
+-  var post = m.post.length
+-    ? expand(m.post, false)
+-    : [''];
++  // Bash drops empty results, but only when the *first* top-level group is a
++  // comma set - a sequence like `{a..\}` may legitimately yield ''. The drop
++  // is on the final strings, so it is applied to whichever `combine` produces
++  // them (the one with no brace set left in the tail).
++  var dropEmpties = false
++  var firstGroup = true
+ 
+-  if (/\$$/.test(m.pre)) {
+-    for (var k = 0; k < post.length; k++) {
+-      var expansion = pre+ '{' + m.body + '}' + post[k];
+-      expansions.push(expansion);
++  for (;;) {
++    const m = balanced('{', '}', str)
++
++    // No brace set left: the rest of the string is literal.
++    if (!m) {
++      return combine(acc, str, [''], max, maxLength, dropEmpties)
++    }
++
++    // no need to expand pre, since it is guaranteed to be free of brace-sets
++    const pre = m.pre
++
++    if (/\$$/.test(pre)) {
++      acc = combine(
++        acc,
++        pre + '{' + m.body + '}',
++        [''],
++        max,
++        maxLength,
++        dropEmpties && !m.post.length
++      )
++      firstGroup = false
++      if (!m.post.length) break
++      str = m.post
++      continue
+     }
+-  } else {
++
+     var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
+     var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
+     var isSequence = isNumericSequence || isAlphaSequence;
+@@ -118,86 +296,83 @@ function expand(str, isTop) {
+       // {a},b}
+       if (m.post.match(/,(?!,).*\}/)) {
+         str = m.pre + '{' + m.body + escClose + m.post;
+-        return expand(str);
++        isTop = true;
++        continue;
+       }
+-      return [str];
++      // Nothing here expands, so the whole remaining string is literal.
++      return combine(
++        acc,
++        pre + '{' + m.body + '}' + m.post,
++        [''],
++        max,
++        maxLength,
++        dropEmpties
++      )
+     }
+ 
+-    var n;
++    if (firstGroup) {
++      dropEmpties = isTop && !isSequence
++      firstGroup = false
++    }
++
++    var values;
+     if (isSequence) {
+-      n = m.body.split(/\.\./);
++      values = expandSequence(m.body, isAlphaSequence, max, maxLength);
+     } else {
+-      n = parseCommaParts(m.body);
+-      if (n.length === 1) {
++      var n = parseCommaParts(m.body);
++      if (n.length === 1 && n[0] !== undefined) {
+         // x{{a,b}}y ==> x{a}y x{b}y
+-        n = expand(n[0], false).map(embrace);
++        n = expand(n[0], max, maxLength, maxDepth, depth + 1, false).map(embrace);
++        //XXX is this necessary? Can't seem to hit it in tests.
++        /* c8 ignore start */
+         if (n.length === 1) {
+-          return post.map(function(p) {
+-            return m.pre + n[0] + p;
+-          });
++          acc = combine(
++            acc,
++            pre + n[0],
++            [''],
++            max,
++            maxLength,
++            dropEmpties && !m.post.length
++          )
++          if (!m.post.length) break
++          str = m.post
++          continue
+         }
++        /* c8 ignore stop */
+       }
+-    }
+-
+-    // at this point, n is the parts, and we know it's not a comma set
+-    // with a single entry.
+-    var N;
+ 
+-    if (isSequence) {
+-      var x = numeric(n[0]);
+-      var y = numeric(n[1]);
+-      var width = Math.max(n[0].length, n[1].length)
+-      var incr = n.length == 3
+-        ? Math.abs(numeric(n[2]))
+-        : 1;
+-      var test = lte;
+-      var reverse = y < x;
+-      if (reverse) {
+-        incr *= -1;
+-        test = gte;
+-      }
+-      var pad = n.some(isPadded);
+-
+-      N = [];
+-
+-      for (var i = x; test(i, y); i += incr) {
+-        var c;
+-        if (isAlphaSequence) {
+-          c = String.fromCharCode(i);
+-          if (c === '\\')
+-            c = '';
+-        } else {
+-          c = String(i);
+-          if (pad) {
+-            var need = width - c.length;
+-            if (need > 0) {
+-              var z = new Array(need + 1).join('0');
+-              if (i < 0)
+-                c = '-' + z + c.slice(1);
+-              else
+-                c = z + c;
+-            }
+-          }
++      // Values that `combine` is going to drop as empty produce no result, so
++      // they must not count against `max` - otherwise `{a,,b}` with `max: 2`
++      // would stop at `['a', '']` and yield one result instead of two. Skipping
++      // them outright keeps `values` bounded while leaving `max` a bound on
++      // *kept* results.
++      var dropsEmpties = dropEmpties && !m.post.length && !pre
++      for (var d = 0; dropsEmpties && d < acc.length; d++) {
++        if (acc[d]) {
++          dropsEmpties = false
+         }
+-        N.push(c);
+       }
+-    } else {
+-      N = [];
+ 
+-      for (var j = 0; j < n.length; j++) {
+-        N.push.apply(N, expand(n[j], false));
++      values = []
++      var valuesLength = 0
++      outer: for (var j = 0; j < n.length; j++) {
++        var expanded = expand(n[j], max, maxLength, maxDepth, depth + 1, false)
++        for (var k = 0; k < expanded.length; k++) {
++          var v = expanded[k]
++          if (dropsEmpties && !v) continue
++          if (values.length >= max || valuesLength + v.length > maxLength) {
++            break outer
++          }
++          values.push(v)
++          valuesLength += v.length
++        }
+       }
+     }
+ 
+-    for (var j = 0; j < N.length; j++) {
+-      for (var k = 0; k < post.length; k++) {
+-        var expansion = pre + N[j] + post[k];
+-        if (!isTop || isSequence || expansion)
+-          expansions.push(expansion);
+-      }
+-    }
++    acc = combine(acc, pre, values, max, maxLength, dropEmpties && !m.post.length)
++    if (!m.post.length) break
++    str = m.post
+   }
+ 
+-  return expansions;
++  return acc
+ }
+-
+diff --git a/deps/npm/node_modules/brace-expansion/package.json b/deps/npm/node_modules/brace-expansion/package.json
+index c7eee345..21c6faa2 100644
+--- a/deps/npm/node_modules/brace-expansion/package.json
++++ b/deps/npm/node_modules/brace-expansion/package.json
+@@ -1,7 +1,7 @@
+ {
+   "name": "brace-expansion",
+   "description": "Brace expansion as known from sh/bash",
+-  "version": "2.0.2",
++  "version": "2.1.6",
+   "repository": {
+     "type": "git",
+     "url": "git://github.com/juliangruber/brace-expansion.git"
+-- 
+2.55.0
+

diff --git a/0004-CVE-2026-25547-braces-expansion.patch b/0004-CVE-2026-25547-braces-expansion.patch
deleted file mode 100644
index 726ec71..0000000
--- a/0004-CVE-2026-25547-braces-expansion.patch
+++ /dev/null
@@ -1,102 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: tjuhasz <tjuhasz@redhat.com>
-Date: Tue, 25 Feb 2026 14:21:26 +0100
-Subject: [PATCH] CVE-2026-25547: Fix brace expansion vulnerability
-
-Add expansion limit to prevent DoS attacks through excessive
-brace expansion in the brace-expansion module.
-
----
- deps/npm/node_modules/brace-expansion/index.js | 20 ++++++++++++--------
- 1 file changed, 12 insertions(+), 8 deletions(-)
-
-diff --git a/deps/npm/node_modules/brace-expansion/index.js b/deps/npm/node_modules/brace-expansion/index.js
---- a/deps/npm/node_modules/brace-expansion/index.js	2026-01-12 23:55:24.000000000 +0100
-+++ b/deps/npm/node_modules/brace-expansion/index.js	2026-02-25 14:21:26.829483831 +0100
-@@ -8,6 +8,8 @@
- var escComma = '\0COMMA'+Math.random()+'\0';
- var escPeriod = '\0PERIOD'+Math.random()+'\0';
- 
-+const EXPANSION_MAX = 100_000;
-+
- function numeric(str) {
-   return parseInt(str, 10) == str
-     ? parseInt(str, 10)
-@@ -61,9 +63,11 @@
-   return parts;
- }
- 
--function expandTop(str) {
-+function expandTop(str, options = {}) {
-   if (!str)
-     return [];
-+  
-+  const { max = EXPANSION_MAX } = options;
- 
-   // I don't know why Bash 4.3 does this, but it does.
-   // Anything starting with {} will have the first two bytes preserved
-@@ -75,7 +79,7 @@
-     str = '\\{\\}' + str.substr(2);
-   }
- 
--  return expand(escapeBraces(str), true).map(unescapeBraces);
-+  return expand(escapeBraces(str), max, true).map(unescapeBraces);
- }
- 
- function embrace(str) {
-@@ -92,7 +96,7 @@
-   return i >= y;
- }
- 
--function expand(str, isTop) {
-+function expand(str, max, isTop) {
-   var expansions = [];
- 
-   var m = balanced('{', '}', str);
-@@ -101,11 +105,11 @@
-   // no need to expand pre, since it is guaranteed to be free of brace-sets
-   var pre = m.pre;
-   var post = m.post.length
--    ? expand(m.post, false)
-+    ? expand(m.post, max, false)
-     : [''];
- 
-   if (/\$$/.test(m.pre)) {
--    for (var k = 0; k < post.length; k++) {
-+    for (var k = 0; k < post.length && k < max; k++) {
-       var expansion = pre+ '{' + m.body + '}' + post[k];
-       expansions.push(expansion);
-     }
-@@ -118,7 +122,7 @@
-       // {a},b}
-       if (m.post.match(/,(?!,).*\}/)) {
-         str = m.pre + '{' + m.body + escClose + m.post;
--        return expand(str);
-+        return expand(str, max, true);
-       }
-       return [str];
-     }
-@@ -130,7 +134,7 @@
-       n = parseCommaParts(m.body);
-       if (n.length === 1) {
-         // x{{a,b}}y ==> x{a}y x{b}y
--        n = expand(n[0], false).map(embrace);
-+        n = expand(n[0], max, false).map(embrace);
-         if (n.length === 1) {
-           return post.map(function(p) {
-             return m.pre + n[0] + p;
-@@ -185,12 +189,12 @@
-       N = [];
- 
-       for (var j = 0; j < n.length; j++) {
--        N.push.apply(N, expand(n[j], false));
-+        N.push.apply(N, expand(n[j], max, false));
-       }
-     }
- 
-     for (var j = 0; j < N.length; j++) {
--      for (var k = 0; k < post.length; k++) {
-+      for (var k = 0; k < post.length && expansions.length < max; k++) {
-         var expansion = pre + N[j] + post[k];
-         if (!isTop || isSequence || expansion)
-           expansions.push(expansion);

diff --git a/0005-CVE-2026-13149-brace-expansion-unbound-recursion.patch b/0005-CVE-2026-13149-brace-expansion-unbound-recursion.patch
deleted file mode 100644
index 80626ce..0000000
--- a/0005-CVE-2026-13149-brace-expansion-unbound-recursion.patch
+++ /dev/null
@@ -1,100 +0,0 @@
-From 213dc171de329a09f34c7a3222cad723ee65d693 Mon Sep 17 00:00:00 2001
-From: RHEL Packaging Agent <redhat-ymir-agent@redhat.com>
-Date: Tue, 14 Jul 2026 08:27:05 +0000
-Subject: [PATCH] CVE-2026-13149: Fix unbound recursion in brace-expansion
-
-A run of non-expanding {} groups expanded post once per group before the
-early returns that never use it, doubling the work on every group. expand()
-ran in O(2^n) and blocked for minutes on a ~90 byte input.
-
-Defer expanding post until a brace set is known to expand, and turn the
-{a},b} restart into a loop so a long run of {} groups can't exhaust the
-call stack.
-
-Adapted from upstream TypeScript fix to the JavaScript version (2.0.2)
-vendored in Node.js.
-
-Upstream: https://github.com/juliangruber/brace-expansion/commit/c7e33ec
----
- .../npm/node_modules/brace-expansion/index.js | 49 ++++++++++++-------
- 1 file changed, 32 insertions(+), 17 deletions(-)
-
-diff --git a/deps/npm/node_modules/brace-expansion/index.js b/deps/npm/node_modules/brace-expansion/index.js
-index d084bac4..5d5f61ff 100644
---- a/deps/npm/node_modules/brace-expansion/index.js
-+++ b/deps/npm/node_modules/brace-expansion/index.js
-@@ -99,21 +99,27 @@ function gte(i, y) {
- function expand(str, max, isTop) {
-   var expansions = [];
- 
--  var m = balanced('{', '}', str);
--  if (!m) return [str];
--
--  // no need to expand pre, since it is guaranteed to be free of brace-sets
--  var pre = m.pre;
--  var post = m.post.length
--    ? expand(m.post, max, false)
--    : [''];
--
--  if (/\$$/.test(m.pre)) {
--    for (var k = 0; k < post.length && k < max; k++) {
--      var expansion = pre+ '{' + m.body + '}' + post[k];
--      expansions.push(expansion);
-+  // The {a},b} rewrite below restarts expansion on a rewritten string with
-+  // the same max and isTop = true. Loop instead of recursing so a long run
-+  // of non-expanding {} groups can't exhaust the call stack.
-+  for (;;) {
-+    var m = balanced('{', '}', str);
-+    if (!m) return [str];
-+
-+    // no need to expand pre, since it is guaranteed to be free of brace-sets
-+    var pre = m.pre;
-+
-+    if (/\$$/.test(m.pre)) {
-+      var post = m.post.length
-+        ? expand(m.post, max, false)
-+        : [''];
-+      for (var k = 0; k < post.length && k < max; k++) {
-+        var expansion = pre+ '{' + m.body + '}' + post[k];
-+        expansions.push(expansion);
-+      }
-+      return expansions;
-     }
--  } else {
-+
-     var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
-     var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
-     var isSequence = isNumericSequence || isAlphaSequence;
-@@ -122,11 +128,20 @@ function expand(str, max, isTop) {
-       // {a},b}
-       if (m.post.match(/,(?!,).*\}/)) {
-         str = m.pre + '{' + m.body + escClose + m.post;
--        return expand(str, max, true);
-+        isTop = true;
-+        continue;
-       }
-       return [str];
-     }
- 
-+    // Only expand post once we know this brace set actually expands. Computing
-+    // it before the early returns above expanded post a second time on every
-+    // non-expanding {}, which is what made inputs like a{},{},{}... blow up
-+    // exponentially.
-+    var post = m.post.length
-+      ? expand(m.post, max, false)
-+      : [''];
-+
-     var n;
-     if (isSequence) {
-       n = m.body.split(/\.\./);
-@@ -200,8 +215,8 @@ function expand(str, max, isTop) {
-           expansions.push(expansion);
-       }
-     }
--  }
- 
--  return expansions;
-+    return expansions;
-+  }
- }
- 

diff --git a/nodejs22.spec b/nodejs22.spec
index 0fb7879..2f5cb1f 100644
--- a/nodejs22.spec
+++ b/nodejs22.spec
@@ -168,8 +168,7 @@ Source101:      nodejs.srpm.macros
 0001-Remove-unused-OpenSSL-config.patch
 0001-fips-disable-options.patch
 0002-CVE-2026-42338-ip-address-security-fix.patch
-0004-CVE-2026-25547-braces-expansion.patch
-0005-CVE-2026-13149-brace-expansion-unbound-recursion.patch
+0001-Update-brace-expansion-to-version-2.1.6.patch
 
 %description
 Node.js is a platform built on Chrome's JavaScript runtime

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-10-15 14:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-15 14:06 [rpms/nodejs22] rawhide: Update internal brace-expansion package to 2.1.6 Andrei Radchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox