🚨 Your current dependencies have known security vulnerabilities 🚨
This dependency update fixes known security vulnerabilities. Please see the details below and assess their impact carefully. We recommend to merge and deploy this as soon as possible!
Here is everything you need to know about this update. Please take a good look at what changed and the test results before merging this pull request.
using string-to-date parsing in moment (more specifically rfc2822 parsing, which is tried by default) has quadratic (N^2) complexity on specific inputs
noticeable slowdown is observed with inputs above 10k characters
users who pass user-provided strings without sanity length checks to moment constructor are vulnerable to (Re)DoS attacks
Patches
The problem is patched in 2.29.4, the patch can be applied to all affected versions with minimal tweaking.
Workarounds
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.
References
There is an excellent writeup of the issue here: #6015 (comment)
Details
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.
Depfu will automatically keep this PR conflict-free, as long as you don't add any commits to this branch yourself. You can also trigger a rebase manually by commenting with @depfu rebase.
All Depfu comment commands
@depfu rebase
Rebases against your default branch and redoes this update
@depfu recreate
Recreates this PR, overwriting any edits that you've made to it
@depfu merge
Merges this PR once your tests are passing and conflicts are resolved
@depfu close
Closes this PR and deletes the branch
@depfu reopen
Restores the branch and reopens this PR (if it's closed)
@depfu pause
Ignores all future updates for this dependency and closes this PR
@depfu pause [minor|major]
Ignores all future minor/major updates for this dependency and closes this PR
@depfu resume
Future versions of this dependency will create PRs again (leaves this PR as is)
🚨 Your current dependencies have known security vulnerabilities 🚨
This dependency update fixes known security vulnerabilities. Please see the details below and assess their impact carefully. We recommend to merge and deploy this as soon as possible!
Here is everything you need to know about this update. Please take a good look at what changed and the test results before merging this pull request.
What changed?
✳️ moment (2.28.0 → 2.29.4) · Repo · Changelog
Security Advisories 🚨
🚨 Inefficient Regular Expression Complexity in moment
🚨 Path Traversal: 'dir/../../filename' in moment.locale
Release Notes
2.29.2 (from changelog)
Does any of this look wrong? Please let us know.
Commits
See the full diff on Github. The new version differs by 53 commits:
Build 2.24.4
Bump version to 2.24.4
Update changelog for 2.29.4
[bugfix] Fix redos in preprocessRFC2822 regex (#6015)
Merge branch 'master' into develop
Revert "[bugfix] Fix redos in preprocessRFC2822 regex (#6015)"
[bugfix] Fix redos in preprocessRFC2822 regex (#6015)
Build 2.29.3
Fixup release complaints
Bump version to 2.29.3
Update changes for 2.29.3
[bugfix] Remove const usage (#5995)
misc: fix advisory link (#5990)
Build 2.29.2
Bump version to 2.29.2
Update changelog for 2.29.2
[bugfix] Avoid loading path-looking locales from fs
[misc] Fix indentation (according to prettier)
[test] Avoid hours around DST
[locale] ar-ly: fix locale name (#5828)
[misc] fix builds (#5836)
[misc] Specify length of toArray return type (#5766)
[locale] tr: update translation of Monday and Saturday (#5756)
[misc] fix lint issues (#5762)
[misc] optimize for loops (#5744)
[bugfix] add standalone and format to "cs" locale (#5749)
[locale] Fix Serbian locale (sr, sr-cyrl) (#5742)
Build 2.29.1
Bump version to 2.29.1
Update changelog for 2.29.1
[bugfix] add format and standalone in hi locale (#5728)
[misc] Update dep message to reflect project status (#5737)
Build 2.29.0
Bump version to 2.29.0
Update changelog for 2.29.0
[locale] add relativeTime week translation for many languages (#5724)
[bugfix] fix moment.months() for PL locale (#5601)
[misc] update bug report template (#5611)
[locale] (ar-ma) adjust dow, doy to match fr (#5609)
[tests] add tests for isLeapYear and daysInMonth (#5614)
[locale] tg-TJ: Improve months and date formats (#5666)
[locale] sr-cyrl: Improve L* formats (#4742)
[misc] add 'ww' key to RelativeTimeSpec Interface (#5717)
[misc] check monthsParse configs on lint (#5716)
Update README.md (#5719)
[new locale] es-mx: add Spanish (Mexico) (#5696)
[locale] hu: add dot after short months (#4925)
[locale] (pt-br) add invalid date translation (#5661)
[misc] Bump `Prettier` to v2.1 (#5715)
[bugfix] More complete type definitions for strict formatless parsing #4611 (#5574)
[bugfix] expose deprecation handler in typings (#5637)
[bugfix] allow calendar with falsy input (#5647)
[new locale] bn-bd: Bengali (Bangladesh) (#5673)
Depfu will automatically keep this PR conflict-free, as long as you don't add any commits to this branch yourself. You can also trigger a rebase manually by commenting with
@depfu rebase
.All Depfu comment commands