# GHSA-c3px-v9c7-m734: Prototype Pollution in mithril

> Prototype pollution in mithril allows attackers to modify Object prototypes via query strings, potentially leading to code execution or logic bypasses.

- **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 Sep 2020

## What is GHSA-c3px-v9c7-m734?

GHSA-c3px-v9c7-m734 is a vulnerability in mithril, published on 3 Sep 2020. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

Affected versions of `mithril`are vulnerable to prototype pollution. The function `parseQueryString` may allow a malicious user to modify the prototype of `Object`, causing the addition or modification of an existing property that will exist on all objects. A payload such as `__proto__%5BtoString%5D=123` in the query string would change the `toString()` function to `123`.

## Recommendation

If you are using mithril 2.x, upgrade to version 2.0.2 or later.
If you are using mithril 1.x, upgrade to version 1.1.7 or later.

## Which versions are affected by GHSA-c3px-v9c7-m734?

4 open source packages ship an affected version, including mithril.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `mithril` | npm | All versions | 1.1.7 |
| `mithril` | npm | All versions | 1.1.7 |
| `mithril` | npm | From 2.0.0 | 2.0.2 |
| `mithril` | npm | From 2.0.0 | 2.0.2 |

## How do I fix GHSA-c3px-v9c7-m734?

Upgrade mithril to a fixed version for your release line: 1.1.7 or 2.0.2.

## Is GHSA-c3px-v9c7-m734 being exploited?

There is no known exploitation of GHSA-c3px-v9c7-m734 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-c3px-v9c7-m734 and fix it if it is affected.

What it is: GHSA-c3px-v9c7-m734 is a vulnerability in mithril, published on 3 Sep 2020. 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-c3px-v9c7-m734 in the wild and no public exploit code.

Affected packages and fixed versions:
- mithril (npm): affected all versions; fixed in 1.1.7
- mithril (npm): affected all versions; fixed in 1.1.7
- mithril (npm): affected from 2.0.0; fixed in 2.0.2
- mithril (npm): affected from 2.0.0; fixed in 2.0.2

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-c3px-v9c7-m734/ (Markdown: https://insights.sbomify.com/GHSA-c3px-v9c7-m734/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-c3px-v9c7-m734

---
From sbomify Insights: https://insights.sbomify.com/GHSA-c3px-v9c7-m734/
Summaries are generated and may contain mistakes; the official description above is the record.
