Executive brief
Streamlit is a popular Python library used to build and share data applications. A vulnerability in its caching mechanism could allow a local attacker to cause hash collisions, potentially leading to incorrect data being served from the cache or a minor service disruption. This occurs when the application processes specific types of image data or very large datasets, where the system fails to uniquely identify different inputs.
Technical details
A vulnerability exists in Streamlit's hashing logic within lib/streamlit/runtime/caching/hashing.py. The implementation used a hardcoded random seed (0) when sampling large pandas, polars, and numpy objects for cache key generation, making the sampled rows predictable and prone to collisions. Additionally, the hasher omitted palette bytes for PIL P-mode images, causing images with identical pixel indices but different color palettes to produce the same hash. An attacker with local access could exploit these collisions to manipulate cache integrity or cause minor availability issues. The issue is fixed in version 1.53.1 by implementing data-dependent seeds and including palette bytes in the hash.
Affected products
- Streamlit Streamlit < 1.53.1
Timeline
- 2026-04-04: disclosed: Issue and fix PR opened on GitHub
- 2026-06-04: advisory: Published to GitHub Advisory Database and NVD
- 2026-07-15: patched: Advisory updated to reflect patched status in 1.53.1