Programmer’s Digest #114
12/18/2024-12/25/2024 Critical Fortinet EMS Vulnerability, PyPI Packages Stealing Keystrokes, Rspack npm Packages Compromised, Thousands Download Malicious npm Libraries.
1. Sophos Patches Critical Firewall Vulnerabilities
Sophos has issued patches for a critical firewall vulnerability, CVE-2024-12727 (CVSS 9.8), which allows remote code execution (RCE) through an SQL injection in the email protection feature. This flaw impacts firewalls configured with Secure PDF eXchange (SPX) in High Availability (HA) mode and affects 0.05% of devices. The issue is resolved in Sophos Firewall version 21.0 MR1 (21.0.1). Additionally, CVE-2024-12728 (CVSS 9.8), involving weak SSH credentials in HA setups, affects 0.5% of devices. Users should restrict SSH access, use strong passphrases, and disable WAN access via SSH. Another vulnerability, CVE-2024-12729 (CVSS 8.8), allows authenticated attackers to execute remote code via the User Portal. To mitigate risks, users should disable WAN access to the User Portal and Webadmin. Sophos emphasizes there’s no evidence of exploitation yet, but urges immediate updates.
2. Hackers Exploiting Critical Fortinet EMS Vulnerability to Deploy Remote Access Tools
A critical vulnerability, CVE-2023-48788 (CVSS 9.3), in Fortinet FortiClient EMS has been exploited in a cyber campaign to install remote desktop tools like AnyDesk and ScreenConnect. The SQL injection flaw enables unauthorized code execution via crafted data packets. Kaspersky reported the October 2024 attack on a company’s internet-exposed Windows server with open FortiClient EMS ports. The attackers used the flaw for initial access, installing ScreenConnect and uploading additional tools for credential theft, network scanning, and persistence. Dropped tools included Mimikatz, webbrowserpassview.exe (password recovery), and netscan.exe (network scanning). Targets spanned multiple countries, including Brazil, India, and Spain. Attackers used various ScreenConnect subdomains for lateral movement. Kaspersky also observed CVE-2023-48788 being exploited to execute PowerShell scripts via webhook[.]site domains, highlighting evolving attacker tactics. A similar campaign was uncovered earlier, using the vulnerability to deliver ScreenConnect and Metasploit payloads.
3. Researchers Uncover PyPI Packages Stealing Keystrokes and Hijacking Social Accounts
Cybersecurity researchers have identified two malicious Python packages, zebo and cometlogger, uploaded to the PyPI repository. These packages, downloaded 118 and 164 times respectively before removal, were designed to exfiltrate sensitive data from compromised systems. The packages collected system metadata, network and Wi-Fi details, running processes, and clipboard content. They also incorporated checks to evade virtual environments and terminated browser-related processes for unrestricted file access.
Fortinet noted that the script operates asynchronously to efficiently steal large volumes of data. These findings underscore the ongoing risks posed by malicious packages in open-source repositories.
4. Apache Tomcat Vulnerability CVE-2024-56337
The Apache Software Foundation (ASF) has patched CVE-2024-56337, a vulnerability in Apache Tomcat that could lead to remote code execution (RCE) under specific conditions. This TOCTOU race condition affects Tomcat versions 11.0.0-M1 to 11.0.1, 10.1.0-M1 to 10.1.33, and 9.0.0.M1 to 9.0.97, stemming from incomplete mitigation of CVE-2024-50379 (CVSS 9.8).
Exploitation is possible on case-insensitive file systems with the default servlet write enabled (readonly initialization set to false). Proper configuration based on Java versions is critical:
- Java 8/11: Set sun.io.useCanonCaches to false.
- Java 17: Ensure the property is false (default).
- Java 21+: No action required (property removed).
Future Tomcat versions (11.0.3, 10.1.35, 9.0.99) enforce these configurations. Researchers Nacl, WHOAMI, Yemoli, and Ruozhi discovered these flaws, with KnownSec 404 Team independently reporting CVE-2024-56337 along with a proof-of-concept.
5. CISA Adds Critical Flaw in BeyondTrust Software to Exploited Vulnerabilities Catalog
CISA added CVE-2024-12356, a critical command injection vulnerability (CVSS 9.8), in BeyondTrust Privileged Remote Access (PRA) and Remote Support (RS) products, to its KEV. This flaw allows unauthenticated attackers to inject and execute operating system commands as a site user via malicious client requests. BeyondTrust confirmed all versions of PRA and RS prior to 22.1.x are affected and has released patches to address the issue.
Federal agencies must fix this vulnerability by December 27, 2024, as per Binding Operational Directive (BOD) 22-01, which mandates mitigation of listed vulnerabilities to protect government networks. Private organizations are also urged to review the KEV catalog and secure their systems to prevent exploitation.
6. Rspack npm Packages Compromised with Crypto Mining Malware in Supply Chain Attack
Rspack developers disclosed a supply chain attack compromising their npm packages, @rspack/core and @rspack/cli, which were replaced with malicious versions containing cryptocurrency mining malware. The affected versions, 1.1.7, were removed, and the latest safe release is 1.1.8. The rogue packages exploited a postinstall script to download and execute an XMRig miner on Linux hosts. They also exfiltrated sensitive data, including cloud credentials and IP details, targeting machines in specific countries like China and Russia. The malware activated automatically upon installation. Rspack, a high-performance JavaScript bundler written in Rust and adopted by major companies, sees over 300,000 weekly downloads for @rspack/core. Maintainers revoked all npm and GitHub tokens, secured permissions, and audited code to prevent further breaches. Another npm package, vant (41,000 weekly downloads), was similarly compromised via a stolen npm token. This incident underscores the urgent need for stricter safeguards in software package management.
7. Thousands Download Malicious npm Libraries Impersonating Legitimate Tools
Threat actors have uploaded malicious typosquats of npm packages like typescript-eslint and @types/node, which have accumulated thousands of downloads. These fake packages, named @typescript_eslinter/eslint and types-node, deliver trojans and second-stage payloads. Sonatype’s analysis revealed that @typescript_eslinter/eslint includes a file, prettier.bat, which installs itself in Windows Startup. Despite its name, it’s a disguised trojan executable. The package impersonates popular tools to deceive users. Similarly, types-node fetches malicious scripts from a Pastebin URL to execute a deceptive npm.exe payload. ReversingLabs also flagged malicious Visual Studio Code (VSCode) extensions, such as Ethereum.SoliditySupport and ZoomWorkspace.Zoom, targeting the crypto community and broader users. These extensions contained obfuscated JavaScript to download unknown second-stage payloads. These findings highlight the critical need for stronger supply chain security and vigilance when using open-source tools to avoid introducing malicious code into projects.