Your RSA-2048 keys break in 2030. Find every one of them before attackers do.
📦
📦 npm
Not in CISA KEV
CRITICAL severity

GHSA-9x64-5r7x-2q53

CRITICAL

GHSA-9x64-5r7x-2q53 is a critical-severity (CVSS 9.8) vulnerability in flatmap-stream. O3 Security confirms whether GHSA-9x64-5r7x-2q53 is actually reachable in your code before you act, and blocks exploitation at runtime until you patch.

Malicious Package in flatmap-stream

Published
Sep 1, 2020
Updated
Oct 1, 2021
Affected
1 pkg
Patched
None yet
Exploits
None indexed
Exploitation data as of Oct 1, 2021 · OSV.dev, FIRST.org (EPSS)

Real-World Exposure

1 pkg affected

How broadly this vulnerability is actually deployed: weekly install volume shows current usage, a proxy for how much of the ecosystem is exposed.

flatmap-streamnpm
230downloads / week

Description

Version 0.1.1 of flatmap-stream is considered malicious.

This module runs an encrypted payload targeting a very specific application, copay and because they shared the same description it would have likely worked for copay-dash.

The injected code:

  • Read in AES encrypted data from a file disguised as a test fixture
  • Grabbed the npm package description of the module that imported it, using an automatically set environment variable
  • Used the package description as a key to decrypt a chunk of data pulled in from the disguised file

The decrypted data was part of a module, which was then compiled in memory and executed.

This module performed the following actions:

  • Decrypted another chunk of data from the disguised file
  • Concatenated a small, commented prefix from the first decrypted chunk to the end of the second decrypted chunk
  • Performed minor decoding tasks to transform the concatenated block of code from invalid JS to valid JS (we believe this was done to evade detection by dynamic analysis tools)
  • Wrote this processed block of JS out to a file stored in a dependency that would be packaged by the build scripts:

The chunk of code that was written out was the actual malicious code, intended to be run on devices owned by the end users of Copay.

This code would do the following:

  • Detect the current environment: Mobile/Cordova/Electron
  • Check the Bitcoin and Bitcoin Cash balances on the victim's copay account
  • If the current balance was greater than 100 Bitcoin, or 1000 Bitcoin Cash:
    • Harvest the victim's account data in full
    • Harvest the victim's copay private keys
    • Send the victim's account data/private keys off to a collection

Recommendation

If you find this module in your environment it's best to remove it. The malicious version of event-stream and flatmap-stream have been removed from the npm Registry.

Affected Packages

1 total
EcosystemPackageVulnerable rangeFix
📦npmflatmap-streamall versionsNo fix

Detection & mitigation playbook

Open-source dependency
  1. Detect

    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for flatmap-stream. O3's reachability analysis confirms whether the vulnerable code path is actually invoked in your application, so you act on real exposure instead of every transitive match.

  2. Remediation status

    No patched version of flatmap-stream has shipped for GHSA-9x64-5r7x-2q53 yet. Where your build allows, override or pin the dependency away from the vulnerable range, and apply any maintainer-recommended mitigation.

  3. Mitigate without a patch

    If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.

  4. How O3 protects you

    O3 pinpoints whether GHSA-9x64-5r7x-2q53 is reachable in your code and exactly where to fix it, then blocks exploitation in production at runtime until the patched version is deployed.

Tailored to GHSA-9x64-5r7x-2q53. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.

Frequently Asked Questions

Version 0.1.1 of `flatmap-stream` is considered malicious. This module runs an encrypted payload targeting a very specific application, `copay` and because they shared the same description it would have likely worked for `copay-dash`. The injected code: - Read in AES encrypted data from a file disguised as a test fixture - Grabbed the npm package description of the module that imported it, using an automatically set environment variable - Used the package description as a key to decrypt a chunk of data pulled in from the disguised file The decrypted data was part of a module, which was the
O3 Security · Impact-Aware SCA

Is GHSA-9x64-5r7x-2q53 in your dependencies?

O3 detects GHSA-9x64-5r7x-2q53 across npm dependencies and uses function-level reachability to confirm whether the vulnerable code path is actually reachable — not just present. No false positives.

GHSA-9x64-5r7x-2q53: Malicious Package in… | O3 Security