Vulnerability library
Security checkSeptember 29, 2026

moment vulnerable to Path Traversal via crafted non-string locale name

Understand the exposure, see the recommended fix, and check whether your own website has related weaknesses.

Medium severitynpmmoment

Check your website

Find this and other vulnerabilities with a free scan.

Your scan runs on your computer. No account required.

Description

moment before 2.31.0 is vulnerable to path traversal in moment.locale(). When an application passes a non-string, attacker-influenced value to moment.locale(), a specially crafted object can bypass the locale name validation and cause moment to load a file from an attacker-controlled path. This is a further bypass of the validation added in 2.

Recommendation

Update the moment package to the latest compatible version. Followings are version details:

  • Affected version(s): >= 2.29.2, < 2.31.0
  • Patched version(s): 2.31.0

References

Could your website be exposed too?

SmartScanner can check your website for moment vulnerable to Path Traversal via crafted non-string locale name and gives you actionable findings to investigate.

Start a free scan

Related Issues

See something that needs correcting? Let us knowUpdated September 29, 2026