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] - autoclosed #252

Closed
wants to merge 1 commit into from

Conversation

renovate[bot]
Copy link

@renovate renovate bot commented Apr 9, 2022

Mend Renovate

This PR contains the following updates:

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

GitHub Vulnerability Alerts

CVE-2022-24785

Impact

This vulnerability impacts npm (server) users of moment.js, especially if user provided locale string, eg fr is directly used to switch moment locale.

Patches

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).

Workarounds

Sanitize user-provided locale name before passing it to moment.js.

References

Are there any links users can visit to find out more?

For more information

If you have any questions or comments about this advisory:

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

v2.29.2

Compare Source

  • Release Apr 3 2022

Address GHSA-8hfj-j24r-96c4


Configuration

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

🚦 Automerge: Enabled.

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 was generated by Mend Renovate. View the repository job log.

@renovate renovate bot force-pushed the renovate/npm-moment-vulnerability branch from 50d2744 to dac5320 Compare April 29, 2022 13:38
@renovate renovate bot force-pushed the renovate/npm-moment-vulnerability branch 3 times, most recently from 8595024 to 6a8e5fc Compare June 23, 2022 12:06
@renovate renovate bot changed the title chore(deps): update dependency moment to 2.29.2 [security] chore(deps): update dependency moment to 2.29.2 [SECURITY] Jun 27, 2022
@renovate renovate bot changed the title chore(deps): update dependency moment to 2.29.2 [SECURITY] chore(deps): update dependency moment to 2.29.2 [security] Jun 28, 2022
@renovate renovate bot force-pushed the renovate/npm-moment-vulnerability branch from 6a8e5fc to d6f01f8 Compare June 29, 2022 07:32
@renovate renovate bot force-pushed the renovate/npm-moment-vulnerability branch from d6f01f8 to e90c4ec Compare July 8, 2022 11:36
@renovate renovate bot changed the title chore(deps): update dependency moment to 2.29.2 [security] chore(deps): update dependency moment to 2.29.4 [security] Jul 8, 2022
@renovate renovate bot force-pushed the renovate/npm-moment-vulnerability branch from e90c4ec to ae9a101 Compare July 19, 2022 07:08
@renovate renovate bot force-pushed the renovate/npm-moment-vulnerability branch 2 times, most recently from 356208d to 89e2b47 Compare July 27, 2022 12:17
@renovate renovate bot force-pushed the renovate/npm-moment-vulnerability branch from 89e2b47 to 3076bfe Compare August 4, 2022 08:41
@codecov
Copy link

codecov bot commented Aug 4, 2022

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.71%. Comparing base (5cc03e0) to head (da5e1d4).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #252   +/-   ##
=======================================
  Coverage   84.71%   84.71%           
=======================================
  Files         174      174           
  Lines        3645     3645           
  Branches      880      872    -8     
=======================================
  Hits         3088     3088           
  Misses        543      543           
  Partials       14       14           

☔ 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 2 times, most recently from 8d5e24f to 8277557 Compare September 13, 2022 13:09
@renovate renovate bot force-pushed the renovate/npm-moment-vulnerability branch from 8277557 to 6d714d7 Compare October 6, 2022 17:40
@renovate renovate bot force-pushed the renovate/npm-moment-vulnerability branch 3 times, most recently from 620b52f to 3efbf7a Compare October 25, 2022 14:52
@renovate renovate bot force-pushed the renovate/npm-moment-vulnerability branch 2 times, most recently from 28d7450 to cd6e108 Compare December 7, 2022 10:14
@renovate renovate bot force-pushed the renovate/npm-moment-vulnerability branch from cd6e108 to 59ff8b1 Compare December 15, 2022 06:52
@renovate renovate bot changed the title chore(deps): update dependency moment to 2.29.4 [security] Update dependency moment to 2.29.4 [SECURITY] Dec 17, 2022
@renovate renovate bot changed the title Update dependency moment to 2.29.4 [SECURITY] chore(deps): update dependency moment to 2.29.4 [security] Dec 17, 2022
@renovate renovate bot force-pushed the renovate/npm-moment-vulnerability branch 3 times, most recently from 4f84e71 to 819b673 Compare January 2, 2023 15:14
@renovate renovate bot force-pushed the renovate/npm-moment-vulnerability branch 2 times, most recently from 625b8ea to 2e7e4ca Compare January 11, 2023 06:28
@renovate renovate bot force-pushed the renovate/npm-moment-vulnerability branch from 6b564fb to 470caee Compare October 20, 2023 21:25
@renovate renovate bot force-pushed the renovate/npm-moment-vulnerability branch 2 times, most recently from be088fb to e5901aa Compare November 1, 2023 05:43
@renovate renovate bot force-pushed the renovate/npm-moment-vulnerability branch 2 times, most recently from 25d28a8 to ac6237f Compare December 1, 2023 16:08
@renovate renovate bot force-pushed the renovate/npm-moment-vulnerability branch 4 times, most recently from 94e9921 to 65bcd83 Compare December 11, 2023 17:59
@renovate renovate bot force-pushed the renovate/npm-moment-vulnerability branch from 65bcd83 to c7a8ae6 Compare December 12, 2023 23:20
@renovate renovate bot force-pushed the renovate/npm-moment-vulnerability branch from c7a8ae6 to abb7962 Compare January 18, 2024 14:52
@renovate renovate bot force-pushed the renovate/npm-moment-vulnerability branch from abb7962 to 0ee834b Compare February 8, 2024 19:30
@renovate renovate bot force-pushed the renovate/npm-moment-vulnerability branch 2 times, most recently from 95c4ac5 to b0594ce Compare March 20, 2024 13:32
@renovate renovate bot enabled auto-merge (rebase) March 25, 2024 20:21
@renovate renovate bot force-pushed the renovate/npm-moment-vulnerability branch 2 times, most recently from c6b6dc7 to b142de1 Compare March 29, 2024 14:52
@renovate renovate bot force-pushed the renovate/npm-moment-vulnerability branch from b142de1 to 7d10dea Compare April 16, 2024 02:46
@renovate renovate bot force-pushed the renovate/npm-moment-vulnerability branch from 7d10dea to d35f56f Compare June 17, 2024 15:01
@renovate renovate bot force-pushed the renovate/npm-moment-vulnerability branch from d35f56f to 69f9235 Compare July 1, 2024 15:05
@renovate renovate bot force-pushed the renovate/npm-moment-vulnerability branch from 69f9235 to be484f9 Compare July 25, 2024 16:46
@renovate renovate bot force-pushed the renovate/npm-moment-vulnerability branch 2 times, most recently from 438a2a3 to 9f21c08 Compare August 6, 2024 17:30
@renovate renovate bot force-pushed the renovate/npm-moment-vulnerability branch from 9f21c08 to 5b2cc20 Compare August 9, 2024 15:31
@renovate renovate bot force-pushed the renovate/npm-moment-vulnerability branch from 5b2cc20 to da5e1d4 Compare August 15, 2024 13:16
@renovate renovate bot changed the title fix(deps): update dependency moment to v2.29.4 [security] fix(deps): update dependency moment to v2.29.4 [security] - autoclosed Aug 15, 2024
@renovate renovate bot closed this Aug 15, 2024
auto-merge was automatically disabled August 15, 2024 13:29

Pull request was closed

@renovate renovate bot deleted the renovate/npm-moment-vulnerability branch August 15, 2024 13:29
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.

0 participants