Piwigo Secret Key Brute-Forcing Vulnerability in Photo Gallery Application

Vulnerability

A vulnerability exists in the Piwigo photo gallery application, specifically in the 14.x branch, where the secret_key configuration parameter is generated using MD5(RAND()) in MySQL during installation. This method is insecure because RAND() provides only 30 bits of randomness, allowing the secret key to be brute-forced. The CSRF token, which is partially derived from the secret key, can be used to verify the success of the brute-force attempt. Although this vulnerability is considered moderate, as the auto-login key and pwg token incorporate additional user-specific elements, it still poses a risk by potentially allowing the generation of values for the get_ephemeral_key function if the secret key is known.

Impact

Successful brute-forcing of the secret key, which can then be used to manipulate CSRF tokens and potentially access or modify user session information.

Reproduction

To reproduce this vulnerability, install Piwigo version 14.x and observe the generation of the secret_key parameter in the MySQL database. The key can be brute-forced in approximately one hour, using the CSRF token verification to confirm a successful attempt.

Remediation

Users are advised to update to Piwigo version 15.0.0 or later, where this vulnerability has been fixed.

Added: Feb 24, 2026, 5:38 PM
Updated: Feb 24, 2026, 10:14 PM

Vulnerability Rating

Custom Algorithm
spread
6.4
impact
2.5
exploitability
7.8
remediation
0.0
relevance
3.1
threat
4.8
urgency
2.9
incentive
0.0

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