---
id: CVE-2026-17495
title: >-
  moment is a JavaScript date library for parsing, validating, manipulating, and
  formatting dates
summary: >-
  moment is a JavaScript date library for parsing, validating, manipulating, and
  formatting dates. In versions 2.29.2 through 2.30.1, a specially crafted
  non-string object passed to moment.locale() can bypass the locale-name
  path-traversal…
severity: medium
cvss: 5.9
cvssVector: 'CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N'
cwe:
  - CWE-27
  - CWE-22
vendor: moment
product: moment
affected:
  - moment >= 2.29.2 < 2.31.0
published: '2026-09-15'
updated: '2026-09-16'
sourceUpdated: '2026-09-16T19:40:00.317'
source: NVD
sourceUrl: 'https://nvd.nist.gov/vuln/detail/CVE-2026-17495'
references:
  - url: 'https://cna.openjsf.org/security-advisories.html'
    label: ce714d77-add3-4f53-aff5-83d477b104bb
  - url: 'https://github.com/moment/moment/security/advisories/GHSA-4p3w-j4w9-5jqw'
    label: ce714d77-add3-4f53-aff5-83d477b104bb
  - url: >-
      https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-17495.json
  - url: 'https://access.redhat.com/security/cve/CVE-2026-17495'
  - url: 'https://bugzilla.redhat.com/show_bug.cgi?id=2533595'
  - url: 'https://www.cve.org/CVERecord?id=CVE-2026-17495'
  - url: 'https://nvd.nist.gov/vuln/detail/CVE-2026-17495'
tags:
  - nvd
  - cve.org
  - csaf
  - vex
  - red-hat
epss: 0.00357
epssPercentile: 0.26649
ssvc:
  exploitation: none
  automatable: 'no'
  technicalImpact: partial
  timestamp: '2026-09-15T17:49:29.629363Z'
ingestedAt: '2026-09-15T06:32:35.354Z'
---

## Overview

moment is a JavaScript date library for parsing, validating, manipulating, and formatting dates. In versions 2.29.2 through 2.30.1, a specially crafted non-string object passed to moment.locale() can bypass the locale-name path-traversal guard. The guard assumes the input is a string, so an object whose match() method satisfies the check while its toString() returns a traversal path reaches an internal require() call with attacker-controlled path segments. This is an incomplete fix for CVE-2022-24785 and primarily affects npm (server-side) users that pass user-provided input directly to moment.locale(). The issue is fixed in moment 2.31.0, and users should upgrade to 2.31.0 or later. As a workaround, validate that any user-supplied input is a string before passing it to moment.locale().

## Remediation

Refer to the linked advisories for vendor-supplied fixes and affected version ranges.

## Vendor advisories

- **Red Hat VEX** · Moderate · affected: Multicluster Engine for Kubernetes, OpenShift Pipelines, OpenShift Service Mesh 3, Red Hat 3scale API Management Platform 2, Red Hat Advanced Cluster Management for Kubernetes 2, Red Hat AMQ Broker 7, … · no fix planned: Multicluster Engine for Kubernetes, OpenShift Service Mesh 3, Red Hat 3scale API Management Platform 2, Red Hat Advanced Cluster Management for Kubernetes 2, … · updated 2026-09-15 · [vex](https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-17495.json)
