CVE-2022-24785: Path Traversal in Moment.js

Published Apr 4, 2022
·
Updated

### 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: * Open an issue in [moment repo](https://github.com/moment/moment)

Affected Software

21 affected componentsFixes available
redhat/servicemesh-prometheus<0:2.14.0-18.el8.1
0:2.14.0-18.el8.1
redhat/servicemesh-prometheus<0:2.23.0-9.el8
0:2.23.0-9.el8
redhat/ceph<2:16.2.10-94.el8c
2:16.2.10-94.el8c
redhat/eap7-hal-console<0:3.3.12-1.Final_redhat_00001.1.el8ea
0:3.3.12-1.Final_redhat_00001.1.el8ea
redhat/eap7-hal-console<0:3.3.12-1.Final_redhat_00001.1.el7ea
0:3.3.12-1.Final_redhat_00001.1.el7ea
redhat/rh-sso7-keycloak<0:18.0.6-1.redhat_00001.1.el7
0:18.0.6-1.redhat_00001.1.el7
redhat/rh-sso7-keycloak<0:18.0.6-1.redhat_00001.1.el8
0:18.0.6-1.redhat_00001.1.el8
redhat/rh-sso7-keycloak<0:18.0.6-1.redhat_00001.1.el9
0:18.0.6-1.redhat_00001.1.el9
nuget/Moment.js<2.29.2
2.29.2
npm/moment<2.29.2
2.29.2
debian/node-moment
2.29.1+ds-2+deb11u22.29.4+ds-1
Momentjs Moment Node.js>=1.0.1<2.29.2
Momentjs Moment Nuget>=1.0.1<2.29.2
Tenable Tenable.Sc<5.21.0
NetApp Active Iq
Fedoraproject Fedora=35
Fedoraproject Fedora=36
Debian Debian Linux=10.0
redhat/moment v<2.29.2
2.29.2
IBM Watson Studio on Cloud Pak for Data<=4.0
IBM Watson Studio on Cloud Pak for Data<=5.0

Remediation

Information

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

Event History

Apr 4, 2022
CVE Published
via MITRE·12:00 AM
Data Sourced
via MITRE·12:00 AM
DescriptionSeverityWeakness
Data Sourced
via NVD·05:15 PM
RemedyDescriptionSeverityWeaknessAffected Software
Advisory Published
09:25 PM
Apr 5, 2022
Data Sourced
via Red Hat·12:05 PM
DescriptionSeverityAffected Software
Jan 12, 2024
Data Sourced
via Launchpad·12:07 AM
Description
Sep 16, 2024
Data Sourced
via Ubuntu·02:37 AM
RemedyDescriptionSeverityAffected Software
Mar 12, 2026
Data Sourced
via IBM·12:00 AM
DescriptionAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is CVE-2022-24785?

CVE-2022-24785 is a path traversal vulnerability in Moment.js that impacts npm (server) users.

2

How does the path traversal vulnerability in Moment.js impact users?

The path traversal vulnerability in Moment.js impacts npm (server) users, especially if a user-provided locale string is directly used to switch moment locale.

3

What versions of Moment.js are affected by CVE-2022-24785?

Versions 1.0.1 to 2.29.1 of Moment.js are affected by CVE-2022-24785.

4

What is the severity of CVE-2022-24785?

CVE-2022-24785 has a severity level of high (7).

5

How can I fix the path traversal vulnerability in Moment.js?

To fix the path traversal vulnerability in Moment.js, update to version 2.29.2.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203