{"answers":{"affected":"3 open source packages ship an affected version, including enumflags2.","exploited":"There is no known exploitation of GHSA-qvc4-78gw-pv8p in the wild and no public exploit code.","fix":"Upgrade enumflags2 to 0.7.7 or later.","what":"GHSA-qvc4-78gw-pv8p is a memory corruption vulnerability in enumflags2, published on 17 Apr 2023."},"fix_prompt":"Check this codebase for GHSA-qvc4-78gw-pv8p and fix it if it is affected.\n\nWhat it is: GHSA-qvc4-78gw-pv8p is a memory corruption vulnerability in enumflags2, published on 17 Apr 2023. \nExploitation: There is no known exploitation of GHSA-qvc4-78gw-pv8p in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- enumflags2 (crates.io): affected from 0.7.0; fixed in 0.7.7\n- enumflags2 (crates.io): affected from 0.7.0; fixed in 0.7.7\n- enumflags2 (crates.io): affected from 0.7.0; fixed in 0.7.7\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-qvc4-78gw-pv8p/ (Markdown: https://insights.sbomify.com/GHSA-qvc4-78gw-pv8p/index.md)","id":"GHSA-qvc4-78gw-pv8p","markdown":"https://insights.sbomify.com/GHSA-qvc4-78gw-pv8p/index.md","name":"GHSA-qvc4-78gw-pv8p","record":{"aliases":["RUSTSEC-2023-0035"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["code_execution","denial_of_service"],"network_reachable":"unknown","non_default_config":false,"product_category":"Rust enumflags2 library","requires_auth":"none","summary":"Adversarial use of the make_bitflags! macro can cause undefined behavior, potentially leading to crashes or code execution in applications using the enumflags2 library.","user_interaction":"not_required","vuln_class":"memory_corruption"},"analysis_generated_by":"qwen3.8-flash-next","assigner":null,"cpe":[],"cvss":{"score":null,"severity":null,"source":null,"vector":null,"version":null},"cwes":[],"description":"The macro relied on an expression of the form `Enum::Variant` always being a\nvariant of the enum. However, it may also be an associated integer constant, in\nwhich case there's no guarantee that the value of said constant consists only of\nbits valid for this bitflag type.\n\nThus, code like this could create an invalid `BitFlags\u003cTest\u003e`, which would cause\niterating over it to trigger undefined behavior. As the debug formatter\ninternally iterates over the value, it is also affected.\n\n```rust\nuse enumflags2::{bitflags, make_bitflags};\n\n#[bitflags]\n#[repr(u8)]\n#[derive(Copy, Clone, Debug)]\nenum Test {\n    A = 1,\n    B = 2,\n}\n\nimpl Test {\n    const C: u8 = 69;\n}\n\nfn main() {\n    let x = make_bitflags!(Test::{C});\n    // printing or iterating over x is UB\n}\n```","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":"Adverserial use of `make_bitflags!` macro can cause undefined behavior","id":"GHSA-qvc4-78gw-pv8p","indexable":true,"kev":null,"kind":"advisory","links":{"ecosystem":"crates.io","product":null,"products":[],"type":"memory_corruption","year":"2023"},"n_packages":3,"n_references":null,"packages":[{"ecosystem":"crates.io","fixed":["0.7.7"],"introduced":["0.7.0"],"last_affected":[],"package":"enumflags2","purl":null,"source":"GHSA-qvc4-78gw-pv8p"},{"ecosystem":"crates.io","fixed":["0.7.7"],"introduced":["0.7.0"],"last_affected":[],"package":"enumflags2","purl":"pkg:cargo/enumflags2","source":"GHSA-qvc4-78gw-pv8p"},{"ecosystem":"crates.io","fixed":["0.7.7"],"introduced":["0.7.0"],"last_affected":[],"package":"enumflags2","purl":"pkg:cargo/enumflags2","source":"RUSTSEC-2023-0035"}],"products":null,"published":"2023-04-17","related":[],"sources":[{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"open","licence":"CC0 1.0","name":"RustSec","prefix":"RUSTSEC"}],"ssvc":{"automatable":null,"exploitation":null,"technical_impact":null},"state":null,"updated":null,"vendors":null},"summary":"Adversarial use of the make_bitflags! macro can cause undefined behavior, potentially leading to crashes or code execution in applications using the enumflags2 library.","url":"https://insights.sbomify.com/GHSA-qvc4-78gw-pv8p/"}