{"id":11439,"date":"2025-07-24T12:23:58","date_gmt":"2025-07-24T05:23:58","guid":{"rendered":"https:\/\/infosec.new88088.net\/?p=11439"},"modified":"2026-06-25T09:59:17","modified_gmt":"2026-06-25T02:59:17","slug":"vulnerabilities-in-the-javascript-library-that-can-cause-applications-to-be-remotely-controlled","status":"publish","type":"post","link":"https:\/\/infosec.new88088.net\/en\/2025\/07\/24\/vulnerabilities-in-the-javascript-library-that-can-cause-applications-to-be-remotely-controlled\/","title":{"rendered":"Vulnerabilities in the JavaScript library that can cause applications to be remotely controlled"},"content":{"rendered":"<p><b>A vulnerability has been detected in a form-data library on npm. With the identifier CVE-2025-7783, this vulnerability affects millions of web applications and APIs using JavaScript\/Node.js globally, especially in backend systems, microservices and serverless.<\/b><\/p>\n<div style=\"text-align: center\"><a class=\"js-lbImage\" style=\"cursor: pointer\" href=\"https:\/\/whitehat.vn\/attachments\/1753343397127-png.17364\/\" target=\"_blank\" rel=\"noopener\" data-caption=\"&lt;h4&gt;1753343397127.png&lt;\/h4&gt;&lt;p&gt;&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;whitehat.vn&amp;#x2F;threads&amp;#x2F;lo-hong-trong-thu-vien-javascript-co-the-khien-ung-dung-bi-dieu-khien-tu-xa.18598&amp;#x2F;#post-44107&quot; class=&quot;js-lightboxCloser&quot;&gt;WhiteHat Team \u00b7 24&amp;#x2F;07&amp;#x2F;2025 l\u00fac 2:51 PM&lt;\/a&gt;&lt;\/p&gt;\" data-fancybox=\"lb-thread-18598\" data-lb-caption-extra-html=\"\" data-lb-sidebar-href=\"\"><img fetchpriority=\"high\" decoding=\"async\" class=\"bbImage\" title=\"1753343397127.png\" src=\"https:\/\/whitehat.vn\/data\/attachments\/17\/17699-906365c5e63eb2c059b034120907904b.jpg\" alt=\"1753343397127.png\" width=\"712\" height=\"400\" \/><\/a>\u200b<\/div>\n<p>The root cause comes from an insecure &#8220;boundary&#8221; generation in the &#8220;form_data.js&#8221; file, line 347:<\/p>\n<blockquote class=\"bbCodeBlock bbCodeBlock--expandable bbCodeBlock--quote js-expandWatch\">\n<div class=\"bbCodeBlock-content\">\n<div class=\"bbCodeBlock-expandContent js-expandContent\">boundary += Math.floor(Math.random() * 10).toString(16);<\/div>\n<div class=\"bbCodeBlock-expandLink js-expandLink\"><a role=\"button\">Click to expand&#8230;<\/a><\/div>\n<\/div>\n<\/blockquote>\n<p>This will create a boundary line between the data pieces in the multipart\/form-data form. The problem is that Math.random () is not random enough, it&#8217;s just a pseudorandom number generator (PRNG), so if the hacker observes some of the values generated from Math. random (), they can predict the next values, including the boundary.<\/p>\n<h4>How does the breach work?<\/h4>\n<ol>\n<li data-xf-list-type=\"ol\">The app uses form-data to send user data as &#8221; multipart\/form-data &#8221; (e. g., photos, registration forms, attachments, etc.).<\/li>\n<li data-xf-list-type=\"ol\">At the same time, the application accidentally reveals the Math.random() value, such as via a header such as &#8221; x-request-id &#8220;, &#8221; trace-id, &#8221; or debug log.<\/li>\n<li data-xf-list-type=\"ol\">The hacker observes these values, and calculates the internal state of the RNG.<\/li>\n<li data-xf-list-type=\"ol\">They use it to predict the boundary sequence in subsequent submissions.<\/li>\n<li data-xf-list-type=\"ol\">Then, create a malicious packet containing the correct boundary, add rogue parameters, inject malicious data into the internal system, and even illegally access backend APIs.<\/li>\n<\/ol>\n<h4>Extent of danger and scope of influence<\/h4>\n<ul>\n<li data-xf-list-type=\"ul\">Severity: &#8220;Critical&#8221; on CVSS v4 scale.<\/li>\n<li data-xf-list-type=\"ul\">Overwhelming influence: The versions affected include:\n<ul>\n<li data-xf-list-type=\"ul\">Under 2.5.4<\/li>\n<li data-xf-list-type=\"ul\">3.0.0 to 3.3<\/li>\n<li data-xf-list-type=\"ul\">4.0.0 to 4.1.3<\/li>\n<\/ul>\n<\/li>\n<li data-xf-list-type=\"ul\">Exploitation conditions are not too complicated if the application reveals random values.<\/li>\n<\/ul>\n<p>This error is similar to a recent problem in the Undici library, suggesting that this is not an isolated case but rather a common error trend in the use of Math.random() in JavaScript.<\/p>\n<h4>Recommended solutions for users:<\/h4>\n<ul>\n<li data-xf-list-type=\"ul\">Immediately update form &#8211; data packages on patched copies:\n<ul>\n<li data-xf-list-type=\"ul\">4.0.4, 3.0,4 or 2.5.4<\/li>\n<\/ul>\n<\/li>\n<li data-xf-list-type=\"ul\">Replace Math.random () with a secure random number generator, such as crypto.r RandomUUID () or crypto. randomBytes () in Node.js.<\/li>\n<li data-xf-list-type=\"ul\">Check the entire codebase to find and replace pieces of code using Math.random () in security functions (such as token, ID, authentication, etc.).<\/li>\n<li data-xf-list-type=\"ul\">Avoid disclosing internal information (such as a header containing trace id) if using PRNG.<\/li>\n<\/ul>\n<p>The CVE-2025-7783 bug again sounded a wake-up call to developers. As systems become more interconnected and complex, vulnerabilities as small as a single line of Math.random (), can also become &#8220;backdoor&#8221; for hackers to enter. Don&#8217;t let small details cost the system, security is never a chore.<\/p>\n<div style=\"text-align: right\"><b><i>According to Cyber Press<\/i><\/b>\u200b<\/div>\n<div style=\"text-align: right;margin-top: 16px\"><i>Theo: <a href=\"https:\/\/whitehat.vn\/threads\/lo-hong-trong-thu-vien-javascript-co-the-khien-ung-dung-bi-dieu-khien-tu-xa.18598\/\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/whitehat.vn\/threads\/lo-hong-trong-thu-vien-javascript-co-the-khien-ung-dung-bi-dieu-khien-tu-xa.18598\/<\/a><\/i><\/div>\n","protected":false},"excerpt":{"rendered":"<p>A vulnerability has been detected in a form-data library on npm. With the identifier CVE-2025-7783, this vulnerability affects millions of web applications and APIs using JavaScript\/Node.js globally, especially in backend systems, microservices and serverless. \u200b The root cause comes from an insecure &#8220;boundary&#8221; generation in the &#8220;form_data.js&#8221; file, line 347: boundary += Math.floor(Math.random() * 10).toString(16); [&hellip;]<\/p>\n","protected":false},"author":46,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[351],"tags":[],"class_list":["post-11439","post","type-post","status-publish","format-standard","hentry","category-news-announcements"],"_links":{"self":[{"href":"https:\/\/infosec.new88088.net\/wp-json\/wp\/v2\/posts\/11439","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/infosec.new88088.net\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/infosec.new88088.net\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/infosec.new88088.net\/wp-json\/wp\/v2\/users\/46"}],"replies":[{"embeddable":true,"href":"https:\/\/infosec.new88088.net\/wp-json\/wp\/v2\/comments?post=11439"}],"version-history":[{"count":1,"href":"https:\/\/infosec.new88088.net\/wp-json\/wp\/v2\/posts\/11439\/revisions"}],"predecessor-version":[{"id":11440,"href":"https:\/\/infosec.new88088.net\/wp-json\/wp\/v2\/posts\/11439\/revisions\/11440"}],"wp:attachment":[{"href":"https:\/\/infosec.new88088.net\/wp-json\/wp\/v2\/media?parent=11439"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/infosec.new88088.net\/wp-json\/wp\/v2\/categories?post=11439"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/infosec.new88088.net\/wp-json\/wp\/v2\/tags?post=11439"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}