Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(deps): update dependency moment to v2.29.4 [security] #630

Merged
merged 1 commit into from
Nov 6, 2023

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Oct 16, 2023

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
moment (source) 2.29.2 -> 2.29.4 age adoption passing confidence

GitHub Vulnerability Alerts

CVE-2022-31129

Impact

  • 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: https://github.com/moment/moment/pull/6015#issuecomment-1152961973=

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.


Release Notes

moment/moment (moment)

v2.29.4

Compare Source

  • Release Jul 6, 2022
    • #​6015 [bugfix] Fix ReDoS in preprocessRFC2822 regex

v2.29.3

Compare Source

  • Release Apr 17, 2022

Configuration

📅 Schedule: Branch creation - "" in timezone America/New_York, Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Mend Renovate. View repository job log here.

@codecov
Copy link

codecov bot commented Oct 16, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (a28338d) 88.02% compared to head (7c4345d) 88.02%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #630   +/-   ##
=======================================
  Coverage   88.02%   88.02%           
=======================================
  Files         417      417           
  Lines        6598     6598           
  Branches     1428     1428           
=======================================
  Hits         5808     5808           
  Misses        765      765           
  Partials       25       25           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@renovate renovate bot force-pushed the renovate/npm-moment-vulnerability branch 9 times, most recently from caa1275 to 7100c29 Compare October 20, 2023 20:52
@renovate renovate bot force-pushed the renovate/npm-moment-vulnerability branch 4 times, most recently from 0e85ea9 to 7a84b50 Compare October 27, 2023 14:26
@renovate renovate bot force-pushed the renovate/npm-moment-vulnerability branch from 7a84b50 to 7c4345d Compare November 6, 2023 13:51
@KristinAoki KristinAoki merged commit 78ef3c3 into master Nov 6, 2023
5 checks passed
@KristinAoki KristinAoki deleted the renovate/npm-moment-vulnerability branch November 6, 2023 14:35
Ian2012 pushed a commit to eduNEXT/frontend-app-course-authoring that referenced this pull request Nov 15, 2023
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant