Malicious code in afterpay-sdk-example-server (npm)
The npm package 'afterpay-sdk-example-server' versions 20.0.0 and 1.2.1 contain malicious code that executes a preinstall script during npm install. This script collects sensitive host information including system identifiers, user info, DNS servers, and contents of critical files like /etc/passwd and /etc/hosts, then exfiltrates this data to an attacker-controlled domain. The package impersonates an internal Afterpay SDK example, consistent with a dependency confusion attack targeting internal build systems. Installation of this package can lead to full system compromise.
AI Analysis
Technical Summary
The 'afterpay-sdk-example-server' npm package versions 20.0.0 and 1.2.1 include a preinstall hook that runs automatically during npm install. This hook executes a Node.js script that gathers extensive system and user information such as __dirname, os.homedir(), os.hostname(), os.userInfo(), DNS server details, and the full contents of /etc/passwd and /etc/hosts. It then sends this data via HTTPS POST to a malicious domain associated with Burp Collaborator OAST infrastructure. The package name is crafted to impersonate an internal Afterpay SDK example, indicating a dependency confusion attack vector. The OpenSSF Package Analysis and other sources classify this package as malicious. Any system installing this package is considered fully compromised, with a high risk of secret and key exposure.
Potential Impact
Systems that install this package leak sensitive host and user information to an attacker-controlled endpoint, potentially exposing system accounts, DNS configurations, and other critical data. The compromise is severe enough that all secrets and keys on the affected system should be rotated immediately from a different, trusted machine. The attacker may have full control over the compromised system, and simply removing the package does not guarantee removal of all malicious artifacts.
Mitigation Recommendations
No official patch or remediation is available. Users should immediately remove the 'afterpay-sdk-example-server' package versions 20.0.0 and 1.2.1 if installed. All secrets and credentials stored on the affected system must be rotated from a separate, secure environment. Due to the potential full compromise, consider rebuilding or thoroughly cleaning the affected system. Avoid installing packages from untrusted sources and verify package authenticity before installation.
Malicious code in afterpay-sdk-example-server (npm)
Description
The npm package 'afterpay-sdk-example-server' versions 20.0.0 and 1.2.1 contain malicious code that executes a preinstall script during npm install. This script collects sensitive host information including system identifiers, user info, DNS servers, and contents of critical files like /etc/passwd and /etc/hosts, then exfiltrates this data to an attacker-controlled domain. The package impersonates an internal Afterpay SDK example, consistent with a dependency confusion attack targeting internal build systems. Installation of this package can lead to full system compromise.
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The 'afterpay-sdk-example-server' npm package versions 20.0.0 and 1.2.1 include a preinstall hook that runs automatically during npm install. This hook executes a Node.js script that gathers extensive system and user information such as __dirname, os.homedir(), os.hostname(), os.userInfo(), DNS server details, and the full contents of /etc/passwd and /etc/hosts. It then sends this data via HTTPS POST to a malicious domain associated with Burp Collaborator OAST infrastructure. The package name is crafted to impersonate an internal Afterpay SDK example, indicating a dependency confusion attack vector. The OpenSSF Package Analysis and other sources classify this package as malicious. Any system installing this package is considered fully compromised, with a high risk of secret and key exposure.
Potential Impact
Systems that install this package leak sensitive host and user information to an attacker-controlled endpoint, potentially exposing system accounts, DNS configurations, and other critical data. The compromise is severe enough that all secrets and keys on the affected system should be rotated immediately from a different, trusted machine. The attacker may have full control over the compromised system, and simply removing the package does not guarantee removal of all malicious artifacts.
Defensive Guidance
No official patch or remediation is available. Users should immediately remove the 'afterpay-sdk-example-server' package versions 20.0.0 and 1.2.1 if installed. All secrets and credentials stored on the affected system must be rotated from a separate, secure environment. Due to the potential full compromise, consider rebuilding or thoroughly cleaning the affected system. Avoid installing packages from untrusted sources and verify package authenticity before installation.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- MAL-2023-1111
- Osv Schema Version
- 1.7.4
- Aliases
- ["GHSA-xqcr-rgfp-6wv7"]
- Ecosystems
- ["npm"]
Threat ID: 6a9f9111acd9273b49ff2ae9
Added to database: 09/08/2026, 04:37:37 UTC
Last enriched: 09/08/2026, 05:23:30 UTC
Last updated: 09/10/2026, 01:50:13 UTC
Views: 17
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
External Links
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.