Piwigo
Piwigo RCE via PHP Code Injection into Config File in Installer
The Piwigo installer in versions 16.3.0 and earlier accepts POST parameters for database configuration and writes them directly into a PHP configuration file without proper sanitization. On PHP 8+, the `addslashes()` protection is bypassed because it checks for `get_magic_quotes_gpc()`, a function removed in PHP 8.0. This allows raw user input to be interpolated directly into PHP source code. An unauthenticated attacker can inject arbitrary PHP code through POST parameters (prefix, dbpasswd, dbhost, dbname, or dbuser), which gets written to `local/config/database.inc.php` and executed on every page load.
Affected versions and mitigation
From the CVE record and the vendor's references.Affected
- <= 16.3.0
Mitigation
The record names no fix. Check the vendor advisory below.
References
- Vendor advisory github.com/Piwigo/Piwigo/security/advisories/G…
Timeline
Days relative to CVE publicationNo public PoC found yet; not in CISA KEV.
PoC repositories
Found on GitHub.No PoC repositories found yet.