Skip to main content

Piwigo CVE-2026-44642

| EUVDEUVD-2026-87137 HIGH
SQL Injection (CWE-89)
2026-09-25 GitHub_M
8.1
CVSS 3.1 · Vendor: GitHub_M
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Identify Piwigo on PHP 8+ with pending DB upgrade
  2. Delivery
    Send crafted username to upgrade auth endpoint
  3. Exploit
    Injected SQL manipulates auth query result
  4. Execution
    Satisfy status/password checks, set PHPWG_IN_UPGRADE
  5. Impact
    Authorize upgrade, alter database and disrupt service

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Parameterized queries, prepared statements
MITRE ATT&CK

2 techniques across 2 tactics: Initial Access, Persistence

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Two concrete prerequisites must both hold: (1) the Piwigo instance runs on PHP 8.0 or later, where the get_magic_quotes_gpc function no longer exists so the conditional addslashes escaping in check_upgrade_access_rights() is skipped; and (2) the instance is in a pending-database-upgrade state, making the upgrade authentication path reachable. The attacker must also craft a SQL-injected username whose query result satisfies both the status and password checks to set PHPWG_IN_UPGRADE. Limiting factors: exploitation is only possible during the transient upgrade-pending window (typically right after code is updated but before the DB migration runs), which is why CVSS assigns AC:H; no authentication or user interaction is required (PR:N/UI:N). Affected: all Piwigo versions prior to 16.4.0.

Impact

The CVSS 3.1 vector (AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H, base 8.1) frames this as a network-reachable, unauthenticated SQL injection with high impact, but AC:H is the honest and decisive signal: exploitation is gated on a specific transient state - the Piwigo instance must have pending database upgrades so the install/upgrade authentication path in check_upgrade_access_rights() is reachable, and the attacker must craft a query result that satisfies both the status and password checks to set PHPWG_IN_UPGRADE. The root cause is real and clean: the escaping of the submitted username was conditioned on the get_magic_quotes_gpc function, which was removed in PHP 8, so on any PHP 8+ deployment the username is concatenated directly into the auth SQL query (CWE-89). There is no EPSS score, no CISA KEV listing, and no public exploit in the provided intelligence, so this is 'no public exploit identified at time of analysis' - not confirmed exploitation. Net: a genuine unauthenticated auth-bypass/SQLi that deserves patching, but the pending-upgrade window and the PHP-8+ condition make it opportunistic and time-bounded rather than a broadly wormable mass-exploitation target. The 8.1 rating is defensible on impact but the practical real-world risk is moderated by the narrow trigger window.

Exploit ScenarioDerived

An attacker who discovers a Piwigo site running on PHP 8+ that has been code-updated but not yet database-migrated (upgrade pending) sends crafted input to the upgrade authentication endpoint, injecting SQL into the username that is concatenated unescaped into the auth query. By shaping the query result to satisfy the status and password checks, the attacker sets PHPWG_IN_UPGRADE and authorizes upgrade execution without valid administrator credentials, leading to unauthorized database changes and service disruption. No public proof-of-concept is referenced in the available data.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 1.3% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Sep 25, 2026

Unauthenticated SQL injection in Piwigo's pending-database-upgrade authentication path lets a remote attacker bypass administrator credentials and trigger the upgrade routine on affected galleries. The flaw lives in check_upgrade_access_rights() (admin/include/functions_upgrade.php), which only applies addslashes() escaping when the legacy get_magic_quotes_gpc function exists; because that function was removed in PHP 8.0, any Piwigo instance prior to 16.4.0 running PHP 8 concatenates the submitted username straight into the upgrade authentication query. Exploitation is gated on a transient state - the instance must have a pending database upgrade so this code path is reachable - and requires a crafted query result that satisfies both the status and password checks to set PHPWG_IN_UPGRADE, which is why the assessed vector carries AC:H. There is no public exploit code and no confirmed active exploitation (CISA KEV) at time of analysis, and an upstream fix is available in Piwigo 16.4.0.

RemediationAI

Vendor-released patch: upgrade to Piwigo 16.4.0 (https://github.com/Piwigo/Piwigo/releases/tag/16.4.0), which restores the correct addslashes() guard condition and refactors the installer's request sanitization; the two upstream commits are 1ff9d04534feb5f8f3cc2d3613c0fe8b51a1c0ba and 2cfa7a3d194c8b95edde43038d8f5be5a359e785 and the security advisory is GHSA-6wj3-7fhw-gfpm. If an immediate upgrade is not possible, the highest-value action is to shrink the exposure window: complete any pending database upgrade as soon as code is deployed so the check_upgrade_access_rights() path is no longer reachable, since exploitation is impossible outside that transient state. Trade-off: this requires a maintenance window and briefly leaves the site in the exact state the attacker targets, so the migration should be run over a trusted connection or from an IP allowlist and confirmed complete immediately. Additionally, restrict network access to /install.php and the admin upgrade endpoints with web-server or reverse-proxy rules (deny all except known administrator IPs), which removes remote reachability to the vulnerable routine; the trade-off is that legitimate administrators must use the allowlisted network or an out-of-band path during upgrades, and the rule must be kept in sync with real admin addresses. A WAF or reverse-proxy rule blocking SQL metacharacters in the username/upgrade parameters of install.php is a weaker compensating control that reduces exploitability but can be bypassed and may interfere with legitimate non-ASCII usernames. Note that simply running an older PHP version is not an acceptable mitigation, as it re-exposes the instance to other unsupported-runtime risks. No vendor workaround substitutes for the 16.4.0 patch, and no public exploit code or confirmed active exploitation was identified at the time of this analysis.

Affected VersionsENISA

piwigo < 16.4.0

Affected Packages

euvd piwigo fix: 16.4.0

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

The root cause is CWE-89 (SQL injection) arising from an environment-dependent sanitization guard rather than from a missing abstraction. In the vulnerable code, escaping of request input was conditioned on if(function_exists('get_magic_quotes_gpc') && !@get_magic_quotes_gpc()). This was historically correct: on PHP 5.x/7.x with magic_quotes_gpc disabled, the branch executed and addslashes() protected the query; when magic quotes were enabled, PHP itself escaped input. PHP 8.0 removed get_magic_quotes_gpc entirely, so function_exists() returns false, the whole condition short-circuits to false, and no escaping occurs at all - silently converting a legacy defensive shim into an injection point. The upstream fix inverts and broadens the guard to !function_exists('get_magic_quotes_gpc') or !@get_magic_quotes_gpc(), restoring addslashes() on modern PHP, and additionally refactors install.php to use array_walk_recursive() with a sanitize_mysql_kv() callback over $_GET, $_POST and $_COOKIE so the same PHP 8 blind spot cannot recur elsewhere in the installer/bootstrap. The affected component is the upgrade authorization routine: an attacker-supplied username flows into the SQL query used to verify upgrade privileges, and a carefully crafted result can satisfy the status and password checks, set PHPWG_IN_UPGRADE, and authorize execution of the pending schema migration. The CPE cpe:2.3:a:piwigo:piwigo:*:*:*:*:*:*:*:* denotes all Piwigo releases below 16.4.0; effective exposure additionally requires PHP >= 8.0 and a pending database upgrade. The reported CVSS 3.1 base is 8.1 (AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H), while this independent assessment scores the same reachability with confidentiality Low (C:L/I:H/A:H), reflecting that the injection targets authentication and upgrade state rather than a broad data-disclosure primitive; both agree the attack is network-reachable and unauthenticated (PR:N/UI:N) and that AC:H is the decisive modifier.

Know when Piwigo gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (GitHub_M) PRIMARY 8.1 HIGH
AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
vuln.today AI 7.7 HIGH

Network unauthenticated (AV:N/PR:N) but AC:H due to required PHP-8+ plus pending-upgrade window; primary impact is auth-bypass driving DB integrity changes and service disruption (I:H/A:H), confidentiality via blind SQLi is secondary (C:L).

3.1 AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:H/A:H
4.0 AV:N/AC:H/AT:P/PR:N/UI:N/VC:L/VI:H/VA:H/SC:N/SI:N/SA:N

Primary rating from Vendor (GitHub_M).

CVSS VectorVendor: GitHub_M

Attack Vector
Network
Attack Complexity
High
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

Lifecycle Timeline

2
Patch available
Sep 25, 2026 - 17:04 EUVD
CVE Published
Sep 25, 2026 - 15:47 cve.org
HIGH 8.1

DescriptionCVE.org

Piwigo is a full featured open source photo gallery application for the web. Prior to 16.4.0, check_upgrade_access_rights() in admin/include/functions_upgrade.php conditionally escapes the submitted username only when the removed get_magic_quotes_gpc function exists, so PHP 8 and later concatenate an unauthenticated username directly into the upgrade authentication SQL query. When database upgrades are pending, a crafted query result can satisfy the status and password checks, set PHPWG_IN_UPGRADE, and authorize upgrade execution without valid administrator credentials. This can cause unauthorized database integrity changes and service disruption. This vulnerability is fixed in 16.4.0.

Technical POC Analysis

CWE-89 (SQL injection).

Full technical POC analysis - root cause, step-by-step exploitation and patch breakdown - is part of the Pro and Business plans.

Executive ViewAI

Why It Matters

A credential-bypass flaw in Piwigo photo gallery software could give an outside attacker administrator-level control of any gallery running PHP 8 on versions prior to 16.4.0 while it is mid-way through a database upgrade, allowing content to be exposed, altered, or used as a foothold into the hosting environment. The affected population is the teams and business units operating internet-facing Piwigo galleries, and the exposure persists because those instances cannot yet be remediated with a vendor patch in our current data. Leadership should care because a public-facing admin compromise carries reputational, data-protection, and downstream lateral-movement consequences disproportionate to the modest effort required to reach the vulnerable code path.

Business Impact: High
Compensating Controls

Apply vendor patch (Piwigo 16.4.0 per the upstream fix); where upgrade is not yet possible, complete any pending database upgrades to eliminate the transient precondition, restrict access to the admin and upgrade paths to trusted networks, and filter SQL injection attempts against those endpoints at the WAF. No public exploit code or confirmed active exploitation (CISA KEV) was identified at time of analysis, and the vulnerable code path is only reachable while a database upgrade is pending.

Threat Intelligence Overview

EPSS Score
1.3%
Top 31% exploitable
Prevalence
Low
niche self-hosted open-source photo gallery, no broad enterprise footprint
Data Quality
4 sources
Confidence: Medium

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 1.3%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Scheduled
Exploitation
Poc
System Exposure· derived
Open
Automatable
No
Human Impact
High
Technical Impact
Total

Priority Score

41
Low Medium High Critical
KEV: 0
EPSS: +1
CVSS: +40
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

SQL injection exploits the way applications construct database queries by mixing user input directly into SQL statements.

More in Piwigo

View all
CVE-2013-1469 MEDIUM POC
4.0 Mar 13

Directory traversal vulnerability in install.php in Piwigo before 2.4.7 allows remote attackers to read and delete arbit

CVE-2013-1468 HIGH POC
7.6 Mar 14

Cross-site request forgery (CSRF) vulnerability in the LocalFiles Editor plugin in Piwigo before 2.4.7 allows remote att

CVE-2017-10682 CRITICAL POC
9.8 Jun 29

SQL injection vulnerability in the administrative backend in Piwigo through 2.9.1 allows remote users to execute arbitra

CVE-2023-33362 CRITICAL POC
9.8 May 23

Piwigo 13.6.0 is vulnerable to SQL Injection via in the "profile" function. Rated critical severity (CVSS 9.8), this vul

CVE-2023-33361 CRITICAL POC
9.8 May 23

Piwigo 13.6.0 is vulnerable to SQL Injection via /admin/permalinks.php. Rated critical severity (CVSS 9.8), this vulnera

CVE-2021-32615 CRITICAL POC
9.8 May 13

Piwigo 11.4.0 allows admin/user_list_backend.php order[0][dir] SQL Injection. Rated critical severity (CVSS 9.8), this v

CVE-2019-13364 CRITICAL POC
9.6 Sep 13

admin.php?page=account_billing in Piwigo 2.9.5 has XSS via the vat&#95;number, billing&#95;name, company, or billing&#95

CVE-2019-13363 CRITICAL POC
9.6 Sep 13

admin.php?page=notification_by_mail in Piwigo 2.9.5 has XSS via the nbm&#95;send&#95;html&#95;mail, nbm&#95;send&#95;mai

CVE-2017-10681 HIGH POC
8.8 Jun 29

Cross-site request forgery (CSRF) vulnerability in Piwigo through 2.9.1 allows remote attackers to hijack the authentica

CVE-2017-10680 HIGH POC
8.8 Jun 29

Cross-site request forgery (CSRF) vulnerability in Piwigo through 2.9.1 allows remote attackers to hijack the authentica

CVE-2017-10678 HIGH POC
8.8 Jun 29

Cross-site request forgery (CSRF) vulnerability in Piwigo through 2.9.1 allows remote attackers to hijack the authentica

CVE-2017-17774 HIGH POC
8.8 Dec 20

admin/configuration.php in Piwigo 2.9.2 has CSRF. Rated high severity (CVSS 8.8), this vulnerability is remotely exploit

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy