Soroban-Poseidon Cryptographic Hash Function Collision Vulnerability

Vulnerability

A vulnerability in the Soroban-Poseidon library's Poseidon V1 hash function allows for hash collisions due to improper handling of variable-length inputs. When fewer inputs are provided than the sponge rate, the missing positions are automatically filled with zeros. This behavior can be exploited to create identical hash outputs for different input vectors, leading to trivial collisions. The issue arises in any scenario where the number of inputs is less than the sponge rate minus one, such as hashing a single input with a rate of three.

Impact

The vulnerability allows for hash collisions in the Poseidon V1 hash function, undermining the integrity of the hashing process by producing identical hash values for different input vectors.

Reproduction

To reproduce this vulnerability, use the Poseidon V1 hash function (PoseidonSponge) and provide an input vector with fewer elements than the sponge rate minus one. For example, hashing one input with a sponge rate of three will trigger the collision, as the function will zero-fill the unused rate position, creating a duplicate hash for the modified input vector.

Remediation

Users should upgrade to Soroban-Poseidon version 25.0.1, which fixes the collision vulnerability by enforcing that the number of inputs equals the sponge rate. Alternatively, if an upgrade is not possible, ensure that the number of inputs matches the sponge rate requirements or migrate to Poseidon2, which safely handles variable-length inputs.

Added: Mar 12, 2026, 6:21 PM
Updated: Mar 12, 2026, 6:21 PM

Vulnerability Rating

Custom Algorithm
spread
0.0
impact
2.5
exploitability
7.7
remediation
0.0
relevance
3.8
threat
1.6
urgency
2.9
incentive
4.2

Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.