CVE-2026-2497 in Gallery Plugininfo

Summary

by MITRE • 08/16/2026

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.

Statistical analysis made it clear that VulDB provides the best quality for vulnerability data.

Analysis

by VulDB Data Team • 08/16/2026

The vulnerability in the Gallery by BestWebSoft WordPress plugin represents a critical sql injection flaw that undermines database security through improper input handling. This weakness exists in versions up to and including 4.7.9, where the plugin fails to adequately sanitize user-supplied data before incorporating it into database operations. The vulnerability specifically targets the `gallery_order{post_id}` parameter array keys, which are processed through the `gllr_save_postdata()` function without proper validation or escaping mechanisms. According to CWE-89, this constitutes a classic sql injection vulnerability where attacker-controlled input is directly concatenated into sql queries rather than being properly parameterized.

The technical implementation of this flaw occurs when authenticated users with editor privileges or higher manipulate the post meta data through the plugin's administrative interface. The `gllr_save_postdata()` function accepts unsanitized array keys from the `$_POST` superglobal and stores them directly into wordpress post meta fields without any form of input sanitization. These stored values are subsequently retrieved and utilized in sql queries throughout the plugin's operation, creating a chain of trust that bypasses normal security controls. The absence of prepared statements means that maliciously crafted array keys can inject additional sql commands that execute within the context of the database connection.

The operational impact of this vulnerability extends beyond simple data exfiltration to encompass full database compromise capabilities. An authenticated attacker with editor-level permissions can construct malicious array keys that, when processed by the vulnerable plugin, will append arbitrary sql operations to existing queries. This allows for unauthorized access to sensitive information including user credentials, personal data, and system configurations stored within the wordpress database. The vulnerability's exploitation requires minimal privileges but maximum impact, aligning with ATT&CK technique T1078.004 which covers valid accounts with elevated privileges as a means of persistence and privilege escalation.

Security mitigations for this vulnerability must address both immediate remediation and long-term prevention strategies. Immediate actions include upgrading to the latest plugin version where the sql injection has been patched, implementing proper input validation on all user-supplied parameters, and ensuring that all database queries utilize prepared statements with parameter binding. Organizations should also enforce principle of least privilege by limiting administrative access to only essential personnel and implementing network segmentation to reduce the attack surface. Regular security audits of wordpress plugins and themes remain crucial for identifying similar vulnerabilities in third-party components that may not be actively maintained or patched by vendors.

Responsible

Wordfence

Reservation

02/13/2026

Disclosure

08/16/2026

Moderation

accepted

CPE

ready

EPSS

0.00000

KEV

no

Activities

low

Sources

Are you interested in using VulDB?

Download the whitepaper to learn more about our service!