moment is vulnerable to Path Traversal
59
Medium Risk
moment's locale loader guards against path traversal by calling match() on the locale name without first requiring that name to be a string. A non-string object whose match() satisfies the guard while its toString() or Symbol.toPrimitive returns a traversal path reaches Node's require('./locale/' + name), loading a module from a path the caller of moment.locale() chooses. Plain string locale names are unaffected because the existing validation rejects path separators in strings, so this reaches only server-side Node applications that pass externally influenced non-string values into moment.locale(), and it leaves CVE-2022-24785 incompletely fixed. The fix requires a canonical lowercase locale string before any dynamic require runs.
You are affected if you are using a version that falls within the vulnerable range and your application passes user-influenced non-string values directly to moment.locale().
moment is vulnerable to Path Traversal in versions 2.29.2 - 2.30.1.
Upgrade the moment library to the patch version.
Connect your repositories to instantly see whether vulnerable or malicious packages exist in your codebase.
Free. No credit card required.

I consent to receiving marketing communications based on Aikido’s Privacy Policy.
SOC 2Compliant
ISO 27001Compliant
ISO 42001Compliant© All Intel data is openly available and commercially licensed.