VDB
KO

MAL-2026-10233

Malicious code in sams-sr-sdk-h5 (npm)

Details

The sams-sr-sdk-h5 package was published to the npm registry by user 'click2ai' (maintainer email privatek3m@protonmail.com) as part of a dependency-confusion / reconnaissance campaign. The package name mimics the internal/private package naming convention of a target organization (a 'sams' internal namespace) so that a misconfigured resolver installs this public lookalike instead of the intended private dependency.

The package declares a preinstall hook ("npm install @sentry/node && node examples/verify.js") that executes automatically at npm install time, before any application code runs. The bundled examples/verify.js initializes the @sentry/node client against a hardcoded, attacker-controlled Sentry DSN with sendDefaultPii enabled, resolves the installing host's public egress IP address by requesting Cloudflare's /cdn-cgi/trace endpoint (using a spoofed desktop-browser User-Agent to bypass bot challenges), then deliberately triggers a runtime exception and captures it. Flushing the event beacons the collected host telemetry (public IP plus Sentry default PII such as hostname, OS username and runtime/environment metadata) to the attacker's Sentry ingest endpoint at o4510485815754752.ingest.us.sentry.io.

Each impersonated namespace in the campaign beacons to a distinct Sentry project ID, letting the operator attribute successful installs to specific victim organizations — behaviour consistent with a dependency-confusion reconnaissance beacon rather than legitimate error monitoring. The install-time payload is byte-for-byte identical across all packages published by this account, differing only in the package name and the target DSN. This package's beacon targets Sentry project 4511664042999808.

--- _-= Per source details. Do not edit below this line.=-_

## Source: amazon-inspector (8ef694ad4b3de8241aaab7efc741aa6f3714b40f105ffe7c4e8dffc75debdd73) The package's declared preinstall script runs examples/verify.js, which fetches the installer's public egress IP via a Cloudflare trace endpoint and then deliberately throws an exception captured by Sentry and flushed to a hardcoded DSN (https://<key>@o4510485815754752.ingest.us.sentry.io/4511664042999808) with sendDefaultPii=true. Running `npm install sams-sr-sdk-h5` is enough to transmit host metadata (OS, hostname, runtime, public IP, stack) to the author's Sentry project without any user action. Separately, the library's init() falls back to the same hardcoded DSN when the caller does not supply a dsn option or SENTRY_DSN environment variable, so any consumer that follows the advertised usage silently routes their application errors and end-user PII/IPs to the author-controlled Sentry account. Package name and stub README (only a title and an `npm install` line) are also consistent with a dependency-confusion attempt against an internal `sams` SDK namespace.

Are you affected?

Enter the version of the package you're using.

Affected packages

npm / sams-sr-sdk-h5
Introduced in: 0

No fixed version published yet for sams-sr-sdk-h5 (npm). Pin to a known-safe version or switch to an alternative.

References