Improper Input ValidationWeakness · CWE-20

CVE-2026-35048

CRITICAL · 9.8 CVSS v3.1 Published 2026-07-20
Mitigation only
No fix yet — a mitigation exists. There is no fixed release. A documented workaround reduces exposure in the meantime.
See remediation →
100/100
Remediation priority · Urgent
Remotely reachable No privileges Zero-click 4 weeks old

Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.

NVD · unedited
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.

Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.

dbcve analysis · high confidence

This is a PHP code injection vulnerability in the Piwigo installer (versions 16.3.0 and earlier) where database configuration POST parameters are written directly to `local/config/database.inc.php` without proper sanitization. The protection using `addslashes()` checks for `get_magic_quotes_gpc()`, a function removed in PHP 8.0, effectively bypassing the protection on modern PHP versions and allowing unauthenticated attackers to inject arbitrary PHP code via POST parameters (prefix, dbpasswd, dbhost, dbname, or dbuser).

MitigationUpgrade Piwigo to a version beyond 16.3.0 which should contain proper input sanitization, and delete or disable the installer after initial setup. If patching is required, implement proper escaping/sanitization for all database configuration parameters before writing to the PHP config file.

Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.

CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.

From the vector
Attack vector
Network
Complexity
Low
Privileges
None
User interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.

dbcve checks

Work through these to decide whether this CVE applies to you.

  1. Check installed Piwigo version
    Locate the version file (typically include/constants.inc.php or a VERSION file in the Piwigo root directory) and read the version number.
    Affected if The installed version is 16.3.0 or earlier.
  2. Check PHP version
    Run `php -v` from command line or use `phpinfo()` to determine the PHP version.
    Affected if PHP version is 8.0 or higher.
  3. Verify installer accessibility
    Check if the Piwigo installer script exists and is accessible via HTTP (typically at /install.php or /admin/install.php). Attempt to access it in a non-production manner or check web server logs for access attempts.
    Affected if The installer file exists and is accessible (not removed or restricted).
  4. Inspect database config file for injected code
    Read the file local/config/database.inc.php (or the equivalent config path) and examine the values for variables like $conf['db_host'], $conf['db_user'], $conf['db_password'], $conf['db_name'], and $conf['table_prefix']. Look for unexpected PHP code patterns such as <?php, eval(), system(), or other suspicious syntax.
    Affected if The config file contains any PHP code injection patterns in the configuration values.
  5. Check for recent unauthorized modifications to config
    Review file modification timestamps on local/config/database.inc.php and compare with expected deployment times. Check web server access logs for POST requests to the installer around the time of any unexpected modifications.
    Affected if The config file was modified at an unexpected time or shows signs of unauthorized write operations.

A user is affected if running Piwigo version 16.3.0 or earlier on PHP 8.0+ with the installer still accessible, or if local/config/database.inc.php contains suspicious PHP code patterns.

Generated from the published advisory. Verify against your own configuration.

Check your environment

Paste your version and any relevant configuration and it will be compared against the affected criteria above. Do not include secrets or credentials.

AI-assisted, checked against the advisory. Informational, not a guarantee.

Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.

dbcve · scoped
Mitigation available No clean upgrade yet — mitigate in the meantime
Mitigation

Upgrade Piwigo to a version beyond 16.3.0 which should contain proper input sanitization, and delete or disable the installer after initial setup. If patching is required, implement proper escaping/sanitization for all database configuration parameters before writing to the PHP config file.

Recommended fix Moderate confidence

Piwigo version newer than 16.3.0 (check GitHub releases for the specific fixed release)

  1. 1. Download the latest version of Piwigo from the official repository or website.
  2. 2. Before upgrading, back up your existing Piwigo installation and database.
  3. 3. Ensure your PHP version is compatible with the new Piwigo version (note: PHP 8+ is required for the fix to work properly).
  4. 4. Upload and extract the new Piwigo files to your web server, replacing the old installation.
  5. 5. Run the upgrade process by accessing your Piwigo site - the new version will include the fixed installer with proper input sanitization.
  6. 6. After upgrade, verify that local/config/database.inc.php exists and has properly escaped values.
Caveat Review Piwigo release notes for any breaking changes between 16.3.0 and the target version, particularly regarding PHP 8+ compatibility requirements

Generated from the published advisory — verify against the referenced sources before acting.

Have this fixed Scoped from the published advisory
  • Consultation2.0 h
  • Implementation4.0 h
  • Testing3.0 h
  • Review / QA2.0 h
11.0 hours of engineering $1,930
Get help mitigating

An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $3,088.

Scan for this in your stack

Free · runs locally
dbcve dependency scanner

Check whether your project pulls in CVE-2026-35048 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.

References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.

Primary sources

Practitioner notes

Contributed

Peer-ranked notes from engineers who’ve handled CVE-2026-35048 in production — separate from our analysis above.

No notes yet

Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.

What this is

A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.

What belongs here
  • Verified mitigations, workarounds, and config changes
  • Version or environment caveats, and links to real fixes
  • No weaponised exploit code, or anything meant to cause harm
  • No spam, self-promotion, credentials, or personal data