# GHSA-593m-55hh-j8gv: Sentry SDK Prototype Pollution gadget in JavaScript SDKs

> Sentry SDK acts as a gadget for existing Prototype Pollution vulnerabilities, potentially enabling code execution if the host application is vulnerable.

- **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:** 3 Oct 2024

## What is GHSA-593m-55hh-j8gv?

GHSA-593m-55hh-j8gv is a vulnerability in @sentry/browser, published on 3 Oct 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

### Impact
In case a Prototype Pollution vulnerability is present in a user's application or bundled libraries, the Sentry SDK could potentially serve as a gadget to exploit that vulnerability. The exploitability depends on the specific details of the underlying Prototype Pollution issue.

> [!NOTE]
> This advisory does not indicate the presence of a Prototype Pollution within the Sentry SDK itself. Users are strongly advised to first address any Prototype Pollution vulnerabilities in their application, as they pose a more critical security risk.

### Patches
The issue was patched in all Sentry JavaScript SDKs starting from the [8.33.0](https://github.com/getsentry/sentry-javascript/releases/tag/8.33.0) version.
Also, the fix was backported to SDK v7 in [7.119.1](https://github.com/getsentry/sentry-javascript/releases/tag/7.119.1).

### References
* [Prototype Pollution](https://portswigger.net/web-security/prototype-pollution)
* [Prototype Pollution gadgets](https://portswigger.net/web-security/prototype-pollution#prototype-pollution-gadgets)
* [sentry-javascript#13838](https://github.com/getsentry/sentry-javascript/pull/13838)

## Which versions are affected by GHSA-593m-55hh-j8gv?

4 open source packages ship an affected version, including @sentry/browser.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `@sentry/browser` | npm | All versions | 7.119.1 |
| `@sentry/browser` | npm | All versions | 7.119.1 |
| `@sentry/browser` | npm | From 8.0.0-alpha.1 | 8.33.0 |
| `@sentry/browser` | npm | From 8.0.0-alpha.1 | 8.33.0 |

## How do I fix GHSA-593m-55hh-j8gv?

Upgrade @sentry/browser to a fixed version for your release line: 7.119.1 or 8.33.0.

## Is GHSA-593m-55hh-j8gv being exploited?

There is no known exploitation of GHSA-593m-55hh-j8gv in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-593m-55hh-j8gv and fix it if it is affected.

What it is: GHSA-593m-55hh-j8gv is a vulnerability in @sentry/browser, published on 3 Oct 2024. 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-593m-55hh-j8gv in the wild and no public exploit code.

Affected packages and fixed versions:
- @sentry/browser (npm): affected all versions; fixed in 7.119.1
- @sentry/browser (npm): affected all versions; fixed in 7.119.1
- @sentry/browser (npm): affected from 8.0.0-alpha.1; fixed in 8.33.0
- @sentry/browser (npm): affected from 8.0.0-alpha.1; fixed in 8.33.0

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-593m-55hh-j8gv/ (Markdown: https://insights.sbomify.com/GHSA-593m-55hh-j8gv/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-593m-55hh-j8gv

---
From sbomify Insights: https://insights.sbomify.com/GHSA-593m-55hh-j8gv/
Summaries are generated and may contain mistakes; the official description above is the record.
