Babel Preset React App streamlines the Babel configuration needed for React projects, offering a pre-configured set of Babel plugins and presets tailored for optimal Create React App development. Version 1.0.0 builds upon the foundations laid by version 0.2.1, introducing several key updates and additions that enhance the developer experience and ensure compatibility with evolving JavaScript standards.
One significant change is the inclusion of babel-preset-env in version 1.0.0, a powerful preset replacing babel-preset-latest. This allows for more targeted transpilation based on the target environment, potentially reducing the size of the final bundle and improving performance by only including necessary transformations. While babel-preset-latest offers a wider range of features, babel-preset-env is a considerable improvement for targeting the right browser.
Furthermore, version 1.0.0 upgrades several key dependencies. It updates babel-preset-react from 6.11.1 to 6.16.0 and includes essential plugins like babel-plugin-transform-es2015-parameters and babel-plugin-transform-es2015-destructuring, absent in version 0.2.1. In general all packages have been updated to increase compatibility and stability of the system, for example by fixing the es2015 compatibility. These additions improve support for modern JavaScript syntax within React components.
The update to version 1.0.0 reflects a commitment to keeping the preset aligned with the latest industry best practices and emerging language features, ultimately empowering developers to write cleaner, more modern React code with minimal configuration overhead.
All the vulnerabilities related to the version 1.0.0 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