# CVE-2022-31129: libjs-moment: moment is a JavaScript date library for parsing, validating, manipulating, and formatting dates

CVE-2022-31129 is fixed in 3 products on 1 platform, first by libjs-moment 2.20.1+ds-1ubuntu0.1, released July 6, 2022. It is not reported as exploited. Patch Radar priority: High.

- Web page: https://patchblox.com/security/cve/CVE-2022-31129
- Priority: High
- CVSS: 7.5 (Medium)
- EPSS: 0.0555
- CISA KEV: not listed
- Exploited (vendor report): no
- Publicly disclosed: no
- Published: Jul 6, 2022

## Description

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.

## Where it's fixed

| Platform | Product | Fixed in | Fix | Released |
|---|---|---|---|---|
| Linux | libjs-moment Ubuntu 18.04.6 LTS (bionic) | 2.20.1+ds-1ubuntu0.1 | [libjs-moment 2.20.1+ds-1ubuntu0.1](https://patchblox.com/security/data/fix/linux/ubuntu-bionic-libjs-moment-2.20.1-ds-1ubuntu0.1.md) | Jul 6, 2022 |
| Linux | libjs-moment Ubuntu 20.04 LTS (focal) | 2.24.0+ds-2ubuntu0.1 | [libjs-moment 2.24.0+ds-2ubuntu0.1](https://patchblox.com/security/data/fix/linux/ubuntu-focal-libjs-moment-2.24.0-ds-2ubuntu0.1.md) | Jul 6, 2022 |
| Linux | libjs-moment Ubuntu 22.04.1 LTS (jammy) | 2.29.1+ds-3ubuntu0.2 | [libjs-moment 2.29.1+ds-3ubuntu0.2](https://patchblox.com/security/data/fix/linux/ubuntu-jammy-libjs-moment-2.29.1-ds-3ubuntu0.2.md) | Jul 6, 2022 |
| Linux | node-moment Debian 12.15 (bookworm) | 2.29.4+ds-1 | [DEBIAN-CVE-2022-31129](https://patchblox.com/security/data/fix/linux/debian-cve-2022-31129.md) | Jul 6, 2022 |
| Linux | node-moment Debian 13.5 (trixie) | 2.29.4+ds-1 | [DEBIAN-CVE-2022-31129](https://patchblox.com/security/data/fix/linux/debian-cve-2022-31129.md) | Jul 6, 2022 |
| Linux | node-moment Debian 14 | 2.29.4+ds-1 | [DEBIAN-CVE-2022-31129](https://patchblox.com/security/data/fix/linux/debian-cve-2022-31129.md) | Jul 6, 2022 |
| Linux | node-moment Ubuntu 18.04.6 LTS (bionic) | 2.20.1+ds-1ubuntu0.1 | [node-moment 2.20.1+ds-1ubuntu0.1](https://patchblox.com/security/data/fix/linux/ubuntu-bionic-node-moment-2.20.1-ds-1ubuntu0.1.md) | Jul 6, 2022 |
| Linux | node-moment Ubuntu 20.04 LTS (focal) | 2.24.0+ds-2ubuntu0.1 | [node-moment 2.24.0+ds-2ubuntu0.1](https://patchblox.com/security/data/fix/linux/ubuntu-focal-node-moment-2.24.0-ds-2ubuntu0.1.md) | Jul 6, 2022 |
| Linux | node-moment Ubuntu 22.04.1 LTS (jammy) | 2.29.1+ds-3ubuntu0.2 | [node-moment 2.29.1+ds-3ubuntu0.2](https://patchblox.com/security/data/fix/linux/ubuntu-jammy-node-moment-2.29.1-ds-3ubuntu0.2.md) | Jul 6, 2022 |
| Linux | postfixadmin Ubuntu 22.04.1 LTS (jammy) | 3.3.10-2ubuntu0.1~esm1 | [postfixadmin 3.3.10-2ubuntu0.1~esm1](https://patchblox.com/security/data/fix/linux/ubuntu-jammy-postfixadmin-3.3.10-2ubuntu0.1-esm1.md) | Mar 28, 2023 |

---

Data as of 2026-11-08T06:59:42Z UTC. Source: Patchblox Patch Radar (https://patchblox.com/security/patch-radar). Patchblox finds out-of-date software on Windows, macOS and Linux and updates it through release rings: https://patchblox.com/demo

Free to use with attribution: show "Data: Patchblox Patch Radar" with a link to https://patchblox.com/security/patch-radar. Terms, including what needs a written agreement: https://patchblox.com/security/patch-radar/use-the-data

Product names, logos and trademarks shown on Patch Radar belong to their respective owners. They are used only to identify the software each security fix applies to and to help readers find their platform. Their use does not imply any affiliation with, or endorsement by, those owners, and Patchblox is not affiliated with any of them.
