Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

Malicious code in mongoose-schema-unique (npm)

0
Critical
Published: 07/10/2026 (07/10/2026, 22:42:27 UTC)
Source: GCVE Database
Product: mongoose-schema-unique

Description

--- _-= Per source details. Do not edit below this line.=-_ ## Source: amazon-inspector (7e3806417e775917428aeea0eb50ecbfec0bc2220282bee33f4138ff43e80dca) index.js runs an async IIFE at module load that performs an outbound fetch to https://www.jsonkeeper.com/b/XVHGD (an anonymous, mutable, public JSON-paste service) and forwards the response's `data.data` field to a worker thread via `worker.postMessage({ type: 'RUN_ERROR_THREAD', payload: data.data })`. The referenced worker module (`./worker-singleton`) is not present in the tarball. Every `require('mongoose-schema-unique')` triggers this fetch, and the paste host lets whoever controls the paste ID substitute new content at any time without a package release, so the payload dispatched into worker execution is attacker-mutable. The behavior is unrelated to the package's documented purpose (a Mongoose uniqueness-validation plugin). The 4.0.3 release also changes the repository URL to a new `mongoose-schema-unique/mongoose-schema-unique` GitHub org while keeping the original author metadata and jumps the major version with a `mongoose ^8` peer dependency — consistent with a name/maintainer takeover of an established package used to ship an import-time remote-code delivery channel to downstream installers.

Affected software

npmghsa
mongoose-schema-unique
Affected versions
=4.0.4=4.0.3=4.0.2

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: 07/11/2026, 09:45:19 UTC

Technical Analysis

The mongoose-schema-unique npm package versions 4.0.2 through 4.0.4 include an asynchronous immediately-invoked function expression (IIFE) that performs an outbound fetch to https://www.jsonkeeper.com/b/XVHGD, a mutable public JSON paste service. The fetched data's 'data.data' field is forwarded to a worker thread via postMessage for execution. The worker module is absent from the package tarball, enabling the attacker to modify the payload at any time without releasing a new package version. This malicious behavior diverges from the package's documented purpose and coincides with a repository URL change and major version bump, consistent with a takeover of the package to deliver remote code execution through dynamic payloads.

Potential Impact

Any project importing mongoose-schema-unique versions 4.0.2, 4.0.3, or 4.0.4 will execute attacker-controlled code fetched at runtime from a public JSON paste service. This creates a remote code execution vector that can be updated by the attacker without any new package release, posing a significant risk to the confidentiality, integrity, and availability of affected systems.

Mitigation Recommendations

No official patch or remediation is currently documented. Users should immediately stop using mongoose-schema-unique versions 4.0.2, 4.0.3, and 4.0.4. Replace the package with a known good alternative or revert to a version prior to the malicious releases if available and verified safe. Monitor vendor advisories for updates or official fixes. Consider removing the package entirely if its functionality is not critical.

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-10184
Osv Schema Version
1.7.4
Aliases
[]
Ecosystems
["npm"]
Database Specific Severity
null
Cvss Version
null

Threat ID: 6a520ea768715ace438f441e

Added to database: 07/11/2026, 09:36:39 UTC

Last enriched: 07/11/2026, 09:45:19 UTC

Last updated: 07/26/2026, 20:28:51 UTC

Views: 22

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