{"id":"UBUNTU-CVE-2022-24785","details":"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.","modified":"2026-02-04T02:47:00.696296Z","published":"2022-04-04T17:15:00Z","related":["USN-5559-1"],"upstream":["CVE-2022-24785"],"references":[{"type":"REPORT","url":"https://ubuntu.com/security/CVE-2022-24785"},{"type":"REPORT","url":"https://github.com/moment/moment/security/advisories/GHSA-8hfj-j24r-96c4"},{"type":"ADVISORY","url":"https://ubuntu.com/security/notices/USN-5559-1"},{"type":"REPORT","url":"https://www.cve.org/CVERecord?id=CVE-2022-24785"}],"affected":[{"package":{"name":"nikola","ecosystem":"Ubuntu:16.04:LTS","purl":"pkg:deb/ubuntu/nikola@7.6.4-1?arch=source&distro=xenial"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["7.6.0-3","7.6.4-1"],"ecosystem_specific":{"binaries":[{"binary_version":"7.6.4-1","binary_name":"nikola"}]},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2022/UBUNTU-CVE-2022-24785.json"}},{"package":{"name":"node-moment","ecosystem":"Ubuntu:Pro:16.04:LTS","purl":"pkg:deb/ubuntu/node-moment@2.11.0+ds-1ubuntu0.1~esm1?arch=source&distro=esm-apps/xenial"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["2.10.6+dfsg-1","2.11.0+ds-1","2.11.0+ds-1ubuntu0.1~esm1"],"ecosystem_specific":{"binaries":[{"binary_version":"2.11.0+ds-1ubuntu0.1~esm1","binary_name":"libjs-moment"},{"binary_version":"2.11.0+ds-1ubuntu0.1~esm1","binary_name":"node-moment"}]},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2022/UBUNTU-CVE-2022-24785.json"}},{"package":{"name":"node-moment","ecosystem":"Ubuntu:18.04:LTS","purl":"pkg:deb/ubuntu/node-moment@2.20.1+ds-1ubuntu0.1?arch=source&distro=bionic"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.20.1+ds-1ubuntu0.1"}]}],"versions":["2.18.1+ds-1","2.19.1+ds-1","2.19.2+ds-1","2.19.3+ds-1","2.19.4+ds-1","2.20.1+ds-1"],"ecosystem_specific":{"binaries":[{"binary_version":"2.20.1+ds-1ubuntu0.1","binary_name":"libjs-moment"},{"binary_version":"2.20.1+ds-1ubuntu0.1","binary_name":"node-moment"}],"availability":"No subscription required"},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2022/UBUNTU-CVE-2022-24785.json"}},{"package":{"name":"node-moment","ecosystem":"Ubuntu:20.04:LTS","purl":"pkg:deb/ubuntu/node-moment@2.24.0+ds-2ubuntu0.1?arch=source&distro=focal"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.24.0+ds-2ubuntu0.1"}]}],"versions":["2.24.0+ds-1","2.24.0+ds-2"],"ecosystem_specific":{"binaries":[{"binary_version":"2.24.0+ds-2ubuntu0.1","binary_name":"libjs-moment"},{"binary_version":"2.24.0+ds-2ubuntu0.1","binary_name":"node-moment"}],"availability":"No subscription required"},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2022/UBUNTU-CVE-2022-24785.json"}},{"package":{"name":"node-moment","ecosystem":"Ubuntu:22.04:LTS","purl":"pkg:deb/ubuntu/node-moment@2.29.1+ds-3ubuntu0.2?arch=source&distro=jammy"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.29.1+ds-3ubuntu0.2"}]}],"versions":["2.29.1+ds-2","2.29.1+ds-3"],"ecosystem_specific":{"binaries":[{"binary_version":"2.29.1+ds-3ubuntu0.2","binary_name":"libjs-moment"},{"binary_version":"2.29.1+ds-3ubuntu0.2","binary_name":"node-moment"}],"availability":"No subscription required"},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2022/UBUNTU-CVE-2022-24785.json"}}],"schema_version":"1.7.3","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N"},{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N"},{"type":"Ubuntu","score":"medium"}]}