{"id":5860,"date":"2025-08-04T10:03:36","date_gmt":"2025-08-04T10:03:36","guid":{"rendered":"https:\/\/serisec.com\/index.php\/2025\/08\/04\/nestjs-framework-vulnerability-let-attackers-execute-arbitrary-code-in-developers-machine\/"},"modified":"2025-08-04T10:03:36","modified_gmt":"2025-08-04T10:03:36","slug":"nestjs-framework-vulnerability-let-attackers-execute-arbitrary-code-in-developers-machine","status":"publish","type":"post","link":"https:\/\/serisec.com\/index.php\/2025\/08\/04\/nestjs-framework-vulnerability-let-attackers-execute-arbitrary-code-in-developers-machine\/","title":{"rendered":"NestJS Framework Vulnerability Let Attackers Execute Arbitrary Code in Developers Machine"},"content":{"rendered":"<p>    NestJS Framework Vulnerability Let Attackers Execute Arbitrary Code in Developers Machine<br \/>\n \t<BR><br \/>\n<BR><\/BR><br \/>\n    <!-- no image --><br \/>\n \t<BR><br \/>\n<BR><\/BR><\/p>\n<div>\n<p>A critical security vulnerability has been discovered in the NestJS framework\u2019s development tools that enables remote code execution (RCE) attacks against JavaScript developers.\u00a0<\/p>\n<p>The flaw, identified as CVE-2025-54782, affects the @nestjs\/devtools-integration package and allows malicious websites to execute arbitrary code on developers\u2019 local machines through sophisticated sandbox escape techniques.<\/p>\n<pre class=\"wp-block-preformatted\"><strong>Key Takeaways<\/strong><br>1. Critical RCE flaw in NestJS devtools allows code execution via malicious websites.<br>2. Caused by an unsafe JavaScript sandbox and poor CORS validation.<br>3. Immediate fix required.<\/pre>\n<p>The vulnerability disclosed carries a critical severity rating of 9.4 on the CVSS v4 scale, highlighting the immediate danger it poses to the development community.\u00a0<\/p>\n<p>NestJS, described as \u201ca progressive Node.js framework for building efficient and scalable server-side applications,\u201d has over 4,100 followers on GitHub and is widely used in enterprise-grade applications.<\/p>\n<h2 class=\"wp-block-heading\" id=\"h-nestjs-sandbox-rce-vulnerability\"><strong>NestJS Sandbox RCE Vulnerability<\/strong><\/h2>\n<p>The security flaw stems from the @nestjs\/devtools-integration package\u2019s HTTP endpoint \/inspector\/graph\/interact, which processes JSON input containing a code field and executes it within a Node.js vm.runInNewContext sandbox.\u00a0<\/p>\n<p>The vulnerable implementation closely resembles the abandoned safe-eval library and fails to provide adequate security controls.<\/p>\n<p>The problematic code includes a flawed sandbox implementation:<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/lh7-rt.googleusercontent.com\/docsz\/AD_4nXerJJqaloIPJyugRAoZweSJR2BGwQ4JNtMWq6QFY_DJ7ezemhxDV_wVqOZ5nWYRP3I6NWp9_ke8s5LA_ahmaM_jZoTkb9CwvyYH7OPpl_rdeFclEnFXuht3BKIUSBNyPgKM9n606Q?key=Z79mOPoZvC423R453Io8CA\" alt=\"\"><\/figure>\n<\/div>\n<p>The vulnerability is further compounded by inadequate Cross-Origin Resource Sharing (CORS) protections.\u00a0<\/p>\n<p>While the server sets Access-Control-Allow-Origin to https:\/\/devtools[.]nestjs.com, it fails to validate the request\u2019s Origin or Content-Type headers properly.\u00a0<\/p>\n<p>Attackers can exploit this weakness by crafting POST requests with text\/plain content type, effectively bypassing CORS preflight checks.<\/p>\n<figure class=\"wp-block-table\">\n<table class=\"has-fixed-layout\">\n<tbody>\n<tr>\n<td><strong>Risk Factors<\/strong><\/td>\n<td><strong>Details<\/strong><\/td>\n<\/tr>\n<tr>\n<td>Affected Products<\/td>\n<td>@nestjs\/devtools-integration package (npm)\u22640.2.0<\/td>\n<\/tr>\n<tr>\n<td>Impact<\/td>\n<td>Remote Code Execution (RCE)<\/td>\n<\/tr>\n<tr>\n<td>Exploit Prerequisites<\/td>\n<td>\u2013 Developer visits malicious website- NestJS devtools integration enabled- Development server running locally<\/td>\n<\/tr>\n<tr>\n<td>CVSS v4 Score<\/td>\n<td>9.4<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<p>Security researcher JLLeitschuh, working on behalf of Socket, <a href=\"https:\/\/github.com\/nestjs\/nest\/security\/advisories\/GHSA-85cg-cmq5-qjm7\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">demonstrated<\/a> the exploit using a simple HTML form that can trigger the vulnerability when a developer visits a malicious website.\u00a0<\/p>\n<p>The proof-of-concept payload leverages JavaScript\u2019s property enumeration to escape the <a href=\"https:\/\/cybersecuritynews.com\/tag\/sandbox-configuration\/\" target=\"_blank\" rel=\"noreferrer noopener\">sandbox<\/a> and gain access to Node.js\u2019s child_process module for arbitrary command execution.<\/p>\n<p>The NestJS maintainers have addressed this critical issue in version 0.2.1 by implementing a safer sandboxing alternative using @nyariv\/sandboxjs, adding proper origin validation, and introducing authentication mechanisms for devtools connections.\u00a0<\/p>\n<p>Developers using affected versions (\u22640.2.0) are strongly advised to upgrade immediately to mitigate the risk of remote code execution attacks against their development environments.<\/p>\n<p class=\"has-text-align-center has-background\" style=\"background:linear-gradient(180deg,rgb(238,238,238) 92%,rgb(169,184,195) 100%)\"><code><strong>Integrate <strong>ANY.RUN TI Lookup<\/strong> with your SIEM or SOAR To Analyses Advanced Threats<\/strong> -&gt; <strong><a href=\"https:\/\/intelligence.any.run\/plans?utm_source=csn_jul&amp;utm_medium=atricle&amp;utm_campaign=want-to-detect-incidents-before&amp;utm_content=plans1&amp;utm_term=290725\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">Try 50 Free Trial Searches<\/a> <\/strong><\/code><\/p>\n<p>The post <a href=\"https:\/\/cybersecuritynews.com\/nestjs-framework-vulnerability\/\">NestJS Framework Vulnerability Let Attackers Execute Arbitrary Code in Developers Machine<\/a> appeared first on <a href=\"https:\/\/cybersecuritynews.com\/\">Cyber Security News<\/a>.<\/p>\n<\/div>\n<p> \t<BR><br \/>\n <BR><\/BR><br \/>\n    Florence Nightingale<br \/>\n \t<BR><br \/>\n<BR><\/BR><br \/>\n<a href=\"https:\/\/cybersecuritynews.com\/nestjs-framework-vulnerability\/\">Go to cyber-security-news<\/a><br \/>\n \t<BR><br \/>\n <BR><\/BR><\/p>\n","protected":false},"excerpt":{"rendered":"<p>NestJS Framework Vulnerability Let Attackers Execute Arbitrary Code in Developers Machine A critical security vulnerability has been discovered in the NestJS framework\u2019s development tools that enables remote code execution (RCE) attacks against JavaScript developers.\u00a0 The flaw, identified as CVE-2025-54782, affects the @nestjs\/devtools-integration package and allows malicious websites to execute arbitrary code on developers\u2019 local machines [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[129,63,131,648],"tags":[130],"class_list":["post-5860","post","type-post","status-publish","format-standard","hentry","category-cyber-security","category-cyber-security-news","category-vulnerability","category-vulnerability-news","tag-cyber-security-news"],"_links":{"self":[{"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/posts\/5860"}],"collection":[{"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/comments?post=5860"}],"version-history":[{"count":0,"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/posts\/5860\/revisions"}],"wp:attachment":[{"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/media?parent=5860"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/categories?post=5860"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/tags?post=5860"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}