CVE-2022-24785Momentjs Moment
High 7.5 No auth needed
Follow: this CVE · Momentjs · Momentjs Moment We alert you by email or Slack (account required).
- Priority
- 60
- CVSS 3.1
- 7.5
- EPSS
- 2.7% probability of exploitation in 30 days · percentile 87
- Auth required
- No
- Published
- Apr 4, 2022
- Updated
- Jun 17, 2026
- Category
- Application · Cross-platform
- SSVC (CISA)
- Exploitation: none · Automatable: yes · Technical impact: partial
- Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
What happens
Moment.js is a JavaScript date library for parsing, validating, manipulating, and formatting dates. A path traversal vulnerability impacts npm (server) users of Moment.js between versions 1.0.1 and 2.29.1, especially if a user-provided locale string is directly used to switch moment locale. This problem is patched in 2.29.2, and the patch can be applied to all affected versions. As a workaround, sanitize the user-provided locale name before passing it to Moment.js.
What to do
- Apply the vendor's security update for Moment.
- It can be exploited without authentication: if you cannot patch now, restrict Internet access to the affected service.
Affected packages
| Ecosystem | Package | Affected versions | Fixed in | How to upgrade |
|---|---|---|---|---|
| NuGet | Moment.js |
< 2.29.2 |
2.29.2 |
dotnet add package Moment.js --version 2.29.2 |
| npm | moment |
< 2.29.2 |
2.29.2 |
npm install moment@2.29.2 |
Per OSV / GitHub Advisories (GHSA-8hfj-j24r-96c4). Check the version in your lockfile before upgrading.
Affected products (CPE)
| Vendor | Product | Versions |
|---|---|---|
| momentjs | moment | ≥ 1.0.1 < 2.29.2 |
| momentjs | moment | ≥ 1.0.1 < 2.29.2 |
| tenable | tenable.sc | < 5.21.0 |
| netapp | active_iq | all |
| fedoraproject | fedora | 35 |
| fedoraproject | fedora | 36 |
| debian | debian_linux | 10.0 |
Official sources
References
Links published by the sources. Open them with care.
- github.com Patch
- github.com Vendor Advisory
- lists.debian.org Mailing List Third Party Advisory
- lists.fedoraproject.org
- lists.fedoraproject.org
- security.netapp.com Third Party Advisory
- www.tenable.com Patch Release Notes Third Party Advisory
- security.netapp.com