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

chore(deps): update dependency moment [security] - autoclosed #840

Closed
wants to merge 1 commit into from

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Apr 25, 2022

Mend Renovate

This PR contains the following updates:

Package Change
moment 2.29.1 -> 2.29.4
moment 2.29.1 -> 2.29.2

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.


Configuration

📅 Schedule: Branch creation - "" in timezone Asia/Seoul, 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.

👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.


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

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

@renovate renovate bot force-pushed the renovate/npm-moment-vulnerability branch from f46214f to 75ed0d9 Compare April 25, 2022 00:26
@renovate renovate bot force-pushed the renovate/npm-moment-vulnerability branch from 75ed0d9 to 9a0aa1b Compare September 25, 2022 18:13
@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] Sep 25, 2022
@renovate renovate bot changed the title chore(deps): update dependency moment to 2.29.4 [security] chore(deps): update dependency moment to 2.29.4 [security] - autoclosed Mar 24, 2023
@renovate renovate bot closed this Mar 24, 2023
@renovate renovate bot deleted the renovate/npm-moment-vulnerability branch March 24, 2023 23:50
@renovate renovate bot changed the title chore(deps): update dependency moment to 2.29.4 [security] - autoclosed chore(deps): update dependency moment to 2.29.4 [security] Mar 25, 2023
@renovate renovate bot reopened this Mar 25, 2023
@renovate renovate bot restored the renovate/npm-moment-vulnerability branch March 25, 2023 06:10
@renovate renovate bot changed the title chore(deps): update dependency moment to 2.29.4 [security] chore(deps): update dependency moment to 2.29.4 [security] - autoclosed Mar 25, 2023
@renovate renovate bot closed this Mar 25, 2023
@renovate renovate bot deleted the renovate/npm-moment-vulnerability branch March 25, 2023 06:34
@renovate renovate bot changed the title chore(deps): update dependency moment to 2.29.4 [security] - autoclosed chore(deps): update dependency moment to 2.29.4 [security] Mar 25, 2023
@renovate renovate bot reopened this Mar 25, 2023
@renovate renovate bot restored the renovate/npm-moment-vulnerability branch March 25, 2023 09:57
@renovate renovate bot force-pushed the renovate/npm-moment-vulnerability branch 8 times, most recently from 3dc9df6 to 770247e Compare March 25, 2023 20:28
@renovate renovate bot changed the title chore(deps): update dependency moment to 2.29.4 [security] chore(deps): update dependency moment to 2.29.4 [security] - autoclosed Mar 26, 2023
@renovate renovate bot closed this Mar 26, 2023
@renovate renovate bot deleted the renovate/npm-moment-vulnerability branch March 26, 2023 18:15
@renovate renovate bot changed the title chore(deps): update dependency moment to 2.29.4 [security] - autoclosed chore(deps): update dependency moment to 2.29.4 [security] Mar 26, 2023
@renovate renovate bot reopened this Mar 26, 2023
@renovate renovate bot restored the renovate/npm-moment-vulnerability branch March 26, 2023 21:14
@renovate renovate bot force-pushed the renovate/npm-moment-vulnerability branch from 54c3307 to b641d41 Compare April 1, 2023 06:37
@renovate renovate bot changed the title chore(deps): update dependency moment to 2.29.4 [security] chore(deps): update dependency moment to 2.29.4 [security] - autoclosed Apr 3, 2023
@renovate renovate bot closed this Apr 3, 2023
@renovate renovate bot deleted the renovate/npm-moment-vulnerability branch April 3, 2023 11:15
@renovate renovate bot changed the title chore(deps): update dependency moment to 2.29.4 [security] - autoclosed chore(deps): update dependency moment to 2.29.4 [security] Apr 3, 2023
@renovate renovate bot reopened this Apr 3, 2023
@renovate renovate bot restored the renovate/npm-moment-vulnerability branch April 3, 2023 12:35
@renovate renovate bot force-pushed the renovate/npm-moment-vulnerability branch 2 times, most recently from 9f30b1c to 38b32f8 Compare April 3, 2023 19:43
@renovate renovate bot changed the title chore(deps): update dependency moment to 2.29.4 [security] chore(deps): update dependency moment to 2.29.4 [security] - autoclosed Apr 17, 2023
@renovate renovate bot closed this Apr 17, 2023
@renovate renovate bot deleted the renovate/npm-moment-vulnerability branch April 17, 2023 10:16
@renovate renovate bot changed the title chore(deps): update dependency moment to 2.29.4 [security] - autoclosed chore(deps): update dependency moment to 2.29.4 [security] Apr 18, 2023
@renovate renovate bot reopened this Apr 18, 2023
@renovate renovate bot restored the renovate/npm-moment-vulnerability branch April 18, 2023 13:59
@renovate renovate bot force-pushed the renovate/npm-moment-vulnerability branch from 38b32f8 to 076d706 Compare April 18, 2023 19:40
@renovate renovate bot changed the title chore(deps): update dependency moment to 2.29.4 [security] chore(deps): update dependency moment [security] May 3, 2023
@renovate renovate bot changed the title chore(deps): update dependency moment [security] chore(deps): update dependency moment [security] - autoclosed May 10, 2023
@renovate renovate bot closed this May 10, 2023
@renovate renovate bot deleted the renovate/npm-moment-vulnerability branch May 10, 2023 04:06
@renovate renovate bot changed the title chore(deps): update dependency moment [security] - autoclosed chore(deps): update dependency moment [security] May 10, 2023
@renovate renovate bot reopened this May 10, 2023
@renovate renovate bot restored the renovate/npm-moment-vulnerability branch May 10, 2023 05:45
@renovate renovate bot force-pushed the renovate/npm-moment-vulnerability branch 2 times, most recently from bd80cb4 to 48c6bd9 Compare May 10, 2023 06:10
@renovate renovate bot force-pushed the renovate/npm-moment-vulnerability branch from 48c6bd9 to 097402c Compare May 10, 2023 06:33
@renovate renovate bot changed the title chore(deps): update dependency moment [security] chore(deps): update dependency moment [security] - autoclosed May 28, 2023
@renovate renovate bot closed this May 28, 2023
@renovate renovate bot deleted the renovate/npm-moment-vulnerability branch May 28, 2023 09:58
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.

None yet

1 participant