{"id":56502,"date":"2024-07-08T14:47:36","date_gmt":"2024-07-08T14:47:36","guid":{"rendered":"https:\/\/packetstormsecurity.com\/news\/view\/36079\/How-CVE-2022-24785-MomentJS-Path-Traversal-Works-Detailed-Exploit-Guide.html"},"modified":"2024-07-08T14:47:36","modified_gmt":"2024-07-08T14:47:36","slug":"how-cve-2022-24785-momentjs-path-traversal-works-detailed-exploit-guide","status":"publish","type":"post","link":"https:\/\/www.threatshub.org\/blog\/how-cve-2022-24785-momentjs-path-traversal-works-detailed-exploit-guide\/","title":{"rendered":"How CVE-2022-24785 MomentJS Path Traversal Works: Detailed Exploit Guide"},"content":{"rendered":"<h3 id=\"heading-cve-2022-24785\">CVE-2022-24785<\/h3>\n<h4 id=\"heading-description\">Description<\/h4>\n<p>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 <code>1.0.1<\/code> and <code>2.29.1<\/code>, especially if a user-provided locale string is directly used to switch moment locale. This problem is patched in <code>2.29.2<\/code>, 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.<\/p>\n<h3 id=\"heading-identifying-the-vulnerability\">Identifying the vulnerability<\/h3>\n<p>We decided to download an affected version of MomentJS locally via npm.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/cdn.hashnode.com\/res\/hashnode\/image\/upload\/v1720199756359\/f13f0e36-3cd1-489e-80f0-ff3f1822dc1e.png?auto=compress,format&amp;format=webp\" alt class=\"image--center mx-auto\"><\/p>\n<p>Inside of <code>Moment-JS\/node_modules\/moment\/src\/lib\/locale\/locales.js<\/code> there is a function named <code>loadLocale<\/code> which takes the value of <code>name<\/code>:<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/cdn.hashnode.com\/res\/hashnode\/image\/upload\/v1720200052536\/13a857c7-b754-4940-b214-09926f6c798d.png?auto=compress,format&amp;format=webp\" alt class=\"image--center mx-auto\"><\/p>\n<pre><code class=\"lang-javascript\"><span class=\"hljs-function\"><span class=\"hljs-keyword\">function<\/span> <span class=\"hljs-title\">loadLocale<\/span>(<span class=\"hljs-params\">name<\/span>) <\/span>{ <span class=\"hljs-keyword\">var<\/span> oldLocale = <span class=\"hljs-literal\">null<\/span>, aliasedRequire; <span class=\"hljs-keyword\">if<\/span> ( locales[name] === <span class=\"hljs-literal\">undefined<\/span> &amp;&amp; <span class=\"hljs-keyword\">typeof<\/span> <span class=\"hljs-built_in\">module<\/span> !== <span class=\"hljs-string\">'undefined'<\/span> &amp;&amp; <span class=\"hljs-built_in\">module<\/span> &amp;&amp; <span class=\"hljs-built_in\">module<\/span>.exports ) { <span class=\"hljs-keyword\">try<\/span> { oldLocale = globalLocale._abbr; aliasedRequire = <span class=\"hljs-built_in\">require<\/span>; aliasedRequire(<span class=\"hljs-string\">'.\/locale\/'<\/span> + name); getSetGlobalLocale(oldLocale); } <span class=\"hljs-keyword\">catch<\/span> (e) { locales[name] = <span class=\"hljs-literal\">null<\/span>; } } <span class=\"hljs-keyword\">return<\/span> locales[name];\n}\n<\/code><\/pre>\n<p>The issue occurs on line <code>14<\/code> where the <code>loadLocale()<\/code> function dynamically requires a module based on user input (<code>name<\/code>). <code>require()<\/code> is a Node.js function used to include and load modules or JavaScript files into a Node.js application.<\/p>\n<pre><code class=\"lang-javascript\">\n<span class=\"hljs-keyword\">const<\/span> aliasedRequire = <span class=\"hljs-built_in\">require<\/span>; aliasedRequire(<span class=\"hljs-string\">'.\/locale\/'<\/span> + name);\n<\/code><\/pre>\n<p>If we control the <code>name<\/code> parameter we could possibly pass a traversal based string:<\/p>\n<pre><code class=\"lang-javascript\">\n<span class=\"hljs-keyword\">const<\/span> name = <span class=\"hljs-string\">'..\/..\/someMaliciousModule'<\/span>; aliasedRequire(<span class=\"hljs-string\">'.\/locale\/'<\/span> + name);\n<\/code><\/pre>\n<p>This could load <code>.\/locale\/..\/..\/uploads\/someMaliciousModule<\/code>, potentially exposing sensitive files, or even leading to Remote Code Execution (RCE).<\/p>\n<h3 id=\"heading-proof-of-concept\">Proof of concept<\/h3>\n<p>We wrote a basic application which uses the vulnerable function to demonstrate the vulnerability. Below is the <code>app.js<\/code> code:<\/p>\n<pre><code class=\"lang-javascript\"><span class=\"hljs-keyword\">const<\/span> express = <span class=\"hljs-built_in\">require<\/span>(<span class=\"hljs-string\">'express'<\/span>);\n<span class=\"hljs-keyword\">const<\/span> moment = <span class=\"hljs-built_in\">require<\/span>(<span class=\"hljs-string\">'moment'<\/span>); <span class=\"hljs-keyword\">const<\/span> app = express();\n<span class=\"hljs-keyword\">const<\/span> port = <span class=\"hljs-number\">1337<\/span>; app.get(<span class=\"hljs-string\">'\/time'<\/span>, <span class=\"hljs-function\">(<span class=\"hljs-params\">req, res<\/span>) =&gt;<\/span> { <span class=\"hljs-keyword\">const<\/span> locale = req.query.locale || <span class=\"hljs-string\">'en'<\/span>; <span class=\"hljs-keyword\">const<\/span> currentTime = moment().locale(locale).format(<span class=\"hljs-string\">'LLLL'<\/span>); res.send(<span class=\"hljs-string\">`Current time (<span class=\"hljs-subst\">${locale}<\/span>): <span class=\"hljs-subst\">${currentTime}<\/span>`<\/span>);\n}); app.listen(port, <span class=\"hljs-function\">() =&gt;<\/span> { <span class=\"hljs-built_in\">console<\/span>.log(<span class=\"hljs-string\">`Server is running on http:\/\/localhost:<span class=\"hljs-subst\">${port}<\/span>`<\/span>);\n});\n<\/code><\/pre>\n<p>The application listens on <a target=\"_blank\" href=\"http:\/\/localhost:1337\" rel=\"noopener\"><code>localhost:1337<\/code><\/a> and has an endpoint <code>\/time<\/code> that accepts a query parameter <code>locale<\/code>. The application assigns the value of <code>req.query.locale<\/code> to the variable <code>locale<\/code>, defaulting to <code>'en'<\/code> if <code>req.query.locale<\/code> is not provided. For example, if the query string is <code>?locale=fr<\/code>, then <code>locale<\/code> would be <code>'fr'<\/code>. On the backend, the application dynamically loads a module corresponding to the specified locale using <code>aliasedRequire();<\/code><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/cdn.hashnode.com\/res\/hashnode\/image\/upload\/v1720202368365\/7985b528-ea44-41c5-94d3-034cc5d44263.png?auto=compress,format&amp;format=webp\" alt class=\"image--center mx-auto\"><\/p>\n<p>However, passing <code>?locale=..\/..\/..\/..\/..\/..\/..\/etc\/passwd<\/code> for example, does not work. When using <code>require()<\/code> in Node.js, it attempts to load JavaScript modules or files. If we were to pass a value like <code>..\/..\/..\/..\/..\/..\/etc\/passwd<\/code> to <code>require('.\/locale\/' + somevalue)<\/code>, Node.js would attempt to resolve this path relative to the current working directory of the application. However, Node.js does not directly read arbitrary files like <code>\/etc\/passwd<\/code> through <code>require()<\/code> because it expects modules or JavaScript files to load.<\/p>\n<p>Now, let&#8217;s assume the application has a file upload functionality which allows us to upload and store notes. We could use this to achieve RCE.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/cdn.hashnode.com\/res\/hashnode\/image\/upload\/v1720202918687\/04903adf-e8b2-43b9-bde9-049278d0ebd0.png?auto=compress,format&amp;format=webp\" alt class=\"image--center mx-auto\"><\/p>\n<p>The path traversal combined with the ability to upload a file even <code>.txt<\/code> or <code>note<\/code> (no extension) provides us with RCE due to <code>require();<\/code>.<\/p>\n<h3 id=\"heading-is-the-patch-secure\">Is the patch secure?<\/h3>\n<p>Let&#8217;s review the patch code for the latest version of Moment JS.<\/p>\n<p><code>npm install moment@latest<\/code><\/p>\n<pre><code class=\"lang-javascript\"><span class=\"hljs-function\"><span class=\"hljs-keyword\">function<\/span> <span class=\"hljs-title\">isLocaleNameSane<\/span>(<span class=\"hljs-params\">name<\/span>) <\/span>{ <span class=\"hljs-keyword\">return<\/span> !!(name &amp;&amp; name.match(<span class=\"hljs-string\">'^[^\/\\\\\\\\]*$'<\/span>));\n}\n<\/code><\/pre>\n<p>As of right now, there is no current way to bypass this regular expression. I&#8217;ve tried multiple techniques.<\/p>\n<h3 id=\"heading-credits\">Credits<\/h3>\n<p>This discovery was a joint effort between me and my good friend Isira Adithya. Below will be Isiras Twitter\/X, and his LinkedIn!<\/p>\n<p><a target=\"_blank\" href=\"https:\/\/x.com\/isira_adithya\" rel=\"noopener\">Twitter\/X<\/a><\/p>\n<p><a target=\"_blank\" href=\"https:\/\/www.linkedin.com\/in\/isiraadithya\/\" rel=\"noopener\">LinkedIn<\/a><\/p>\n<h3 id=\"heading-well-thats-all\">Well, that&#8217;s all.<\/h3>\n<p>Essentially, that&#8217;s all. It&#8217;s a very basic vulnerability! As far as I am aware, no one has covered a proof of concept for this vulnerability, so this is pretty cool for everyone to see.<\/p>\n<p>A Twitter\/X follow is always appreciated!<\/p>\n<p><a target=\"_blank\" href=\"https:\/\/twitter.com\/0SPwn\" rel=\"noopener\">Twitter\/X<\/a><\/p>\n<p>READ MORE <a href=\"https:\/\/packetstormsecurity.com\/news\/view\/36079\/How-CVE-2022-24785-MomentJS-Path-Traversal-Works-Detailed-Exploit-Guide.html\">HERE<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>READ MORE HERE&#8230;<\/p>\n","protected":false},"author":2,"featured_media":56503,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"colormag_page_layout":"default_layout","footnotes":""},"categories":[60],"tags":[968],"class_list":["post-56502","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-packet-storm","tag-headlineflaw"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How CVE-2022-24785 MomentJS Path Traversal Works: Detailed Exploit Guide 2026 | ThreatsHub Cybersecurity News<\/title>\n<meta name=\"description\" content=\"ThreatsHub Cybersecurity News | ThreatsHub.org | Cloud Security &amp; Cyber Threats Analysis Hub. 100% Free OSINT Threat Intelligent and Cybersecurity News.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.threatshub.org\/blog\/how-cve-2022-24785-momentjs-path-traversal-works-detailed-exploit-guide\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How CVE-2022-24785 MomentJS Path Traversal Works: Detailed Exploit Guide 2026 | ThreatsHub Cybersecurity News\" \/>\n<meta property=\"og:description\" content=\"ThreatsHub Cybersecurity News | ThreatsHub.org | Cloud Security &amp; Cyber Threats Analysis Hub. 100% Free OSINT Threat Intelligent and Cybersecurity News.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.threatshub.org\/blog\/how-cve-2022-24785-momentjs-path-traversal-works-detailed-exploit-guide\/\" \/>\n<meta property=\"og:site_name\" content=\"ThreatsHub Cybersecurity News\" \/>\n<meta property=\"article:published_time\" content=\"2024-07-08T14:47:36+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cdn.hashnode.com\/res\/hashnode\/image\/upload\/v1720199756359\/f13f0e36-3cd1-489e-80f0-ff3f1822dc1e.png?auto=compress,format&amp;format=webp\" \/>\n<meta name=\"author\" content=\"TH Author\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@threatshub\" \/>\n<meta name=\"twitter:site\" content=\"@threatshub\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"TH Author\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/how-cve-2022-24785-momentjs-path-traversal-works-detailed-exploit-guide\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/how-cve-2022-24785-momentjs-path-traversal-works-detailed-exploit-guide\\\/\"},\"author\":{\"name\":\"TH Author\",\"@id\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/#\\\/schema\\\/person\\\/12e0a8671ff89a863584f193e7062476\"},\"headline\":\"How CVE-2022-24785 MomentJS Path Traversal Works: Detailed Exploit Guide\",\"datePublished\":\"2024-07-08T14:47:36+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/how-cve-2022-24785-momentjs-path-traversal-works-detailed-exploit-guide\\\/\"},\"wordCount\":475,\"publisher\":{\"@id\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/how-cve-2022-24785-momentjs-path-traversal-works-detailed-exploit-guide\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/07\\\/how-cve-2022-24785-momentjs-path-traversal-works-detailed-exploit-guide.jpg\",\"keywords\":[\"headline,flaw\"],\"articleSection\":[\"Packet Storm\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/how-cve-2022-24785-momentjs-path-traversal-works-detailed-exploit-guide\\\/\",\"url\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/how-cve-2022-24785-momentjs-path-traversal-works-detailed-exploit-guide\\\/\",\"name\":\"How CVE-2022-24785 MomentJS Path Traversal Works: Detailed Exploit Guide 2026 | ThreatsHub Cybersecurity News\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/how-cve-2022-24785-momentjs-path-traversal-works-detailed-exploit-guide\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/how-cve-2022-24785-momentjs-path-traversal-works-detailed-exploit-guide\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/07\\\/how-cve-2022-24785-momentjs-path-traversal-works-detailed-exploit-guide.jpg\",\"datePublished\":\"2024-07-08T14:47:36+00:00\",\"description\":\"ThreatsHub Cybersecurity News | ThreatsHub.org | Cloud Security & Cyber Threats Analysis Hub. 100% Free OSINT Threat Intelligent and Cybersecurity News.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/how-cve-2022-24785-momentjs-path-traversal-works-detailed-exploit-guide\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/how-cve-2022-24785-momentjs-path-traversal-works-detailed-exploit-guide\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/how-cve-2022-24785-momentjs-path-traversal-works-detailed-exploit-guide\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/07\\\/how-cve-2022-24785-momentjs-path-traversal-works-detailed-exploit-guide.jpg\",\"contentUrl\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/07\\\/how-cve-2022-24785-momentjs-path-traversal-works-detailed-exploit-guide.jpg\",\"width\":1156,\"height\":611},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/how-cve-2022-24785-momentjs-path-traversal-works-detailed-exploit-guide\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"headline,flaw\",\"item\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/tag\\\/headlineflaw\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"How CVE-2022-24785 MomentJS Path Traversal Works: Detailed Exploit Guide\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/\",\"name\":\"ThreatsHub Cybersecurity News\",\"description\":\"%%focuskw%% Threat Intel \u2013 Threat Intel Services \u2013 CyberIntelligence \u2013 Cyber Threat Intelligence - Threat Intelligence Feeds - Threat Intelligence Reports - CyberSecurity Report \u2013 Cyber Security PDF \u2013 Cybersecurity Trends - Cloud Sandbox \u2013- Threat IntelligencePortal \u2013 Incident Response \u2013 Threat Hunting \u2013 IOC - Yara - Security Operations Center \u2013 SecurityOperation Center \u2013 Security SOC \u2013 SOC Services - Advanced Threat - Threat Detection - TargetedAttack \u2013 APT \u2013 Anti-APT \u2013 Advanced Protection \u2013 Cyber Security Services \u2013 Cybersecurity Services -Threat Intelligence Platform\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/#organization\"},\"alternateName\":\"Threatshub.org\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/#organization\",\"name\":\"ThreatsHub.org\",\"alternateName\":\"Threatshub.org\",\"url\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/05\\\/Threatshub_Favicon1.jpg\",\"contentUrl\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/05\\\/Threatshub_Favicon1.jpg\",\"width\":432,\"height\":435,\"caption\":\"ThreatsHub.org\"},\"image\":{\"@id\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/x.com\\\/threatshub\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/#\\\/schema\\\/person\\\/12e0a8671ff89a863584f193e7062476\",\"name\":\"TH Author\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/066276f086d5155df79c850206a779ad368418a844da0182ce43f9cd5b506c3d?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/066276f086d5155df79c850206a779ad368418a844da0182ce43f9cd5b506c3d?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/066276f086d5155df79c850206a779ad368418a844da0182ce43f9cd5b506c3d?s=96&d=mm&r=g\",\"caption\":\"TH Author\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How CVE-2022-24785 MomentJS Path Traversal Works: Detailed Exploit Guide 2026 | ThreatsHub Cybersecurity News","description":"ThreatsHub Cybersecurity News | ThreatsHub.org | Cloud Security & Cyber Threats Analysis Hub. 100% Free OSINT Threat Intelligent and Cybersecurity News.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.threatshub.org\/blog\/how-cve-2022-24785-momentjs-path-traversal-works-detailed-exploit-guide\/","og_locale":"en_US","og_type":"article","og_title":"How CVE-2022-24785 MomentJS Path Traversal Works: Detailed Exploit Guide 2026 | ThreatsHub Cybersecurity News","og_description":"ThreatsHub Cybersecurity News | ThreatsHub.org | Cloud Security & Cyber Threats Analysis Hub. 100% Free OSINT Threat Intelligent and Cybersecurity News.","og_url":"https:\/\/www.threatshub.org\/blog\/how-cve-2022-24785-momentjs-path-traversal-works-detailed-exploit-guide\/","og_site_name":"ThreatsHub Cybersecurity News","article_published_time":"2024-07-08T14:47:36+00:00","og_image":[{"url":"https:\/\/cdn.hashnode.com\/res\/hashnode\/image\/upload\/v1720199756359\/f13f0e36-3cd1-489e-80f0-ff3f1822dc1e.png?auto=compress,format&amp;format=webp","type":"","width":"","height":""}],"author":"TH Author","twitter_card":"summary_large_image","twitter_creator":"@threatshub","twitter_site":"@threatshub","twitter_misc":{"Written by":"TH Author","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.threatshub.org\/blog\/how-cve-2022-24785-momentjs-path-traversal-works-detailed-exploit-guide\/#article","isPartOf":{"@id":"https:\/\/www.threatshub.org\/blog\/how-cve-2022-24785-momentjs-path-traversal-works-detailed-exploit-guide\/"},"author":{"name":"TH Author","@id":"https:\/\/www.threatshub.org\/blog\/#\/schema\/person\/12e0a8671ff89a863584f193e7062476"},"headline":"How CVE-2022-24785 MomentJS Path Traversal Works: Detailed Exploit Guide","datePublished":"2024-07-08T14:47:36+00:00","mainEntityOfPage":{"@id":"https:\/\/www.threatshub.org\/blog\/how-cve-2022-24785-momentjs-path-traversal-works-detailed-exploit-guide\/"},"wordCount":475,"publisher":{"@id":"https:\/\/www.threatshub.org\/blog\/#organization"},"image":{"@id":"https:\/\/www.threatshub.org\/blog\/how-cve-2022-24785-momentjs-path-traversal-works-detailed-exploit-guide\/#primaryimage"},"thumbnailUrl":"https:\/\/www.threatshub.org\/blog\/coredata\/uploads\/2024\/07\/how-cve-2022-24785-momentjs-path-traversal-works-detailed-exploit-guide.jpg","keywords":["headline,flaw"],"articleSection":["Packet Storm"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.threatshub.org\/blog\/how-cve-2022-24785-momentjs-path-traversal-works-detailed-exploit-guide\/","url":"https:\/\/www.threatshub.org\/blog\/how-cve-2022-24785-momentjs-path-traversal-works-detailed-exploit-guide\/","name":"How CVE-2022-24785 MomentJS Path Traversal Works: Detailed Exploit Guide 2026 | ThreatsHub Cybersecurity News","isPartOf":{"@id":"https:\/\/www.threatshub.org\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.threatshub.org\/blog\/how-cve-2022-24785-momentjs-path-traversal-works-detailed-exploit-guide\/#primaryimage"},"image":{"@id":"https:\/\/www.threatshub.org\/blog\/how-cve-2022-24785-momentjs-path-traversal-works-detailed-exploit-guide\/#primaryimage"},"thumbnailUrl":"https:\/\/www.threatshub.org\/blog\/coredata\/uploads\/2024\/07\/how-cve-2022-24785-momentjs-path-traversal-works-detailed-exploit-guide.jpg","datePublished":"2024-07-08T14:47:36+00:00","description":"ThreatsHub Cybersecurity News | ThreatsHub.org | Cloud Security & Cyber Threats Analysis Hub. 100% Free OSINT Threat Intelligent and Cybersecurity News.","breadcrumb":{"@id":"https:\/\/www.threatshub.org\/blog\/how-cve-2022-24785-momentjs-path-traversal-works-detailed-exploit-guide\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.threatshub.org\/blog\/how-cve-2022-24785-momentjs-path-traversal-works-detailed-exploit-guide\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.threatshub.org\/blog\/how-cve-2022-24785-momentjs-path-traversal-works-detailed-exploit-guide\/#primaryimage","url":"https:\/\/www.threatshub.org\/blog\/coredata\/uploads\/2024\/07\/how-cve-2022-24785-momentjs-path-traversal-works-detailed-exploit-guide.jpg","contentUrl":"https:\/\/www.threatshub.org\/blog\/coredata\/uploads\/2024\/07\/how-cve-2022-24785-momentjs-path-traversal-works-detailed-exploit-guide.jpg","width":1156,"height":611},{"@type":"BreadcrumbList","@id":"https:\/\/www.threatshub.org\/blog\/how-cve-2022-24785-momentjs-path-traversal-works-detailed-exploit-guide\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.threatshub.org\/blog\/"},{"@type":"ListItem","position":2,"name":"headline,flaw","item":"https:\/\/www.threatshub.org\/blog\/tag\/headlineflaw\/"},{"@type":"ListItem","position":3,"name":"How CVE-2022-24785 MomentJS Path Traversal Works: Detailed Exploit Guide"}]},{"@type":"WebSite","@id":"https:\/\/www.threatshub.org\/blog\/#website","url":"https:\/\/www.threatshub.org\/blog\/","name":"ThreatsHub Cybersecurity News","description":"%%focuskw%% Threat Intel \u2013 Threat Intel Services \u2013 CyberIntelligence \u2013 Cyber Threat Intelligence - Threat Intelligence Feeds - Threat Intelligence Reports - CyberSecurity Report \u2013 Cyber Security PDF \u2013 Cybersecurity Trends - Cloud Sandbox \u2013- Threat IntelligencePortal \u2013 Incident Response \u2013 Threat Hunting \u2013 IOC - Yara - Security Operations Center \u2013 SecurityOperation Center \u2013 Security SOC \u2013 SOC Services - Advanced Threat - Threat Detection - TargetedAttack \u2013 APT \u2013 Anti-APT \u2013 Advanced Protection \u2013 Cyber Security Services \u2013 Cybersecurity Services -Threat Intelligence Platform","publisher":{"@id":"https:\/\/www.threatshub.org\/blog\/#organization"},"alternateName":"Threatshub.org","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.threatshub.org\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.threatshub.org\/blog\/#organization","name":"ThreatsHub.org","alternateName":"Threatshub.org","url":"https:\/\/www.threatshub.org\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.threatshub.org\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.threatshub.org\/blog\/coredata\/uploads\/2025\/05\/Threatshub_Favicon1.jpg","contentUrl":"https:\/\/www.threatshub.org\/blog\/coredata\/uploads\/2025\/05\/Threatshub_Favicon1.jpg","width":432,"height":435,"caption":"ThreatsHub.org"},"image":{"@id":"https:\/\/www.threatshub.org\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/threatshub"]},{"@type":"Person","@id":"https:\/\/www.threatshub.org\/blog\/#\/schema\/person\/12e0a8671ff89a863584f193e7062476","name":"TH Author","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/066276f086d5155df79c850206a779ad368418a844da0182ce43f9cd5b506c3d?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/066276f086d5155df79c850206a779ad368418a844da0182ce43f9cd5b506c3d?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/066276f086d5155df79c850206a779ad368418a844da0182ce43f9cd5b506c3d?s=96&d=mm&r=g","caption":"TH Author"}}]}},"_links":{"self":[{"href":"https:\/\/www.threatshub.org\/blog\/wp-json\/wp\/v2\/posts\/56502","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.threatshub.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.threatshub.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.threatshub.org\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.threatshub.org\/blog\/wp-json\/wp\/v2\/comments?post=56502"}],"version-history":[{"count":0,"href":"https:\/\/www.threatshub.org\/blog\/wp-json\/wp\/v2\/posts\/56502\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.threatshub.org\/blog\/wp-json\/wp\/v2\/media\/56503"}],"wp:attachment":[{"href":"https:\/\/www.threatshub.org\/blog\/wp-json\/wp\/v2\/media?parent=56502"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.threatshub.org\/blog\/wp-json\/wp\/v2\/categories?post=56502"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.threatshub.org\/blog\/wp-json\/wp\/v2\/tags?post=56502"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}