Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessObtain administrator session on Piwigo
-
DeliverySubmit crafted image_order[] to element_set_ranks.php
-
ExploitMalicious expression stored, bypassing sort whitelist
-
ExecutionTrigger album/Batch Manager query concatenating it into ORDER BY
-
ImpactSQL executes, exfiltrating or corrupting database data
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 | Requires an authenticated Piwigo administrator account with access to the Batch Manager / element ranking feature (admin/element_set_ranks.php), consistent with PR:H. A concrete precondition stated in the advisory: at least one album must contain at least one photo, so that a later album or Batch Manager query (batch_manager_global.php, batch_manager_unit.php, section_init.inc.php, or ws_functions/pwg.categories.php) concatenates the stored image_order expression into an ORDER BY clause and triggers execution. The payload is stored and executes on a subsequent query rather than immediately. Exploitation is limited to Piwigo versions prior to 16.4.0 and is gated by administrator privileges, which materially bounds real-world risk. |
| Impact | The CVSS 3.1 vector (AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H = 7.2 High) is internally consistent with the description: a network-reachable admin panel endpoint, low attack complexity, and no user interaction, but requiring high privileges (PR:H). The single most important limiting signal is PR:H - exploitation requires an authenticated administrator, who in Piwigo already legitimately controls gallery configuration, so this is primarily a privilege-boundary / defense-in-depth issue (config admin → arbitrary SQL) rather than a path to initial compromise. The full C:H/I:H/A:H triad is defensible because a stored SQL injection into ORDER BY clauses lets the attacker disclose, modify, or disrupt arbitrary database contents. No EPSS score, no CISA KEV listing, and no public exploit are present in the input, so there is no evidence of active or opportunistic exploitation - this reads as a real but low-urgency issue: genuinely exploitable, but gated behind admin access and confined to a niche self-hosted application. No signals conflict; the main caveat is that the practical impact of an already-admin attacker gaining SQL execution is bounded in single-tenant deployments but larger where the DB is shared or holds other applications' data. |
| Exploit ScenarioDerived | An authenticated Piwigo administrator (or an attacker who has hijacked an admin session, e.g. via stolen credentials or CSRF) submits a crafted image_order[] value through admin/element_set_ranks.php, which is stored without the sort-field whitelist. When the gallery is next rendered or a Batch Manager query runs, the malicious expression is concatenated into an ORDER BY clause and executed, letting the attacker read, alter, or destroy database data. No public proof-of-concept is identified in the provided data. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Sep 25, 2026
Stored SQL injection in Piwigo photo gallery versions prior to 16.4.0 lets an authenticated administrator store a crafted image_order[] value that is later concatenated into ORDER BY clauses, enabling disclosure, modification, or disruption of database data. Exploitation requires a high-privileged admin account (PR:H per the assessed CVSS 3.1 vector, 7.2 High) and the precondition that at least one album contains at least one photo, so the injected expression is executed on a subsequent album or Batch Manager query rather than immediately. No public exploit code or confirmed active exploitation was identified at time of analysis, and the vendor has released a fixed version, 16.4.0.
RemediationAI
Upgrade to Piwigo 16.4.0 or later - this is the vendor-released fix, shipping the commit that enforces the sort-field whitelist on image_order[] before storage (e.g., only 'file ASC', 'name DESC', 'rank ASC' and similar allow-listed values are accepted). Confirm the deployment matches the 16.4.0 release tag (https://github.com/Piwigo/Piwigo/releases/tag/16.4.0) and consult the vendor advisory (https://github.com/Piwigo/Piwigo/security/advisories/GHSA-jhp4-7f82-8f6q) plus the fix diffs at https://github.com/Piwigo/Piwigo/commit/ba1f803f8cefd3602ccb9c6f0155cd529510288a and https://github.com/Piwigo/Piwigo/commit/ef9e65386d76f9c85f1e23a45dd7af14a5b73a47. If an immediate upgrade is not possible, the exploit is gated by administrator privileges (PR:H), so the most effective compensating control is to restrict admin accounts to fully trusted staff, enforce least privilege, and suspend any admin account that does not require Batch Manager or element-ranking access; the trade-off is reduced operational flexibility for gallery curation. Additional hardening includes placing the Piwigo admin interface behind access controls (VPN, IP allow-list, or HTTP auth) so the vulnerable endpoint is not network-reachable, and auditing existing albums for anomalous image_order values stored before remediation - noting that the injection fires only when at least one album contains at least one photo and a Batch Manager or album query subsequently runs, so stored payloads may remain latent until the fix is applied. Rotate database credentials if compromise is suspected, since the weakness permits disclosure and modification of database data (C/I/A all High).
Affected VersionsENISA
Affected Packages
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
This is a CWE-89 SQL injection rooted in missing input validation on an administrative sort-field parameter. Piwigo's admin/element_set_ranks.php accepts image_order[] values from the admin UI and persists them as an album's image order expression. The file already contained a defined sort-field whitelist array ($sort_fields), but the write path did not enforce it, so arbitrary strings could be stored. The two upstream commits (ba1f803f8cefd3602ccb9c6f0155cd529510288a and ef9e65386d76f9c85f1e23a45dd7af14a5b73a47) move the $sort_fields array to the top of the file and add an in_array(..., array_keys($sort_fields)) check on $_POST['image_order'][$i], rejecting anything outside the known-safe list such as 'file ASC', 'name DESC', 'date_creation DESC', 'rating_score ASC', 'hit DESC', 'id ASC', and 'rank ASC'. The stored expression is then interpolated into ORDER BY clauses by admin/batch_manager_global.php, admin/batch_manager_unit.php, include/section_init.inc.php, and include/ws_functions/pwg.categories.php, which is where the injection actually fires. Because concatenation into ORDER BY occurs without parameterization or allow-listing at read time, a stored payload survives until one of those query paths runs, making this a second-order (stored) injection rather than an immediate one. The affected component set is captured by the CPE cpe:2.3:a:piwigo:piwigo:*:*:*:*:*:*:*:* (all versions before the fix), and the PHP tag aligns with Piwigo's PHP web application stack.
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
AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H
Network-reachable admin endpoint (AV:N/AC:L) requires administrator privileges (PR:H) and no interaction; stored SQL injection yields full database read/write/disruption (C:H/I:H/A:H).
Primary rating from Vendor (GitHub_M).
CVSS VectorVendor: GitHub_M
Lifecycle Timeline
2DescriptionCVE.org
Piwigo is a full featured open source photo gallery application for the web. Prior to 16.4.0, admin/element_set_ranks.php stores administrator-controlled image_order[] values without enforcing the existing sort-field whitelist. The stored album image_order expression is later concatenated into ORDER BY clauses by admin/batch_manager_global.php, admin/batch_manager_unit.php, include/section_init.inc.php, and include/ws_functions/pwg.categories.php. When at least one album contains at least one photo, an authenticated administrator can store a crafted expression and trigger it in a later album or Batch Manager query to disclose, modify, or disrupt database data. This issue is fixed in version 16.4.0.
Technical POC Analysis
CWE-89, second-order (stored) 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
A stored SQL injection flaw in the Piwigo photo gallery platform (versions prior to 16.4.0) allows someone holding a high-privileged administrator account to manipulate database queries that run during routine gallery and Batch Manager operations. Because the affected account type typically belongs to trusted staff or webmasters, the practical risk is insider misuse or abuse of compromised or over-provisioned admin credentials rather than mass external attack. Leadership should care because successful abuse could expose, alter, or disrupt the data behind a public-facing gallery, with potential integrity, availability, and reputational consequences for the organization's digital presence.
Apply vendor patch.
Threat Intelligence Overview
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.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
SQL injection exploits the way applications construct database queries by mixing user input directly into SQL statements.
Directory traversal vulnerability in install.php in Piwigo before 2.4.7 allows remote attackers to read and delete arbit
Cross-site request forgery (CSRF) vulnerability in the LocalFiles Editor plugin in Piwigo before 2.4.7 allows remote att
SQL injection vulnerability in the administrative backend in Piwigo through 2.9.1 allows remote users to execute arbitra
Piwigo 13.6.0 is vulnerable to SQL Injection via in the "profile" function. Rated critical severity (CVSS 9.8), this vul
Piwigo 13.6.0 is vulnerable to SQL Injection via /admin/permalinks.php. Rated critical severity (CVSS 9.8), this vulnera
Piwigo 11.4.0 allows admin/user_list_backend.php order[0][dir] SQL Injection. Rated critical severity (CVSS 9.8), this v
admin.php?page=account_billing in Piwigo 2.9.5 has XSS via the vat_number, billing_name, company, or billing_
admin.php?page=notification_by_mail in Piwigo 2.9.5 has XSS via the nbm_send_html_mail, nbm_send_mai
Cross-site request forgery (CSRF) vulnerability in Piwigo through 2.9.1 allows remote attackers to hijack the authentica
Cross-site request forgery (CSRF) vulnerability in Piwigo through 2.9.1 allows remote attackers to hijack the authentica
Cross-site request forgery (CSRF) vulnerability in Piwigo through 2.9.1 allows remote attackers to hijack the authentica
admin/configuration.php in Piwigo 2.9.2 has CSRF. Rated high severity (CVSS 8.8), this vulnerability is remotely exploit
EUVD-2026-87138
NVD
CVE.org
EPSS
Vulnrichment
GitHub
Exploit-DB