
Cloud Vulnerability DB
A community-led vulnerabilities database
The vulnerability (GHSA-h6xm-c6r4-vmwf) affects the spl-token-swap Rust library, discovered and disclosed on December 23, 2024. The issue involves unsound implementations of u8 type casting in the library's public API unpack function, which can lead to undefined behaviors when casting u8 arrays to arbitrary types. This vulnerability affects all versions up to and including 3.0.0, with no patched versions currently available (GitHub Advisory, RustSec Advisory).
The vulnerability stems from the instruction::unpack function's implementation where it performs unsafe casting of u8 arrays to arbitrary types. While the function includes length checks to prevent out-of-bound access, it fails to handle two critical issues: misaligned pointer dereferencing when casting u8 pointer to types aligned to larger bytes (e.g., u16), and the potential construction of illegal types when casting to types with specific bit pattern requirements (e.g., bool which can only have 0 or 1 as valid values). The issue has been classified with moderate severity (GitHub Advisory, SPL Issue).
The vulnerability can result in undefined behaviors in Rust programs using the spl-token-swap library. When exploited, it can cause program panics due to misaligned pointer dereferences and potentially construct invalid values that violate Rust's type safety guarantees. The full extent of potential exploits remains unclear, but the issue fundamentally undermines Rust's safety guarantees (RustSec Advisory).
Currently, there are no patched versions available for this vulnerability. The spl-token-swap library has been unmaintained for several years except for dependency upgrades, and the Solana Program Library (SPL) team has indicated that the program is being moved to separate repositories, with spl-token-swap not being carried forward (SPL Issue).
The vulnerability has been included in the RustSec advisory database and will be surfaced by security tools such as cargo-audit or cargo-deny as a warning rather than a hard error, given its nature as an API soundness issue. The Solana Program Library team has acknowledged the issue but indicated that spl-token-swap is being discontinued as part of their repository reorganization (SPL Issue).
Source: This report was generated using AI
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."