CVE-2026-2497 Gallery by BestWebSoft <= 4.7.9 - Authenticated (Editor+) SQL Injection via Gallery Image Order Array Keys
Authenticated attackers with Editor access can exploit SQL injection in the Gallery by BestWebSoft plugin to extract sensitive database information.
- Exploited in the wild
- Not known
- Login needed
- An administrator
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- None listed
What is CVE-2026-2497?
CVE-2026-2497 is a high-severity SQL injection vulnerability in Gallery by BestWebSoft – Customizable Image and Photo Galleries for WordPress, published on 16 Aug 2026. An attacker needs administrator access to exploit it, with no action from the victim.
Official description
The Gallery by BestWebSoft plugin for WordPress is vulnerable to SQL Injection via the '_gallery_order_{post_id}' parameter array keys in all versions up to, and including, 4.7.9. This is due to insufficient escaping on the user supplied parameter and lack of sufficient preparation on the existing SQL query. The `gllr_save_postdata()` function stores unsanitized array keys from `$_POST` directly into post meta, which are later used in SQL queries without prepared statements. This makes it possible for authenticated attackers, with Editor-level access and above, to append additional SQL queries into already existing queries that can be used to extract sensitive information from the database.
Weakness: CWE-89
Which versions are affected by CVE-2026-2497?
How do I fix CVE-2026-2497?
No fix has been published for CVE-2026-2497 yet. Limit exposure of the affected software until one is available.
Use parameterised queries everywhere and never build SQL by joining strings. Upgrade affected software first; a web application firewall only buys time. More about SQL injection.
Is CVE-2026-2497 being exploited?
There is no known exploitation of CVE-2026-2497 in the wild and no public exploit code.
Sources
Also known as GHSA-p9qr-8pg6-7hvc.