{"answers":{"affected":"3 open source packages ship an affected version, including spl-token-swap.","exploited":"There is no known exploitation of GHSA-h6xm-c6r4-vmwf in the wild and no public exploit code.","fix":"No fix has been published for GHSA-h6xm-c6r4-vmwf yet. Limit exposure of the affected software until one is available.","what":"GHSA-h6xm-c6r4-vmwf is a memory corruption vulnerability in spl-token-swap, published on 19 Dec 2024. An attacker can exploit it over the internet without logging in, with no action from the victim."},"fix_prompt":"Check this codebase for GHSA-h6xm-c6r4-vmwf and fix it if it is affected.\n\nWhat it is: GHSA-h6xm-c6r4-vmwf is a memory corruption vulnerability in spl-token-swap, published on 19 Dec 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.\nExploitation: There is no known exploitation of GHSA-h6xm-c6r4-vmwf in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- spl-token-swap (crates.io): affected all versions up to 3.0.0; no fix listed\n- spl-token-swap (crates.io): affected all versions up to 3.0.0; no fix listed\n- spl-token-swap (crates.io): affected from 0.0.0-0; no fix listed\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-h6xm-c6r4-vmwf/ (Markdown: https://insights.sbomify.com/GHSA-h6xm-c6r4-vmwf/index.md)","id":"GHSA-h6xm-c6r4-vmwf","markdown":"https://insights.sbomify.com/GHSA-h6xm-c6r4-vmwf/index.md","name":"GHSA-h6xm-c6r4-vmwf","record":{"aliases":["RUSTSEC-2024-0426"],"analysis":{"component_type":"library","fix_type":"patch","impacts":["denial_of_service","code_execution"],"network_reachable":"yes","non_default_config":false,"product_category":"Solana token swap library","requires_auth":"none","summary":"Unsound u8 casting in spl-token-swap allows misaligned pointer dereference or illegal type construction, potentially causing panics or undefined behavior.","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 library provides a safe public API `unpack` to cast `u8` array to arbitrary types, which can cause to undefined behaviors. The length check of array can only prevent out-of-bound access on the return type. However, it can't prevent misaligned pointer when casting `u8` pointer to a type aligned to larger bytes. For example, if we assign `u16` to `T`, **misaligned raw pointer dereference** could happen and cause to panic. Even if we pass the type aligned to same byte as `u8` (e.g., `bool`), it could construct a illegal type since `bool` can only have 0 or 1 as bit patterns, which is also an undefined behavior. The further exploits of the bug here are still not clear, so we would report this issue as unsound.  \n\nThe details of PoC to reproduce undefined behavior are provided in the [issue](https://github.com/solana-labs/solana-program-library/issues/5243).","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":false,"headline":"Unsound usages of `u8` type casting in spl-token-swap","id":"GHSA-h6xm-c6r4-vmwf","indexable":true,"kev":null,"kind":"advisory","links":{"ecosystem":"crates.io","product":null,"products":[],"type":"memory_corruption","year":"2024"},"n_packages":3,"n_references":null,"packages":[{"ecosystem":"crates.io","fixed":[],"introduced":["0"],"last_affected":["3.0.0"],"package":"spl-token-swap","purl":null,"source":"GHSA-h6xm-c6r4-vmwf"},{"ecosystem":"crates.io","fixed":[],"introduced":["0"],"last_affected":["3.0.0"],"package":"spl-token-swap","purl":"pkg:cargo/spl-token-swap","source":"GHSA-h6xm-c6r4-vmwf"},{"ecosystem":"crates.io","fixed":[],"introduced":["0.0.0-0"],"last_affected":[],"package":"spl-token-swap","purl":"pkg:cargo/spl-token-swap","source":"RUSTSEC-2024-0426"}],"products":null,"published":"2024-12-19","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":"Unsound u8 casting in spl-token-swap allows misaligned pointer dereference or illegal type construction, potentially causing panics or undefined behavior.","url":"https://insights.sbomify.com/GHSA-h6xm-c6r4-vmwf/"}