CVE-2022-24785
Path Traversal in Moment.js
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 attentionMoment.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.
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.
What to do now
- 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.
- Upgrade Moment.js to version 2.29.2 or later.
- 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.
- Until Moment.js is updated, allow only known-safe locale names before passing them to the application.
npm install moment@^2.29.2CVSS Vector Breakdown
AV:NAttack VectorAC:LAttack ComplexityPR:NPrivileges RequiredUI:NUser InteractionS:UScopeC:NConfidentialityI:HIntegrityA:NAvailabilityWeaknesses
Affected Products
Exploitability
Attack Graph
Click technique nodes for MITRE ATT&CK details · drag to pan · Ctrl/⌘ + scroll to zoom, or go fullscreen.
MITRE ATT&CK
2 techniquesReferences
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