# GHSA-mh6f-8j2x-4483: Critical severity vulnerability that affects event-stream and flatmap-stream

> A malicious dependency in the event-stream npm package allows attackers to execute arbitrary code on systems using the affected library.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 26 Nov 2018

## What is GHSA-mh6f-8j2x-4483?

GHSA-mh6f-8j2x-4483 is a vulnerability in event-stream, published on 26 Nov 2018. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

The NPM package `flatmap-stream` is considered malicious.  A malicious actor added this package as a dependency to the NPM `event-stream` package in version `3.3.6`.  Users of `event-stream` are encouraged to downgrade to the last non-malicious version, `3.3.4`, or upgrade to the latest  4.x version. 

Users of `flatmap-stream` are encouraged to remove the dependency entirely.

## Which versions are affected by GHSA-mh6f-8j2x-4483?

4 open source packages ship an affected version, including event-stream and flatmap-stream.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `event-stream` | npm | From 3.3.6 | 4.0.0 |
| `event-stream` | npm | From 3.3.6 | 4.0.0 |
| `flatmap-stream` | npm | All versions | None |
| `flatmap-stream` | npm | All versions | None |

## How do I fix GHSA-mh6f-8j2x-4483?

Upgrade event-stream to 4.0.0 or later.

## Is GHSA-mh6f-8j2x-4483 being exploited?

There is no known exploitation of GHSA-mh6f-8j2x-4483 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-mh6f-8j2x-4483 and fix it if it is affected.

What it is: GHSA-mh6f-8j2x-4483 is a vulnerability in event-stream, published on 26 Nov 2018. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of GHSA-mh6f-8j2x-4483 in the wild and no public exploit code.

Affected packages and fixed versions:
- event-stream (npm): affected from 3.3.6; fixed in 4.0.0
- event-stream (npm): affected from 3.3.6; fixed in 4.0.0
- flatmap-stream (npm): affected all versions; no fix listed
- flatmap-stream (npm): affected all versions; no fix listed

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/GHSA-mh6f-8j2x-4483/ (Markdown: https://insights.sbomify.com/GHSA-mh6f-8j2x-4483/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-mh6f-8j2x-4483

---
From sbomify Insights: https://insights.sbomify.com/GHSA-mh6f-8j2x-4483/
Summaries are generated and may contain mistakes; the official description above is the record.
