# GHSA-q4h9-46xg-m3x9: UUPSUpgradeable vulnerability in @openzeppelin/contracts-upgradeable

> Attackers can exploit uninitialized UUPS implementation contracts to gain unauthorized control or execute code, affecting developers using OpenZeppelin upgradeable contracts.

- **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:** 15 Sep 2021

## What is GHSA-q4h9-46xg-m3x9?

GHSA-q4h9-46xg-m3x9 is a missing authorization vulnerability in @openzeppelin/contracts-upgradeable, published on 15 Sep 2021. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

### Impact

Upgradeable contracts using `UUPSUpgradeable` may be vulnerable to an attack affecting uninitialized implementation contracts. We will update this advisory with more information soon.

### Patches

A fix is included in version 4.3.2 of `@openzeppelin/contracts` and `@openzeppelin/contracts-upgradeable`.

### Workarounds

Initialize implementation contracts using `UUPSUpgradeable` by invoking the initializer function (usually called `initialize`). An example is provided [in the forum](https://forum.openzeppelin.com/t/security-advisory-initialize-uups-implementation-contracts/15301).

### References

A post-mortem will be published in a few days in the [OpenZeppelin Forum](https://forum.openzeppelin.com/).

### For more information

If you have any questions or comments about this advisory, or need assistance executing the mitigation, email us at security@openzeppelin.com.

## Which versions are affected by GHSA-q4h9-46xg-m3x9?

2 open source packages ship an affected version, including @openzeppelin/contracts-upgradeable.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `@openzeppelin/contracts-upgradeable` | npm | From 4.1.0 | 4.3.2 |
| `@openzeppelin/contracts-upgradeable` | npm | From 4.1.0 | 4.3.2 |

## How do I fix GHSA-q4h9-46xg-m3x9?

Upgrade @openzeppelin/contracts-upgradeable to 4.3.2 or later.

## Is GHSA-q4h9-46xg-m3x9 being exploited?

There is no known exploitation of GHSA-q4h9-46xg-m3x9 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-q4h9-46xg-m3x9 and fix it if it is affected.

What it is: GHSA-q4h9-46xg-m3x9 is a missing authorization vulnerability in @openzeppelin/contracts-upgradeable, published on 15 Sep 2021. 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-q4h9-46xg-m3x9 in the wild and no public exploit code.

Affected packages and fixed versions:
- @openzeppelin/contracts-upgradeable (npm): affected from 4.1.0; fixed in 4.3.2
- @openzeppelin/contracts-upgradeable (npm): affected from 4.1.0; fixed in 4.3.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-q4h9-46xg-m3x9/ (Markdown: https://insights.sbomify.com/GHSA-q4h9-46xg-m3x9/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-q4h9-46xg-m3x9

---
From sbomify Insights: https://insights.sbomify.com/GHSA-q4h9-46xg-m3x9/
Summaries are generated and may contain mistakes; the official description above is the record.
