# CVE-2022-31153: OpenZeppelin Contracts for Cairo account cannot process transactions on Goerli

> A logic error in OpenZeppelin Cairo contracts prevents account transactions on Goerli, causing denial of service for users.

- **Severity:** Medium 6.5 (`CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 15 Jul 2022
- **Updated:** 22 Apr 2025
- **Also known as:** GHSA-8mjr-jr5h-q2xr, PYSEC-2026-890

## What is CVE-2022-31153?

CVE-2022-31153 is a medium-severity vulnerability in OpenZeppelin cairo-contracts, published on 15 Jul 2022. Any signed-in user can exploit it over the network, with no action from the victim.

### Official description

OpenZeppelin Contracts for Cairo is a library for contract development written in Cairo for StarkNet, a decentralized ZK Rollup. Version 0.2.0 is vulnerable to an error that renders account contracts unusable on live networks. This issue affects all accounts (vanilla and ethereum flavors) in the v0.2.0 release of OpenZeppelin Contracts for Cairo, which are not whitelisted on StarkNet mainnet. Only goerli deployments of v0.2.0 accounts are affected. This faulty behavior is not observed in StarkNet's testing framework. This bug has been patched in v0.2.1.

Weakness: CWE-863 (Incorrect Authorization), CWE-664 (Improper Control of a Resource Through its Lifetime)

## Which versions are affected by CVE-2022-31153?

3 open source packages ship an affected version, including openzeppelin-cairo-contracts. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `openzeppelin-cairo-contracts` | PyPI | All versions | 0.2.1 |
| `openzeppelin-cairo-contracts` | PyPI | All versions | 0.2.1 |
| `openzeppelin-cairo-contracts` | PyPI | All versions | 0.2.1 |

Products: Openzeppelin Contracts.

## How do I fix CVE-2022-31153?

Upgrade openzeppelin-cairo-contracts to 0.2.1 or later.

## Is CVE-2022-31153 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2022-31153 exists.

## Other vulnerabilities in OpenZeppelin cairo-contracts

- [CVE-2021-39167](https://insights.sbomify.com/CVE-2021-39167/): TimelockController vulnerability in OpenZeppelin Contracts (critical 10.0)
- [CVE-2021-39168](https://insights.sbomify.com/CVE-2021-39168/): TimelockController vulnerability in OpenZeppelin Contracts (critical 10.0)
- [CVE-2021-41264](https://insights.sbomify.com/CVE-2021-41264/): UUPSUpgradeable vulnerability in OpenZeppelin Contracts (critical 9.8)
- [CVE-2022-35961](https://insights.sbomify.com/CVE-2022-35961/): ECDSA signature malleability in OpenZeppelin Contracts (high 7.9)
- [CVE-2022-31198](https://insights.sbomify.com/CVE-2022-31198/): GovernorVotesQuorumFraction updates to quorum may affect past defeated proposals in @openzeppelin/contracts (high 7.5)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2022-31153 and fix it if it is affected.

What it is: CVE-2022-31153 is a medium-severity vulnerability in OpenZeppelin cairo-contracts, published on 15 Jul 2022. Any signed-in user can exploit it over the network, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2022-31153 exists.

Affected packages and fixed versions:
- openzeppelin-cairo-contracts (PyPI): affected all versions; fixed in 0.2.1
- openzeppelin-cairo-contracts (PyPI): affected all versions; fixed in 0.2.1
- openzeppelin-cairo-contracts (PyPI): affected all versions; fixed in 0.2.1

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/CVE-2022-31153/ (Markdown: https://insights.sbomify.com/CVE-2022-31153/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2022-31153
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2022-31153
- OSV: https://osv.dev/vulnerability/CVE-2022-31153

---
From sbomify Insights: https://insights.sbomify.com/CVE-2022-31153/
Summaries are generated and may contain mistakes; the official description above is the record.
