Babel-preset-stage-2 is a valuable tool for JavaScript developers seeking to leverage upcoming ECMAScript features that are currently in stage 2 of the TC39 standardization process. This preset streamlines the use of these features, allowing for experimentation and adoption before they become finalized.
Comparing versions 6.1.2 and 6.1.17, we observe some key differences primarily in dependency versions. Both versions share the same core purpose of enabling stage 2 features, offer the same MIT license, and are maintained by Sebastian McKenzie, pointing to the stability and consistent stewardship of the project.
The update from 6.1.2 to 6.1.17 brings newer versions of its internal dependencies. Specifically, babel-preset-stage-3 is updated from version ^6.1.2 to ^6.1.17, babel-plugin-transform-object-rest-spread from ^6.0.14 to ^6.1.17 and babel-plugin-syntax-trailing-function-commas from ^6.0.14 to ^6.1.17. These upgrades suggest improvements and bug fixes within these dependent packages. Developers upgrading to 6.1.17 can expect better compatibility and possibly enhanced performance due to these underlying updates. Moreover, newer versions of those dependencies might include new features or fix documented/undocumented bugs.
The release date difference also indicates an active development cycle, with version 6.1.17 released a week after 6.1.2. Using the latest version ensures developers benefit from the most recent enhancements and resolutions of any known issues related to stage 2 features in Babel. Developers that want to use Javascript features earlier would find this package useful.
All the vulnerabilities related to the version 6.1.17 of the package
Babel vulnerable to arbitrary code execution when compiling specifically crafted malicious code
Using Babel to compile code that was specifically crafted by an attacker can lead to arbitrary code execution during compilation, when using plugins that rely on the path.evaluate()
or path.evaluateTruthy()
internal Babel methods.
Known affected plugins are:
@babel/plugin-transform-runtime
@babel/preset-env
when using its useBuiltIns
option@babel/helper-define-polyfill-provider
, such as babel-plugin-polyfill-corejs3
, babel-plugin-polyfill-corejs2
, babel-plugin-polyfill-es-shims
, babel-plugin-polyfill-regenerator
No other plugins under the @babel/
namespace are impacted, but third-party plugins might be.
Users that only compile trusted code are not impacted.
The vulnerability has been fixed in @babel/traverse@7.23.2
.
Babel 6 does not receive security fixes anymore (see Babel's security policy), hence there is no patch planned for babel-traverse@6
.
@babel/traverse
to v7.23.2 or higher. You can do this by deleting it from your package manager's lockfile and re-installing the dependencies. @babel/core
>=7.23.2 will automatically pull in a non-vulnerable version.@babel/traverse
and are using one of the affected packages mentioned above, upgrade them to their latest version to avoid triggering the vulnerable code path in affected @babel/traverse
versions:
@babel/plugin-transform-runtime
v7.23.2@babel/preset-env
v7.23.2@babel/helper-define-polyfill-provider
v0.4.3babel-plugin-polyfill-corejs2
v0.4.6babel-plugin-polyfill-corejs3
v0.8.5babel-plugin-polyfill-es-shims
v0.10.0babel-plugin-polyfill-regenerator
v0.5.3