{"answers":{"affected":"2 open source packages ship an affected version, including mpl-candy-machine.","exploited":"There is no known exploitation of GHSA-9v25-r5q2-2p6w in the wild and no public exploit code.","fix":"Upgrade mpl-candy-machine to 4.5.1 or later.","what":"GHSA-9v25-r5q2-2p6w is a vulnerability in mpl-candy-machine, published on 12 Dec 2022. Any signed-in user can exploit it over the network, with no action from the victim."},"fix_prompt":"Check this codebase for GHSA-9v25-r5q2-2p6w and fix it if it is affected.\n\nWhat it is: GHSA-9v25-r5q2-2p6w is a vulnerability in mpl-candy-machine, published on 12 Dec 2022. Any signed-in user can exploit it over the network, with no action from the victim.\nExploitation: There is no known exploitation of GHSA-9v25-r5q2-2p6w in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- mpl-candy-machine (crates.io): affected from 4.5.0; fixed in 4.5.1\n- mpl-candy-machine (crates.io): affected from 4.5.0; fixed in 4.5.1\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-9v25-r5q2-2p6w/ (Markdown: https://insights.sbomify.com/GHSA-9v25-r5q2-2p6w/index.md)","id":"GHSA-9v25-r5q2-2p6w","markdown":"https://insights.sbomify.com/GHSA-9v25-r5q2-2p6w/index.md","name":"GHSA-9v25-r5q2-2p6w","record":{"aliases":[],"analysis":{"component_type":"library","fix_type":"patch","impacts":["data_modify"],"network_reachable":"yes","non_default_config":false,"product_category":"Solana NFT library","requires_auth":"low_privilege","summary":"Attackers can mint NFTs to arbitrary collections in Candy Machine V2 by bypassing validation checks, allowing unauthorized collection membership.","user_interaction":"not_required","vuln_class":"business_logic"},"analysis_generated_by":"qwen3.8-flash-next","assigner":null,"cpe":[],"cvss":{"score":null,"severity":null,"source":null,"vector":null,"version":null},"cwes":[],"description":"A problem with Candy Machine V2 allow minting NFTs to an arbitrary collection due to a missing check.\n\nHere is a description of the exploit:\nDetails:\nHere is the tx/ix to exploit:\nTransaction:\nIx 1: candy_machine v2, mint_nft, passing in empty metadata -1\nIx 2: custom handler, 0\n\t\tcpi A --\u003e token_metadata create_metadata_account, creates NFT\n\t\tcpi B --\u003e candy_machine v2, set_collection_during_mint\nIx 1 passes our first check for empty metadata, but eventually will hit a bot tax and return Ok.  We do have a CPI check in this function but even if we hit that or moved it to the top, it returns Ok as a bot tax and still enables the issue.\nIx 2, cpi A is Ok and mints an arbitrary NFT.\nIx 2, cpi B checks the previous instruction using index_relative_to_current-1.  This turns out to be Ix 1 which was Ok, so then your newly minted arbitrary NFT is successfully added to the collection.\nConclusion:\nCandy machine could be out of NFTs and it still works.  If the CM is closed, (we think?) it doesn't get to the check.\nThe fix needs to be in set_collection_during_mint that current program ID id candy_machine_v2.  It checks previous program ID but doesn't check current.\n\nNOTE: THIS DOES NOT AFFECT Cmv3","ecosystems":["crates.io"],"exploits":{"exploitdb":null,"first_seen":null,"github_poc":null,"max_poc_stars":null,"metasploit":null,"nuclei":null,"refs":[],"tier":null},"has_fix":true,"headline":"Candy Machine Set Collection During Mint Missing Check","id":"GHSA-9v25-r5q2-2p6w","indexable":true,"kev":null,"kind":"advisory","links":{"ecosystem":"crates.io","product":null,"products":[],"type":"business_logic","year":"2022"},"n_packages":2,"n_references":null,"packages":[{"ecosystem":"crates.io","fixed":["4.5.1"],"introduced":["4.5.0"],"last_affected":[],"package":"mpl-candy-machine","purl":null,"source":"GHSA-9v25-r5q2-2p6w"},{"ecosystem":"crates.io","fixed":["4.5.1"],"introduced":["4.5.0"],"last_affected":[],"package":"mpl-candy-machine","purl":"pkg:cargo/mpl-candy-machine","source":"GHSA-9v25-r5q2-2p6w"}],"products":null,"published":"2022-12-12","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":"Attackers can mint NFTs to arbitrary collections in Candy Machine V2 by bypassing validation checks, allowing unauthorized collection membership.","url":"https://insights.sbomify.com/GHSA-9v25-r5q2-2p6w/"}