CVE-2026-2497

Gallery by BestWebSoft <= 4.7.9 - Authenticated (Editor+) SQL Injection via Gallery Image Order Array Keys

Published Aug 16, 2026 CVSS 3.1 · 7.2 High EPSS < 1% KEV · Not listed
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.

Analysis

AI-generated

Technical impact

The Gallery by BestWebSoft plugin for WordPress is vulnerable to SQL injection through the '_gallery_order_{post_id}' array keys. Untrusted input from authenticated users with Editor role or higher is stored directly in post meta without proper escaping and later used in SQL queries without prepared statements. This flaw allows an attacker to append arbitrary SQL to existing queries and extract sensitive database contents.

Affected Systems

The vulnerability affects the Gallery by BestWebSoft – Customizable Image and Photo Galleries for WordPress plugin, with all releases up through version 4.7.9. It does not involve the WordPress core itself but applies to sites that have this plugin installed and have users assigned the Editor or higher roles.

Risk and Exploitability

The CVSS score of 7.2 indicates high severity, and the exploitation probability is uncertain due to the lack of an EPSS value. The flaw is not listed in the CISA KEV catalog. Attackers must first authenticate with Editor-level access (or greater) and then submit crafted data via the gallery ordering interface. Successful injection enables database read access, potentially exposing user credentials, site configuration, and other confidential data. Though no public exploits are documented, the existence of a classic SQL injection vector means the risk remains significant for affected sites.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade the Gallery by BestWebSoft plugin to version 4.7.10 or later, if available, which removes the vendor supplied code that uses unsanitized array keys.
  • Revoke or limit Editor-level access for users who do not require it, ensuring only trusted administrators can modify gallery data.
  • Implement stricter input handling by enforcing prepared statements or escaping on any custom code that interacts with the plugin’s database tables.

Generated by OpenCVE AI on August 16, 2026 at 08:22 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'total'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Bestwebsoft
Bestwebsoft gallery By Bestwebsoft – Customizable Image And Photo Galleries For Wordpress
Wordpress
Wordpress wordpress
Vendors & Products Bestwebsoft
Bestwebsoft gallery By Bestwebsoft – Customizable Image And Photo Galleries For Wordpress
Wordpress
Wordpress wordpress
Type Values Removed Values Added
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.
Title Gallery by BestWebSoft <= 4.7.9 - Authenticated (Editor+) SQL Injection via Gallery Image Order Array Keys
Weaknesses CWE-89
References
Metrics cvssV3_1

{'score': 7.2, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H'}

Weaknesses
  • CWE-89

    Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')

Sources

Status
PUBLISHED
Assigner
Wordfence
Published
Updated
Aug 17, 2026, 5:03 PM
Reserved
Feb 13, 2026, 9:36 PM
Status
Deferred
Published
Aug 16, 2026, 7:16 AM
Modified
Aug 20, 2026, 12:48 PM