# CVE-2026-42324: Piwigo SQL injection via unvalidated image_order parameter

Source: https://junglewise.ai/threats/cve-2026-42324-piwigo-is-a-full-featured-open-source-photo-gallery-application  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-09-25. Updated: 2026-09-26  
License: CC BY 4.0 with a link back

CVE-2026-42324 · Severity: high · CVSS 7.2 · Published 2026-09-25

Piwigo is an open-source photo gallery application. An authenticated administrator can inject malicious SQL expressions into album sorting settings through the element_set_ranks.php interface. These injected expressions are later executed in database queries across multiple admin panels and APIs, allowing an attacker to read, modify, or delete photo metadata and album information.

Technologies: [Piwigo](https://junglewise.ai/threats/technologies/piwigo). Vendors: [Piwigo](https://junglewise.ai/threats/vendors/piwigo).

## Quick answers

**Is CVE-2026-42324 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-42324 being exploited in the wild.

**How severe is CVE-2026-42324?** High severity, with a CVSS score of 7.2, published 25 September 2026.

**Which products and versions are affected?** Piwigo before 16.4.0.

**Is there a fix for CVE-2026-42324?** No fixed version is recorded yet. Check the vendor's advisory in the references below. If you run it, Junglewise drafts a mitigation that fits your setup and applies it once you approve, with senior security engineers behind it.

**How is CVE-2026-42324 attacked?** It is attacked over the network.

**Am I affected by CVE-2026-42324?** Check whether you run Piwigo at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## Technical details

The vulnerability is a SQL injection flaw in admin/element_set_ranks.php that fails to validate image_order[] parameters against the existing whitelist of allowed sort fields. Authenticated administrators can craft malicious SQL expressions and store them; these are then unsafely concatenated into ORDER BY clauses in batch_manager_global.php, batch_manager_unit.php, section_init.inc.php, and ws_functions/pwg.categories.php. The attack requires admin authentication and at least one album with one photo present.

## Affected products

- Piwigo Piwigo before 16.4.0

## Timeline

- 2026-09-25: disclosed

## References

- [https://github.com/Piwigo/Piwigo/commit/ba1f803f8cefd3602ccb9c6f0155cd529510288a](https://github.com/Piwigo/Piwigo/commit/ba1f803f8cefd3602ccb9c6f0155cd529510288a)
- [https://github.com/Piwigo/Piwigo/commit/ef9e65386d76f9c85f1e23a45dd7af14a5b73a47](https://github.com/Piwigo/Piwigo/commit/ef9e65386d76f9c85f1e23a45dd7af14a5b73a47)

## Related threats

- [Piwigo SQL injection in image rating search](https://junglewise.ai/threats/cve-2026-62262-piwigo-is-a-full-featured-open-source-photo-gallery-application)
- [Piwigo SQL injection in upgrade authentication](https://junglewise.ai/threats/cve-2026-44642-piwigo-is-a-full-featured-open-source-photo-gallery-application)
- [Piwigo SQL injection in batch manager filter](https://junglewise.ai/threats/cve-2026-42323-piwigo-is-a-full-featured-open-source-photo-gallery-application)
- [Piwigo arbitrary code execution via logo upload extension validation bypass](https://junglewise.ai/threats/cve-2026-42322-piwigo-is-a-full-featured-open-source-photo-gallery-application)
- [Piwigo arbitrary file read and RCE in image upload handling](https://junglewise.ai/threats/cve-2026-85750-piwigo-before-v16-4-0-is-vulnerable-to-arbitrary-file-read-and)
