CVE intelligence and bounded remediation
CVE-2022-24785 — Moment.js is a JavaScript date library for parsing, validating, manipulating, and formatting dates
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.
- Severity
- High
- CVSS
- 7.5 (3.1)
- Published
- 2022-04-04
- CISA KEV
- Not currently listed
- Ecosystem
- javascript/npm
- Weaknesses
- CWE-22, CWE-27
Affected products
- momentjs / moment
- tenable / tenable.sc
- netapp / active_iq
- fedoraproject / fedora / 35
- fedoraproject / fedora / 36
- debian / debian_linux / 10.0
Matched remediation archetype
Path traversal, unsafe upload, and file handling
This catalog composition supplies bounded fallback guidance. Explicitly reviewed curated workflows load with the complete record below.
Check exposure
- Trace untrusted filenames, archive entries, URLs, and path segments into read, write, include, extraction, and upload operations.
- Identify filesystem roots, mount permissions, symbolic-link behavior, archive handling, and whether uploaded content is web-accessible or executable.
- Review canonicalization and containment checks across supported operating systems and storage backends.
Remediate safely
- Generate server-side storage identifiers and resolve paths beneath a fixed root using filesystem-aware containment checks.
- Reject absolute, parent-relative, alternate-separator, device, link, and archive entries that escape the intended root.
- Store uploads outside executable or served paths, validate type and size, and use private atomic temporary files.
Authoritative sources
Complete CVE record and remediation plan
The detailed catalog view below loads this exact record, its source evidence, and the full seven-phase agentic change plan.