Cyber Security News

AI-Generated npm Malware Leaks Hacker’s Private GitHub Token

A newly discovered malicious npm package is drawing attention across the cybersecurity community after inadvertently exposing its own operator’s private GitHub token.

Identified by OX Security researchers, the package, named mouse5212-super-formatter, operates as an infostealer that silently exfiltrates sensitive files from compromised systems while masquerading as a legitimate development utility.

The package, which has already reached 676 downloads and remains live on npm at the time of reporting, highlights a growing trend of low-effort but effective supply chain threats.

Technical Analysis (Source : Ox).

In this case, the attacker’s operational mistake provided rare visibility into the exfiltration infrastructure, allowing researchers to observe active data theft sessions before the repository was taken down.

AI-Generated npm Malware

OX Security said in a report shared with GBhackers, the malicious package masquerades as an internal “archive deployment sync” tool. On the surface, it appears to validate GitHub repositories and collect basic network diagnostics. However, its true function is far more invasive.

During the post-installation phase, the malware authenticates to GitHub using either an environment token or a hardcoded fallback token embedded directly in the code.

It then checks for the existence of a remote repository, creates one if necessary, and begins recursively scanning the local directory path “/mnt/user-data.”

Every discovered file is encoded using base64 and uploaded via the GitHub Contents API. The malware organizes stolen data into uniquely generated folders for each execution, allowing the attacker to manage multiple victim datasets efficiently. To reduce suspicion, it generates fake diagnostic logs labeled as “network connections,” masking its true intent.

Notably, researchers identified a structured request wrapper used for GitHub API interactions, alongside recursive file discovery routines that automate the collection process.

Local collection path (Source : Ox).

The code comments and commit messages were intentionally generic, likely generated to appear benign and avoid raising suspicion during casual inspection.

The most critical operational failure came from the inclusion of a hardcoded private GitHub token within the malware. This oversight enabled OX Security to trace activity directly to the attacker’s repository, where approximately seven active exfiltration events were observed. Most of these appear to have been test runs conducted by the threat actor prior to wider deployment.

Further analysis revealed that the GitHub account used in the campaign was created only hours before the malicious package was first published.

The attacker tested functionality in a repository labeled “test,” leaving behind commit timestamps and activity logs that provided additional forensic insights. Shortly after discovery, the GitHub account was deleted, though the npm package remains accessible.

The following table summarizes the affected package:

Package Name: mouse5212-super-formatter

Affected Versions: All versions

Recommendations

The malware specifically targets files stored in the “/mnt/user-data” directory, suggesting a focus on development environments, containerized workloads, or cloud-based systems where such paths are commonly used. Any sensitive data within this directory should be considered compromised if the package was installed.

Threat Actor Analysis (Source : Ox).

OX Security recommends immediate remediation steps for affected users. GitHub access tokens should be revoked without delay to prevent further unauthorized access. Additionally, organizations should audit systems for any sensitive data exposure and monitor for unusual GitHub repository activity linked to automated uploads.

This incident underscores a broader shift in the threat landscape, where attackers increasingly rely on AI-generated code to build malware quickly. While this lowers the barrier to entry, it also introduces operational flaws, as seen in this case.

Poor implementation of basic security practices, such as token management, can expose attacker infrastructure and aid defenders.

As AI-assisted malware development becomes more widespread, security teams should expect a surge in similar campaigns. Many of these threats may lack sophistication but can still cause significant damage, particularly in software supply chains.

Continuous monitoring of open-source ecosystems and stricter package validation mechanisms will be essential to mitigating these risks.

Follow us on Google News, LinkedIn, and X to Get Instant Updates and Set GBH as a Preferred Source in Google.

Mayura Kathir

Mayura Kathir is a cybersecurity reporter at GBHackers News, covering daily incidents including data breaches, malware attacks, cybercrime, vulnerabilities, zero-day exploits, and more.

Recent Posts

Storm-2603 Hackers Exploit SharePoint and Abuse Cloudflare Tunnel to Hide Remote Access

A December intrusion to Storm-2603, the China-based group Microsoft ties to Warlock ransomware. The attackers…

8 minutes ago

OpenSSH sshole Flaw Allows Hackers to Log Into Password-Disabled Linux Accounts Using 257-Character Passwords

A decade-old authentication bypass in OpenSSH on musl-based Linux lets attackers log into accounts that…

11 minutes ago

New GhostMap Android Vulnerability Can Crash Phones Permanently Without Opening an App or Granting Permissions

Bitdefender researchers have revealed a vulnerability called GhostMap that affects Android devices. This vulnerability can…

21 minutes ago

Microsoft Paint Vulnerability Allows Hackers to Execute Malicious Code Remotely Without User Interaction

Microsoft has announced a vulnerability in Windows Paint that could let unauthenticated attackers execute malicious…

44 minutes ago

ARTEX AI Framework Linked to Bank Breaches and Cloud Attacks Found Exposed Across Hundreds of Servers

An autonomous penetration-testing framework linked to South Korean banking breaches and cloud supply-chain attacks is…

1 hour ago

Shopify Makes IP Allowlisting Mandatory for All Public Apps to Prevent Stolen API Token Abuse

Shopify is making IP allowlisting mandatory for all public apps to limit abuse of stolen…

1 hour ago