Path Traversal Vulnerability in Moment.js Affects Server-Side npm Users
CVE-2026-17495
5.9MEDIUM
What is CVE-2026-17495?
A vulnerability in Moment.js allows attackers to exploit a path traversal issue when a non-string object is passed to the moment.locale() method. This could enable unauthorized access to the file system if user-provided input is not validated properly, particularly in server-side npm applications. Users are advised to upgrade to Moment.js version 2.31.0 or later to mitigate this issue. As a temporary measure, ensure that any input provided by users is strictly validated as a string before it reaches the moment.locale() method.
Affected Version(s)
moment 2.29.2 < 2.31.0
moment 2.31.0
