[Security] Bump @babel/runtime from 7.26.0 to 7.27.0
Bumps @babel/runtime from 7.26.0 to 7.27.0. This update includes a security fix.
Vulnerabilities fixed
Babel has inefficient RegExp complexity in generated code with .replace when transpiling named capturing groups
Impact
When using Babel to compile regular expression named capturing groups, Babel will generate a polyfill for the
.replacemethod that has quadratic complexity on some specific replacement pattern strings (i.e. the second argument passed to.replace).Your generated code is vulnerable if all the following conditions are true:
- You use Babel to compile regular expression named capturing groups
- You use the
.replacemethod on a regular expression that contains named capturing groups- Your code uses untrusted strings as the second argument of
.replaceIf you are using
@babel/preset-envwith thetargetsoption, the transform that injects the vulnerable code is automatically enabled if:
- you use duplicated named capturing groups, and target any browser older than Chrome/Edge 126, Opera 112, Firefox 129, Safari 17.4, or Node.js 23
- you use any named capturing groups, and target any browser older than Chrome 64, Opera 71, Edge 79, Firefox 78, Safari 11.1, or Node.js 10
You can verify what transforms
@babel/preset-envis using by enabling thedebugoption.Patches
This problem has been fixed in
@babel/helpersand@babel/runtime7.26.10 and 8.0.0-alpha.17, please upgrade. It's likely that you do not directly depend on@babel/helpers, and instead you depend on@babel/core(which itself depends on@babel/helpers). Upgrading to@babel/core7.26.10 is not required, but it guarantees that you are on a new enough@babel/helpersversion.
... (truncated)
Patched versions: 7.26.10 Affected versions: < 7.26.10
Release notes
Sourced from @babel/runtime's releases.
v7.27.0 (2025-03-24)
Thanks
@ishchhabraand@vovkasmfor your first PRs!
👓 Spec Compliance
🚀 New Feature
babel-helper-create-class-features-plugin,babel-traverse,babel-types
- #17169 Allow
traverseFastto exit early (@liuxingbaoyu)babel-parser,babel-typesbabel-generatorbabel-parser,babel-template
- #17149 Add
allowYieldOutsideFunctionto parser (@liuxingbaoyu)babel-plugin-transform-typescript,babel-traverse
- #17102 feat: Add
upToScopeparameter tohasBinding(@liuxingbaoyu)babel-parserbabel-types
- #17162 feat(babel-types): Add support for BigInt literal conversion in valueToNode (
@ishchhabra)
🐛 Bug Fix
babel-helper-create-class-features-plugin,babel-plugin-transform-class-properties
- #16816 fix: Class reference in type throws error (
@liuxingbaoyu)babel-traverse
- #17170 fix: Reset child scopes when
scope.crawl()(@liuxingbaoyu)babel-helpers,babel-preset-typescript,babel-runtime-corejs2,babel-runtime-corejs3,babel-runtimebabel-cli
- #17182 fix:
@babel/cligenerates duplicate inline source maps (@liuxingbaoyu)babel-plugin-transform-named-capturing-groups-regex,babel-types:running_woman: Performance
babel-types
- #16870 perf: Improve builders of
@babel/types(@liuxingbaoyu)babel-helper-create-regexp-features-pluginCommitters: 5
- Babel Bot (
@babel-bot)- Huáng Jùnliàng (
@JLHwung)- Ish Chhabra (
@ishchhabra)- Vladimir Timofeev (
@vovkasm)@liuxingbaoyuv7.26.10 (2025-03-11)
... (truncated)
Changelog
Sourced from @babel/runtime's changelog.
v7.27.0 (2025-03-24)
👓 Spec Compliance
🚀 New Feature
babel-helper-create-class-features-plugin,babel-traverse,babel-types
- #17169 Allow
traverseFastto exit early (@liuxingbaoyu)babel-parser,babel-typesbabel-generatorbabel-parser,babel-template
- #17149 Add
allowYieldOutsideFunctionto parser (@liuxingbaoyu)babel-plugin-transform-typescript,babel-traverse
- #17102 feat: Add
upToScopeparameter tohasBinding(@liuxingbaoyu)babel-parserbabel-types
- #17162 feat(babel-types): Add support for BigInt literal conversion in valueToNode (
@ishchhabra)
🐛 Bug Fix
babel-helper-create-class-features-plugin,babel-plugin-transform-class-properties
- #16816 fix: Class reference in type throws error (
@liuxingbaoyu)babel-traverse
- #17170 fix: Reset child scopes when
scope.crawl()(@liuxingbaoyu)babel-helpers,babel-preset-typescript,babel-runtime-corejs2,babel-runtime-corejs3,babel-runtimebabel-cli
- #17182 fix:
@babel/cligenerates duplicate inline source maps (@liuxingbaoyu)babel-plugin-transform-named-capturing-groups-regex,babel-types:running_woman: Performance
babel-types
- #16870 perf: Improve builders of
@babel/types(@liuxingbaoyu)babel-helper-create-regexp-features-pluginv7.26.10 (2025-03-11)
👓 Spec Compliance
🐛 Bug Fix
babel-parser,babel-templatebabel-core
- #17142 fix: "Map maximum size exceeded" in deepClone (
@liuxingbaoyu)
... (truncated)