CVE Tools

CVE-2022-24785

Path Traversal in Moment.js

Published: Apr 4, 2022Updated: Nov 3, 2025 Sources: CVE List NVD GHSA BDUCWE-22

Description

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.

In plain language

AI Worth attention

Moment.js versions 1.0.1 through 2.29.1 can let an attacker manipulate server file paths through a supplied language setting, so businesses using it on servers should update.

Executive summary

CVE-2022-24785 is an unauthenticated path-traversal issue in server-side Moment.js locale loading when an application passes attacker-controlled locale strings to the library.

If affected, business impact
Server file path manipulationApplication behavior tamperingOperational disruption

What to do now

  1. Check your application dependencies and server-side code for Moment.js versions 1.0.1 through 2.29.1, especially where a visitor-supplied language or locale setting is used.
  2. Upgrade Moment.js to version 2.29.2 or later.
  3. If you use Tenable.sc, upgrade it to 5.21.0 or later; if you use RedCheck, update its scanning agent to 2.8.0 or later.
  4. Until Moment.js is updated, allow only known-safe locale names before passing them to the application.
npm install moment@^2.29.2
Patch / advisory Usually a quick update

CVSS Vector Breakdown

AV:NAC:LPR:NUI:NS:UC:NI:HA:N
Exploitability
AV:NAttack Vector
Network
AC:LAttack Complexity
Low
PR:NPrivileges Required
None
UI:NUser Interaction
None
Scope
S:UScope
Unchanged
Impact
C:NConfidentiality
None
I:HIntegrity
High
A:NAvailability
None

Weaknesses

Affected Products

and 4 more affected products View all →

Exploitability

Official Patch Available

Attack Graph

Products CVE Techniques Tactics

Click technique nodes for MITRE ATT&CK details · drag to pan · Ctrl/ + scroll to zoom, or go fullscreen.

MITRE ATT&CK

2 techniques
Collection
Discovery
View detailed technique mapping

References

and 14 more references View all →

Unlock Complete Vulnerability Intelligence

Get the full picture for CVE-2022-24785 and every CVE in our database. Create a free account — no credit card required.

Create Free Account
Plain-language analysis
Impact assessment and exploitation scenario in plain English
Attack graph visualization
Interactive attack path and kill chain mapping
Exploit details & PoC links
ExploitDB, Metasploit, GitHub PoCs with direct links
Nuclei scanner templates
Ready-to-use vulnerability scanner templates
Full remediation guide
Patch instructions, workarounds, and compliance impact
Interactive AI chat
Ask questions about this vulnerability in natural language
Related vulnerabilities
Semantically similar CVEs and attack patterns
REST API & MCP access
Integrate vulnerability data into your workflows

We use analytics cookies to see which pages and articles actually help people. Decline and none of them run — the site works the same. What we store