{"id":74632,"date":"2025-09-13T14:02:54","date_gmt":"2025-09-13T14:02:54","guid":{"rendered":""},"modified":"2025-09-29T02:50:16","modified_gmt":"2025-09-29T08:50:16","slug":"cve-2025-57285-critical-command-injection-vulnerability-in-codeceptjs-3-7-3","status":"publish","type":"post","link":"https:\/\/www.ameeba.com\/blog\/cve-2025-57285-critical-command-injection-vulnerability-in-codeceptjs-3-7-3\/","title":{"rendered":"<strong>CVE-2025-57285: Critical Command Injection Vulnerability in CodeceptJS 3.7.3<\/strong>"},"content":{"rendered":"<p><strong>Overview<\/strong><\/p>\n<p>In this blog post, we delve into the details of a critical vulnerability that has been identified in CodeceptJS version 3.7.3, more specifically in the emptyFolder function (lib\/utils.js). This vulnerability, known as CVE-2025-57285, can potentially compromise systems or lead to data leakage. It is of paramount importance to developers, system administrators, and cybersecurity professionals who use or <a href=\"https:\/\/www.ameeba.com\/blog\/cve-2025-56216-sql-injection-vulnerability-in-phpgurukul-hospital-management-system-4-0\/\"  data-wpil-monitor-id=\"85952\">manage systems<\/a> that run on CodeceptJS 3.7.3. A low barrier to exploitation and a high <a href=\"https:\/\/www.ameeba.com\/blog\/cve-2025-30403-heap-buffer-overflow-vulnerability-in-mvfst-impacts-quic-sessions\/\"  data-wpil-monitor-id=\"82312\">impact make this vulnerability<\/a> a significant threat that requires immediate attention.<\/p>\n<p><strong>Vulnerability Summary<\/strong><\/p>\n<p>CVE ID: CVE-2025-57285<br \/>\nSeverity: Critical (9.8 CVSS Score)<br \/>\nAttack Vector: Network<br \/>\nPrivileges Required: None<br \/>\nUser Interaction: None<br \/>\nImpact: <a href=\"https:\/\/www.ameeba.com\/blog\/cve-2025-22404-potential-system-compromise-due-to-use-after-free-vulnerability\/\"  data-wpil-monitor-id=\"85646\">System Compromise<\/a> and Data Leakage<\/p>\n<p><strong>Affected Products<\/strong><\/p><div id=\"ameeb-3059421051\" class=\"ameeb-content-2 ameeb-entity-placement\"><div style=\"border-left: 4px solid #555; padding-left: 20px; margin: 48px 0; font-family: Roboto, sans-serif; color: #ffffff; line-height: 1.6; max-width: 700px;\">\r\n  <h2 style=\"margin-top: 0; font-size: 20px; font-weight: 600; display: flex; align-items: center;\">\r\n    <a href=\"https:\/\/www.ameeba.com\/chat\" style=\"display: inline-flex; align-items: center; margin-right: 8px;\">\r\n      <img decoding=\"async\" src=\"https:\/\/www.ameeba.com\/blog\/wp-content\/uploads\/2025\/10\/Best-App-icon-Ameeba.png\" alt=\"Ameeba Chat Icon\" style=\"width: 40px; height: 40px;\" \/>\r\n    <\/a>\r\n    A new way to communicate\r\n  <\/h2>\r\n\r\n  <p style=\"margin-bottom: 12px;\">\r\n    Ameeba Chat is built on encrypted identity, not personal profiles.\r\n  <\/p>\r\n\r\n  <p style=\"margin-bottom: 16px;\">\r\n    Message, call, share files, and coordinate with identities kept separate.\r\n  <\/p>\r\n\r\n  <ul style=\"list-style: none; padding-left: 0; margin-bottom: 20px;\">\r\n    <li>\u2022 Encrypted identity<\/li>\r\n    <li>\u2022 Ameeba Chat authenticates access<\/li>\r\n    <li>\u2022 Aliases and categories<\/li>\r\n    <li>\u2022 End-to-end encrypted chat, calls, and files<\/li>\r\n    <li>\u2022 Secure notes for sensitive information<\/li>\r\n  <\/ul>\r\n\r\n  <p style=\"font-style: italic; font-weight: 600; margin-bottom: 24px;\">\r\n    Private communication, rethought.\r\n  <\/p>\r\n\r\n  <div style=\"display: flex; flex-wrap: wrap; gap: 12px;\">\r\n    <a href=\"https:\/\/www.ameeba.com\/chat\/download\" style=\"background-color: #ffffff; color: #000000; padding: 10px 20px; text-decoration: none; border-radius: 6px; font-weight: 500;\">Download Ameeba Chat<\/a>\r\n    <a href=\"https:\/\/www.ameeba.com\/chat\" style=\"border: 1px solid #ffffff; color: #ffffff; padding: 10px 20px; text-decoration: none; border-radius: 6px; font-weight: 500;\">Learn More<\/a>\r\n  <\/div>\r\n<\/div>\r\n<\/div>\n<p>Product | Affected Versions<\/p>\n<p>CodeceptJS | 3.7.3<\/p>\n<p><strong>How the Exploit Works<\/strong><\/p>\n<p>The <a href=\"https:\/\/www.ameeba.com\/blog\/cve-2025-43984-unauthenticated-command-execution-vulnerability-in-kuwfi-gc111-devices\/\"  data-wpil-monitor-id=\"82400\">vulnerability is a result of the execSync command<\/a> in the emptyFolder function directly concatenating the user-controlled directoryPath parameter without any form of sanitization or escaping. This permits an attacker to inject <a href=\"https:\/\/www.ameeba.com\/blog\/cve-2025-27128-arbitrary-code-execution-vulnerability-in-openharmony-v5-0-3\/\"  data-wpil-monitor-id=\"82208\">arbitrary commands that the system then executes<\/a>. By exploiting this vulnerability, an attacker can manipulate the application and the system it resides on, giving the attacker the <a href=\"https:\/\/www.ameeba.com\/blog\/cve-2022-45134-critical-vulnerability-in-mahara-leading-to-potential-system-compromise\/\"  data-wpil-monitor-id=\"82883\">potential ability to compromise the system<\/a> or leak sensitive data.<\/p>\n<p><strong>Conceptual Example Code<\/strong><\/p><div id=\"ameeb-3802442285\" class=\"ameeb-content ameeb-entity-placement\"><div class=\"poptin-embedded\" data-id=\"f6b387694f681\"><\/div>\r\n\r\n\r\n\r\n\r\n\r\n<\/div>\n<p>Below is a conceptual example of how this vulnerability might be exploited. To illustrate, an attacker could provide a shell command as the directoryPath parameter:<\/p>\n<pre><code class=\"\" data-line=\"\">const CodeceptJS = require(&#039;CodeceptJS&#039;);\nconst directoryPath = &#039;any_directory; rm -rf \/&#039;; \/\/ The injected command that deletes all files in the root directory\nCodeceptJS.emptyFolder(directoryPath);<\/code><\/pre>\n<p>In this example, the command injection <a href=\"https:\/\/www.ameeba.com\/blog\/cve-2025-49036-php-remote-file-inclusion-vulnerability-in-premium-addons-for-kingcomposer\/\"  data-wpil-monitor-id=\"82186\">vulnerability is exploited to delete all files<\/a> in the root directory of the server where the CodeceptJS application is running. This is a conceptual demonstration and the actual exploitation may vary based on the specific application context and <a href=\"https:\/\/www.ameeba.com\/blog\/cve-2022-43110-critical-unauthenticated-remote-system-configuration-vulnerability-in-voltronic-power-viewpower-powershield-netguard\/\"  data-wpil-monitor-id=\"83108\">system configuration<\/a>.<br \/>\nRemember, it is crucial to apply the vendor patch as soon as <a href=\"https:\/\/www.ameeba.com\/blog\/cve-2025-54742-data-deserialization-vulnerability-in-wpevently-leading-to-possible-system-compromise\/\"  data-wpil-monitor-id=\"86418\">possible to mitigate this vulnerability<\/a>. If a patch is not immediately available, using a Web Application Firewall (WAF) or Intrusion Detection System (IDS) can serve as temporary mitigation.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Overview In this blog post, we delve into the details of a critical vulnerability that has been identified in CodeceptJS version 3.7.3, more specifically in the emptyFolder function (lib\/utils.js). This vulnerability, known as CVE-2025-57285, can potentially compromise systems or lead to data leakage. It is of paramount importance to developers, system administrators, and cybersecurity professionals [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"footnotes":""},"categories":[1],"tags":[],"vendor":[],"product":[],"attack_vector":[78],"asset_type":[],"severity":[],"exploit_status":[],"class_list":["post-74632","post","type-post","status-publish","format-standard","hentry","category-uncategorized","attack_vector-injection"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.ameeba.com\/blog\/wp-json\/wp\/v2\/posts\/74632","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ameeba.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ameeba.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ameeba.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ameeba.com\/blog\/wp-json\/wp\/v2\/comments?post=74632"}],"version-history":[{"count":9,"href":"https:\/\/www.ameeba.com\/blog\/wp-json\/wp\/v2\/posts\/74632\/revisions"}],"predecessor-version":[{"id":79218,"href":"https:\/\/www.ameeba.com\/blog\/wp-json\/wp\/v2\/posts\/74632\/revisions\/79218"}],"wp:attachment":[{"href":"https:\/\/www.ameeba.com\/blog\/wp-json\/wp\/v2\/media?parent=74632"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ameeba.com\/blog\/wp-json\/wp\/v2\/categories?post=74632"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ameeba.com\/blog\/wp-json\/wp\/v2\/tags?post=74632"},{"taxonomy":"vendor","embeddable":true,"href":"https:\/\/www.ameeba.com\/blog\/wp-json\/wp\/v2\/vendor?post=74632"},{"taxonomy":"product","embeddable":true,"href":"https:\/\/www.ameeba.com\/blog\/wp-json\/wp\/v2\/product?post=74632"},{"taxonomy":"attack_vector","embeddable":true,"href":"https:\/\/www.ameeba.com\/blog\/wp-json\/wp\/v2\/attack_vector?post=74632"},{"taxonomy":"asset_type","embeddable":true,"href":"https:\/\/www.ameeba.com\/blog\/wp-json\/wp\/v2\/asset_type?post=74632"},{"taxonomy":"severity","embeddable":true,"href":"https:\/\/www.ameeba.com\/blog\/wp-json\/wp\/v2\/severity?post=74632"},{"taxonomy":"exploit_status","embeddable":true,"href":"https:\/\/www.ameeba.com\/blog\/wp-json\/wp\/v2\/exploit_status?post=74632"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}