Skip to content
Heist/ feed
Back to feed
Critical

Piwigo RCE via PHP Code Injection into Config File in Installer

Type: advisorySources: OSV

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.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2026-35048
Confirmed fixed CVEs
Not specified
Updated in this feed
8 Nov 2026, 03:24 UTC · Revision 1

Source evidence

Piwigo RCE via PHP Code Injection into Config File in Installer

core-osv · Original source

Published 20 Jul 2026, 16:27 UTC

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.

osv:CVE-2026-35048
Complete source record
{
  "id": "63321b65b0574beaabc9b51f5827dd2995f9d5b329e8fe0ffa330e6402580be1",
  "url": "https://osv.dev/vulnerability/CVE-2026-35048",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "Piwigo RCE via PHP Code Injection into Config File in Installer",
    "summary": "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.",
    "evidence": "osv:CVE-2026-35048",
    "products": [],
    "severity": "critical",
    "structured": {
      "id": "CVE-2026-35048",
      "aliases": [
        "CVE-2026-35048",
        "GHSA-gphq-34pv-gvf3"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/piwigo/piwigo",
              "type": "GIT",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "last_affected": "69f1f76192e6e692f575a5f79c194655dee2d5ca"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "range": [
                      {
                        "introduced": "0"
                      },
                      {
                        "last_affected": "16.3.0"
                      }
                    ],
                    "source": "AFFECTED_FIELD",
                    "strategy": "StringRangeExpression"
                  },
                  {
                    "range": [
                      {
                        "introduced": "0"
                      },
                      {
                        "last_affected": "16.3.0"
                      }
                    ],
                    "source": "DESCRIPTION"
                  }
                ]
              }
            }
          ],
          "versions": [
            "16.3.0",
            "16.2.0",
            "16.1.0",
            "16.0.0",
            "16.0.0RC3",
            "16.0.0RC2",
            "16.0.0RC1",
            "16.0.0beta2",
            "16.0.0beta1",
            "15.0.0beta3",
            "15.0.0beta2",
            "15.0.0beta1",
            "14.0.0RC2",
            "14.0.0RC1",
            "14.0.0beta3",
            "14.0.0beta2",
            "14.0.0beta1",
            "13.0.0RC4",
            "13.0.0RC3",
            "13.0.0RC2",
            "13.0.0RC1",
            "13.0.0beta2",
            "13.0.0beta1",
            "12.0.0RC2",
            "12.0.0RC1",
            "12.0.0beta2",
            "12.0.0beta1",
            "2.11.0beta4",
            "2.11.0beta3",
            "2.11.0beta2",
            "2.11.0beta1",
            "2.10.0RC1",
            "2.10.0beta2",
            "2.10.0beta1",
            "2.9.0RC2",
            "2.9.0RC1",
            "2.9.0beta2",
            "2.9.0beta1",
            "2.8.0RC2",
            "2.8.0RC1"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-35048.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:53.529307351Z",
      "provider": "osv",
      "references": [
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/35xxx/CVE-2026-35048.json",
        "https://github.com/Piwigo/Piwigo/security/advisories/GHSA-gphq-34pv-gvf3",
        "https://nvd.nist.gov/vuln/detail/CVE-2026-35048"
      ],
      "provider_metadata": {
        "cwe_ids": [
          "CWE-20"
        ],
        "cna_assigner": "GitHub_M",
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/35xxx/CVE-2026-35048.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2026-35048",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 522183,
  "published_at": "2026-07-20T16:27:09.513+00:00"
}