Skip to content
Heist/ feed
Back to feed
HighFix available

node-moment — security advisory

Type: advisorySources: OSVAdvisory ID: DEBIAN-CVE-2022-31129

moment is a JavaScript date library for parsing, validating, manipulating, and formatting dates. Affected versions of moment were found to use an inefficient parsing algorithm. Specifically using string-to-date parsing in moment (more specifically rfc2822 parsing, which is tried by default) has quadratic (N^2) complexity on specific inputs. Users may notice a noticeable slowdown is observed with inputs above 10k characters. Users who pass user-provided strings without sanity length checks to moment constructor are vulnerable to (Re)DoS attacks. The problem is patched in 2.29.4, the patch can be applied to all affected versions with minimal tweaking. Users are advised to upgrade. Users unable to upgrade should consider limiting date lengths accepted from user input.

Products
node-moment
Affected versions
Not specified
Fixed versions
2.29.4+ds-1
CVEs
CVE-2022-31129
Confirmed fixed CVEs
Not specified
Updated in this feed
30 Oct 2026, 14:30 UTC · Revision 1

Source evidence

DEBIAN-CVE-2022-31129

core-osv · Original source

Published 6 Jul 2022, 18:15 UTC

moment is a JavaScript date library for parsing, validating, manipulating, and formatting dates. Affected versions of moment were found to use an inefficient parsing algorithm. Specifically using string-to-date parsing in moment (more specifically rfc2822 parsing, which is tried by default) has quadratic (N^2) complexity on specific inputs. Users may notice a noticeable slowdown is observed with inputs above 10k characters. Users who pass user-provided strings without sanity length checks to moment constructor are vulnerable to (Re)DoS attacks. The problem is patched in 2.29.4, the patch can be applied to all affected versions with minimal tweaking. Users are advised to upgrade. Users unable to upgrade should consider limiting date lengths accepted from user input.

osv:DEBIAN-CVE-2022-31129

node-moment

Fixed versions: 2.29.4+ds-1

node-moment

Fixed versions: 2.29.4+ds-1

node-moment

Fixed versions: 2.29.4+ds-1

Complete source record
{
  "id": "40c4488b940ae846ca3373aa45b0191759dd0b0680dcd6197550f2fb832f5fe9",
  "url": "https://osv.dev/vulnerability/DEBIAN-CVE-2022-31129",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "DEBIAN-CVE-2022-31129",
    "summary": "moment is a JavaScript date library for parsing, validating, manipulating, and formatting dates. Affected versions of moment were found to use an inefficient parsing algorithm. Specifically using string-to-date parsing in moment (more specifically rfc2822 parsing, which is tried by default) has quadratic (N^2) complexity on specific inputs. Users may notice a noticeable slowdown is observed with inputs above 10k characters. Users who pass user-provided strings without sanity length checks to moment constructor are vulnerable to (Re)DoS attacks. The problem is patched in 2.29.4, the patch can be applied to all affected versions with minimal tweaking. Users are advised to upgrade. Users unable to upgrade should consider limiting date lengths accepted from user input.",
    "evidence": "osv:DEBIAN-CVE-2022-31129",
    "products": [
      {
        "name": {
          "value": "node-moment",
          "evidence": "/affected/0/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "2.29.4+ds-1",
            "evidence": "/affected/0/ranges"
          }
        ],
        "affected_versions": []
      },
      {
        "name": {
          "value": "node-moment",
          "evidence": "/affected/1/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "2.29.4+ds-1",
            "evidence": "/affected/1/ranges"
          }
        ],
        "affected_versions": []
      },
      {
        "name": {
          "value": "node-moment",
          "evidence": "/affected/2/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "2.29.4+ds-1",
            "evidence": "/affected/2/ranges"
          }
        ],
        "affected_versions": []
      }
    ],
    "severity": "high",
    "structured": {
      "id": "DEBIAN-CVE-2022-31129",
      "aliases": [
        "DEBIAN-CVE-2022-31129"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "2.29.4+ds-1"
                }
              ]
            }
          ],
          "package": {
            "name": "node-moment",
            "purl": "pkg:deb/debian/node-moment?arch=source&distro=bookworm",
            "ecosystem": "Debian:12"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/debian-osv/debian-cve-osv/DEBIAN-CVE-2022-31129.json"
          },
          "ecosystem_specific": {
            "urgency": "not yet assigned"
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "2.29.4+ds-1"
                }
              ]
            }
          ],
          "package": {
            "name": "node-moment",
            "purl": "pkg:deb/debian/node-moment?arch=source&distro=trixie",
            "ecosystem": "Debian:13"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/debian-osv/debian-cve-osv/DEBIAN-CVE-2022-31129.json"
          },
          "ecosystem_specific": {
            "urgency": "not yet assigned"
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "2.29.4+ds-1"
                }
              ]
            }
          ],
          "package": {
            "name": "node-moment",
            "purl": "pkg:deb/debian/node-moment?arch=source&distro=forky",
            "ecosystem": "Debian:14"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/debian-osv/debian-cve-osv/DEBIAN-CVE-2022-31129.json"
          },
          "ecosystem_specific": {
            "urgency": "not yet assigned"
          }
        }
      ],
      "modified": "2026-10-15T08:00:13.192595870Z",
      "provider": "osv",
      "upstream": [
        "CVE-2022-31129"
      ],
      "references": [
        "https://security-tracker.debian.org/tracker/CVE-2022-31129"
      ]
    },
    "related_cves": [
      {
        "value": "CVE-2022-31129",
        "evidence": "/upstream"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 322392,
  "published_at": "2022-07-06T18:15:19.57+00:00"
}