[Security] Bump @babel/runtime from 7.26.0 to 7.27.1
Bumps @babel/runtime from 7.26.0 to 7.27.1. 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
.replace
method 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
.replace
method on a regular expression that contains named capturing groups- Your code uses untrusted strings as the second argument of
.replace
If you are using
@babel/preset-env
with thetargets
option, 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-env
is using by enabling thedebug
option.Patches
This problem has been fixed in
@babel/helpers
and@babel/runtime
7.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/core
7.26.10 is not required, but it guarantees that you are on a new enough@babel/helpers
version.
... (truncated)
Patched versions: 7.26.10 Affected versions: < 7.26.10
Release notes
Sourced from @babel/runtime
's releases.
v7.27.1 (2025-04-30)
Thanks
@kermanx
and@woaitsAryan
for your first PRs!
👓 Spec Compliance
babel-parser
babel-parser
,babel-types
🐛 Bug Fix
babel-plugin-proposal-destructuring-private
,babel-plugin-proposal-do-expressions
,babel-traverse
babel-helper-wrap-function
,babel-plugin-transform-async-to-generator
- #17251 Fix: propagate argument evaluation errors through async promise chain (
@magic-akari
)babel-helper-remap-async-to-generator
,babel-plugin-transform-async-to-generator
babel-helper-fixtures
,babel-parser
babel-generator
,babel-parser
babel-parser
babel-compat-data
,babel-preset-env
babel-traverse
- #17156 fix: Objects and arrays with multiple references should not be evaluated (
@liuxingbaoyu
)babel-generator
💅 Polish
babel-plugin-bugfix-v8-spread-parameters-in-optional-chaining
,babel-plugin-proposal-decorators
,babel-plugin-transform-arrow-functions
,babel-plugin-transform-class-properties
,babel-plugin-transform-destructuring
,babel-plugin-transform-object-rest-spread
,babel-plugin-transform-optional-chaining
,babel-plugin-transform-parameters
,babel-traverse
- #17221 Reduce generated names size for the 10th-11th (
@nicolo-ribaudo
)
🏠 Internal
babel-runtime-corejs2
,babel-runtime-corejs3
,babel-runtime
- #17263 Remove unused
regenerator-runtime
dep in@babel/runtime
(@nicolo-ribaudo
)babel-compat-data
,babel-preset-env
babel-compat-data
,babel-standalone
babel-register
- #16844 Migrate
@babel/register
to cts (@liuxingbaoyu
)babel-helpers
,babel-plugin-transform-async-generator-functions
,babel-plugin-transform-regenerator
,babel-preset-env
,babel-runtime-corejs3
- #17205 Inline regenerator in the relevant packages (
@nicolo-ribaudo
)- All packages
... (truncated)
Changelog
Sourced from @babel/runtime
's changelog.
v7.27.1 (2025-04-30)
👓 Spec Compliance
babel-parser
babel-parser
,babel-types
🐛 Bug Fix
babel-plugin-proposal-destructuring-private
,babel-plugin-proposal-do-expressions
,babel-traverse
babel-helper-wrap-function
,babel-plugin-transform-async-to-generator
- #17251 Fix: propagate argument evaluation errors through async promise chain (
@magic-akari
)babel-helper-remap-async-to-generator
,babel-plugin-transform-async-to-generator
babel-helper-fixtures
,babel-parser
babel-generator
,babel-parser
babel-parser
babel-compat-data
,babel-preset-env
babel-traverse
- #17156 fix: Objects and arrays with multiple references should not be evaluated (
@liuxingbaoyu
)babel-generator
💅 Polish
babel-plugin-bugfix-v8-spread-parameters-in-optional-chaining
,babel-plugin-proposal-decorators
,babel-plugin-transform-arrow-functions
,babel-plugin-transform-class-properties
,babel-plugin-transform-destructuring
,babel-plugin-transform-object-rest-spread
,babel-plugin-transform-optional-chaining
,babel-plugin-transform-parameters
,babel-traverse
- #17221 Reduce generated names size for the 10th-11th (
@nicolo-ribaudo
)
🏠 Internal
babel-runtime-corejs2
,babel-runtime-corejs3
,babel-runtime
- #17263 Remove unused
regenerator-runtime
dep in@babel/runtime
(@nicolo-ribaudo
)babel-compat-data
,babel-preset-env
babel-compat-data
,babel-standalone
- Other
babel-register
- #16844 Migrate
@babel/register
to cts (@liuxingbaoyu
)babel-cli
,babel-compat-data
,babel-core
,babel-generator
,babel-helper-compilation-targets
,babel-helper-fixtures
,babel-helper-module-imports
,babel-helper-module-transforms
,babel-helper-plugin-test-runner
,babel-helper-transform-fixture-test-runner
,babel-helpers
,babel-node
,babel-parser
,babel-plugin-transform-modules-amd
,babel-plugin-transform-modules-commonjs
,babel-plugin-transform-modules-systemjs
,babel-plugin-transform-modules-umd
,babel-plugin-transform-react-display-name
,babel-plugin-transform-regenerator
,babel-plugin-transform-runtime
,babel-plugin-transform-typeof-symbol
,babel-plugin-transform-typescript
,babel-preset-env
,babel-register
,babel-standalone
,babel-types
babel-plugin-transform-regenerator
... (truncated)
Commits
-
eebd3a0
v7.27.1 -
296cdc5
Remove unusedregenerator-runtime
dep in@babel/runtime
(#17263) -
fdc0fb5
[Babel 8] Bump nodejs requirements to^20.19.0 || >= 22.12.0
(#17204) -
5c350ea
v7.27.0 -
ca4865a
Fix: align behaviour to tscrewriteRelativeImportExtensions
(#17118) -
e1ce99d
v7.26.10 -
d5952e8
Fix processing of replacement pattern with named capture groups (#17173) -
64bca7b
v7.26.9 -
2d95140
v7.26.7 - See full diff in compare view