Npm · Moment.Js · CVE-2022-24785
**Name of the Vulnerable Software and Affected Versions**
Moment.js versions 1.0.1 through 2.29.1
**Description**
A path traversal vulnerability impacts npm (server) users of Moment.js, especially if a user-provided locale string is directly used to switch moment locale. This issue allows an unauthenticated attacker to provide a filesystem path as invalid input. The problem is patched in version 2.29.2.
**Recommendations**
For versions 1.0.1 through 2.29.1, update to version 2.29.2 to resolve the issue.
As a temporary workaround, sanitize the user-provided locale name before passing it to Moment.js.