Ant Design (antd) saw a minor version bump from 4.2.0 to 4.2.1, offering developers incremental improvements and bug fixes to this popular React UI library. While both versions maintain the core mission of providing enterprise-class UI components, a closer look reveals subtle yet important differences.
In its dependencies, version 4.2.1 has shifted from moment version ^2.24.0 to ~2.25.3. This points to a potential update related to date and time handling within the library. In devDependencies, version 4.2.1 updates jest from ^25.1.0 to ^26.0.0 and introduces esbuild-webpack-plugin at ^1.0.0-beta.3. This suggests improvements or changed to unit testing framework and bundling solution used for development. Furthermore, eslint-plugin-react-hooks has been updated from ^3.0.0 to ^4.0.0.
Developers already using Ant Design can upgrade to version 4.2.1 with relative ease, benefiting from refinements and potential performance enhancements. While the core component API remains largely consistent, it's always wise to review the official changelog for a comprehensive understanding of specific changes and their potential impact on existing projects, especially pertaining to the updated versions of testing and linting libraries. Overall, the update represents a step towards ensuring stability, reliability, and continued compatibility with the evolving JavaScript ecosystem.
All the vulnerabilities related to the version 4.2.1 of the package
Path Traversal: 'dir/../../filename' in moment.locale
This vulnerability impacts npm (server) users of moment.js, especially if user provided locale string, eg fr
is directly used to switch moment locale.
This problem is patched in 2.29.2, and the patch can be applied to all affected versions (from 1.0.1 up until 2.29.1, inclusive).
Sanitize user-provided locale name before passing it to moment.js.
Are there any links users can visit to find out more?
If you have any questions or comments about this advisory:
Moment.js vulnerable to Inefficient Regular Expression Complexity
The problem is patched in 2.29.4, the patch can be applied to all affected versions with minimal tweaking.
In general, given the proliferation of ReDoS attacks, it makes sense to limit the length of the user input to something sane, like 200 characters or less. I haven't seen legitimate cases of date-time strings longer than that, so all moment users who do pass a user-originating string to constructor are encouraged to apply such a rudimentary filter, that would help with this but also most future ReDoS vulnerabilities.
There is an excellent writeup of the issue here: https://github.com/moment/moment/pull/6015#issuecomment-1152961973=
The issue is rooted in the code that removes legacy comments (stuff inside parenthesis) from strings during rfc2822 parsing. moment("(".repeat(500000))
will take a few minutes to process, which is unacceptable.