{"answers":{"affected":"2 open source packages ship an affected version, including @openzeppelin/contracts-upgradeable.","exploited":"There is no known exploitation of GHSA-7j52-6fjp-58gr in the wild and no public exploit code.","fix":"Upgrade @openzeppelin/contracts-upgradeable to 4.3.0 or later.","what":"GHSA-7j52-6fjp-58gr is a vulnerability in @openzeppelin/contracts-upgradeable, published on 14 Mar 2022."},"fix_prompt":"Check this codebase for GHSA-7j52-6fjp-58gr and fix it if it is affected.\n\nWhat it is: GHSA-7j52-6fjp-58gr is a vulnerability in @openzeppelin/contracts-upgradeable, published on 14 Mar 2022. \nExploitation: There is no known exploitation of GHSA-7j52-6fjp-58gr in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- @openzeppelin/contracts-upgradeable (npm): affected from 4.0.0; fixed in 4.3.0\n- @openzeppelin/contracts-upgradeable (npm): affected from 4.0.0; fixed in 4.3.0\n\nTask:\n1. 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.\n2. 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.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/GHSA-7j52-6fjp-58gr/ (Markdown: https://insights.sbomify.com/GHSA-7j52-6fjp-58gr/index.md)","id":"GHSA-7j52-6fjp-58gr","markdown":"https://insights.sbomify.com/GHSA-7j52-6fjp-58gr/index.md","name":"GHSA-7j52-6fjp-58gr","record":{"aliases":[],"analysis":null,"analysis_generated_by":null,"assigner":null,"cpe":[],"cvss":{"score":null,"severity":null,"source":null,"vector":null,"version":null},"cwes":[],"description":"### Impact\n\nThe storage layout of the ERC2771ContextUpgradeable is not constant between versions. \n- versions `4.0.0`, `4.1.0` and `4.2.0`, the contract has a length of 51 slots. \n- since `4.3.0`, the contract has a length of 50 slots\n- future versions will continue using 50 slots. \n\nThis difference in layout could result in breaking upgrades if someone upgrades from an affected version to a non-affected version. It is thus recommended to be extremely careful when upgrading from a contract that uses ERC2771ContextUpgradeable `\u003c4.3.0` to a newer version that uses `\u003e=4.3.0`.\n\nWe've assessed the instances of this contract found on chain (with publicly verified source code) and notified the corresponding teams of the risk that an upgrade could cause.\n\n### Workarounds\n\nPotentially breaking upgrades would be caught by the OpenZeppelin Upgrades Plugins for Hardhat and Truffle. It is recommended to use this tooling for all your upgrades.\n\nIf you need to upgrade to a newer version of the Upgradeable Contracts library, we recommend copying the previous implementation ERC2771ContextUpgradeable (available in the `release-4.2` branch) and packaging it with your code.\n\n### Reference\n\nhttps://github.com/OpenZeppelin/openzeppelin-transpiler/pull/86\n\n### For more information\n\nIf you have any questions, comments, or need assistance regarding this advisory, email us at [security@openzeppelin.com](mailto:security@openzeppelin.com).\n\nTo submit security reports please use [our bug bounty on Immunefi](https://immunefi.com/bounty/openzeppelin/).","ecosystems":["npm"],"exploits":{"exploitdb":null,"first_seen":null,"github_poc":null,"max_poc_stars":null,"metasploit":null,"nuclei":null,"refs":[],"tier":null},"has_fix":true,"headline":"Inconsistent storage layout for ERC2771ContextUpgradeable","id":"GHSA-7j52-6fjp-58gr","indexable":true,"kev":null,"kind":"advisory","links":{"ecosystem":"npm","product":null,"products":[],"type":null,"year":"2022"},"n_packages":2,"n_references":null,"packages":[{"ecosystem":"npm","fixed":["4.3.0"],"introduced":["4.0.0"],"last_affected":[],"package":"@openzeppelin/contracts-upgradeable","purl":null,"source":"GHSA-7j52-6fjp-58gr"},{"ecosystem":"npm","fixed":["4.3.0"],"introduced":["4.0.0"],"last_affected":[],"package":"@openzeppelin/contracts-upgradeable","purl":"pkg:npm/%40openzeppelin/contracts-upgradeable","source":"GHSA-7j52-6fjp-58gr"}],"products":null,"published":"2022-03-14","related":[],"sources":[{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"}],"ssvc":{"automatable":null,"exploitation":null,"technical_impact":null},"state":null,"updated":null,"vendors":null},"summary":null,"url":"https://insights.sbomify.com/GHSA-7j52-6fjp-58gr/"}