Malicious code in test_payload_folder (npm)
The npm package test_payload_folder contains malicious code designed to exfiltrate Discord user tokens. The package exposes a startVoiceJoiner API that accepts Discord user tokens but secretly attempts to relay them to an attacker-controlled webhook endpoint before using them for their advertised purpose.
- Disclosed
- Last updated
- Blast radius
- Any developer or application using test_payload_folder to integrate Discord voice functionality with user tokens
- Ecosystems
- Attack vectors
- Affected entities
- test_payload_foldernpm package containing malicious code to exfiltrate Discord user tokens
The npm package test_payload_folder was published with embedded malicious code intended to harvest Discord user authentication tokens. The package provides a startVoiceJoiner(config) API that accepts Discord USER_TOKEN and optional USER_TOKEN_2 parameters, ostensibly for gateway login functionality.\n\nBefore using the tokens for their advertised purpose, the code calls a sendTokenToCreator function that constructs a payload containing the caller's user token(s), server ID, and channel ID. This payload is then sent via axios.post to a hardcoded webhook URL constant. Users are not informed that their bearer credentials are being copied to a third destination.\n\nIn the published artifact, the webhook constant is set to a placeholder string YOUR_DISCORD_WEBHOOK_URL_HERE and is guarded by an early-return check, preventing the exfiltration from executing. However, the full token-harvesting and exfiltration code path is fully implemented and functional; a single-line edit to the webhook constant would activate the attack. The package name and Thai-language comments explicitly reference the token-relay intent, indicating deliberate malicious design.\n\nDiscord user tokens are full-account bearer credentials. This incident was identified and credited to the OpenSSF malicious-packages project.
Indicators of compromise
- Packages
- test_payload_folder
Remediation
- Remove test_payload_folder from all npm installations immediately
- Audit any systems or applications that installed or used test_payload_folder
- If Discord user tokens were passed to this package, rotate those tokens immediately
- Review Discord account activity and security logs for any unauthorized access
- Do not install or use test_payload_folder or any successor packages from the same author
- Use npm audit to identify if the package is present in dependency trees
Sources
- GitHub Advisory GHSA-qc5f-4cqm-c8wx · GitHub Advisory Database
Cite this entry
"Malicious code in test_payload_folder (npm)." supplychainattack.org, Supply Chain Attack Incident Catalog. Disclosed August 19, 2026; last updated August 19, 2026. https://supplychainattack.org/incident/malicious-code-in-test-payload-folder-npm-1kc7g1
Suggest a correction
Found an error or have a newer source? Corrections to factual errors take priority over new entries.
Related incidents
- containedcritical
Malicious code in 3-buildsight-web (npm)
The npm package 3-buildsight-web contains malicious code that fetches and executes arbitrary JavaScript from a remote Bitbucket URL on module load, granting full page privileges to an unverified third party.
npmCompromised package - resolvedcritical
Malicious code in @usaa-grp-personal-profile/personal-profile-common (npm)
Malicious package @usaa-grp-personal-profile/personal-profile-common version 999.0.0 published to public npm as a dependency-confusion attack targeting an organization's internal registry. The package contains preinstall and postinstall hooks that exfiltrate hostname, username, and working directory to an attacker-controlled OAST endpoint on every install.
npmDependency confusionCompromised package - resolvedcritical
Malicious code in create-coin (npm)
create-coin@20.1.1 on npm contained malicious postinstall code that collected sensitive environment variables, credentials, and host reconnaissance data. The package impersonated an esbuild platform build and exfiltrated data to a hardcoded endpoint.
npmCompromised packageTyposquatting - resolvedcritical
Malicious code in @syncraft-labs/vue (npm)
The npm package @syncraft-labs/vue version 0.4.1 contained malicious obfuscated code in its ESM build that implements a blockchain-hosted C2 dropper (EtherHiding pattern), enabling remote code execution on any consumer importing the package.
npmCompromised package