Skip to main content

Gallery by BestWebSoft CVE-2026-2497

| EUVDEUVD-2026-59925 HIGH
SQL Injection (CWE-89)
2026-08-16 Wordfence GHSA-p9qr-8pg6-7hvc
7.2
CVSS 3.1 · Vendor: Wordfence
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Authenticate as WordPress Editor
  2. Delivery
    POST crafted SQL payload as array key in `_gallery_order_{post_id}`
  3. Exploit
    `gllr_save_postdata()` stores unsanitized key into post meta
  4. Execution
    Trigger gallery data retrieval to execute stored SQL
  5. Impact
    Extract wp_users table or other sensitive database records

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

Exploitation requires an authenticated WordPress session with Editor role or higher (corresponding to CVSS PR:H). The vulnerability is triggered specifically by submitting a POST request to the gallery post-save endpoint that processes _gallery_order_{post_id} array keys, meaning the attacker must interact with the gallery management workflow - not arbitrary WordPress endpoints. The injection is stored (second-order): the malicious payload is first written to post meta via gllr_save_postdata(), then executed when that meta value is later incorporated into a SQL query. This two-stage nature means exploitation requires both write access (to save the payload) and a subsequent read/render trigger. Limiting factors: Editor role is not self-assignable in default WordPress; the Gallery by BestWebSoft plugin must be installed and active; and exploitation targets the WordPress database specifically, not the underlying OS.

Impact

The CVSS 7.2 (High) score reflects the full database impact (C:H/I:H/A:H) but is tempered by PR:H, requiring Editor-level WordPress access - a role that typically requires administrative delegation and is not self-registerable in default WordPress configurations. This substantially limits opportunistic exploitation; the realistic threat model is a malicious insider, a compromised Editor account, or a scenario where another vulnerability (e.g., credential stuffing, phishing) first establishes Editor access. No EPSS score was provided, and the vulnerability has no CISA KEV listing, suggesting no observed mass exploitation at time of analysis. The absence of a listed POC and KEV status, combined with the PR:H requirement, places real-world priority below what the raw CVSS score might suggest for most environments. However, for WordPress sites with multiple Editors or contributor workflows, the risk is elevated. CVSS I:H/A:H impact metrics are consistent with blind or error-based SQLi that can perform write operations or trigger heavy queries, not only read access.

Exploit ScenarioDerived

An attacker who holds or has compromised a WordPress Editor account navigates to a gallery editing page and submits a crafted POST request where the keys of the _gallery_order_{post_id} array contain SQL fragments (e.g., 1 UNION SELECT user_login,user_pass,3 FROM wp_users-- -). The gllr_save_postdata() function stores these keys verbatim into post meta; when the plugin subsequently builds a SQL query using that stored meta value without prepared statements, the injected SQL executes against the WordPress database, returning hashed credentials or other sensitive data. No public proof-of-concept has been identified, but the code path is described in detail via the Trac source references, making independent exploitation straightforward for a skilled attacker.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
No patch listed yet 0.3% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Aug 16, 2026

SQL injection in the Gallery by BestWebSoft WordPress plugin (all versions through 4.7.9) allows Editor-level or higher authenticated attackers to exfiltrate or manipulate the entire WordPress database by injecting arbitrary SQL via crafted array key names in the _gallery_order_{post_id} POST parameter. The gllr_save_postdata() function writes these unsanitized array keys directly into post meta without escaping or prepared statements, and downstream SQL queries consume them verbatim. No public exploit has been identified at time of analysis, and the vulnerability is not listed in the CISA KEV catalog.

RemediationAI

Update the Gallery by BestWebSoft plugin to the version following 4.7.9; a fix commit is documented in the WordPress plugin Trac changeset at https://plugins.trac.wordpress.org/changeset?reponame=&old=3609291%40gallery-plugin&new=3609291%40gallery-plugin, indicating the issue has been addressed upstream. However, an exact patched release version number is not confirmed from available data - administrators should verify the current version in the WordPress plugin repository and update to the latest available release. As an interim compensating control, restricting the Editor role to fully trusted users reduces the exploitable attack surface, since this flaw requires at minimum Editor-level access to trigger. Disabling the plugin entirely until the patch is applied is the most conservative mitigation, with the trade-off of losing gallery functionality. Network-level WAF rules filtering SQL metacharacters in POST body array keys may provide partial mitigation but are unreliable against all injection variants and should not substitute for patching.

Affected VersionsENISA

Gallery by BestWebSoft – Customizable Image and Photo Galleries for WordPress 0 ≤4.7.9

Affected Packages

euvd gallery_by_bestwebsoft_customizable_image_and_photo_galleries_for_wordpress no fix

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) vulnerability rooted in PHP array key handling within a WordPress plugin context. The affected code in gallery-plugin.php (line 1052) and class-gllr-media-table.php (line 58) processes $_POST input by iterating over array keys of _gallery_order_{post_id} - a pattern where user-controlled data is used as array keys rather than values, bypassing typical input sanitization that focuses on values. These keys are stored unsanitized into WordPress post meta via update_post_meta(), and when later retrieved and incorporated into SQL queries, they are not wrapped in $wpdb->prepare() or otherwise escaped. WordPress's $wpdb API provides prepared statement support, but this code path opts out of it. The CPE string cpe:2.3:a:bestwebsoft:gallery_by_bestwebsoft_-_customizable_image_and_photo_galleries_for_wordpress:*:*:*:*:*:*:*:* confirms the vulnerable component is the BestWebSoft gallery plugin for WordPress, all versions.

Know when Wordpress Plugin 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

Vendor (Wordfence) PRIMARY 7.2 HIGH
AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H
vuln.today AI 7.2 HIGH

PR:H reflects mandatory Editor-level WordPress authentication; AV:N and AC:L because exploitation is straightforward once that access exists; full C/I/A:H due to unrestricted database read/write via SQL injection.

3.1 AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H
4.0 AV:N/AC:L/AT:N/PR:H/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

Primary rating from Vendor (Wordfence).

CVSS VectorVendor: Wordfence

Attack Vector
Network
Attack Complexity
Low
Privileges Required
High
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

DescriptionCVE.org

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.

Executive ViewAI

Why It Matters

The Gallery by BestWebSoft WordPress plugin (versions through 4.7.9) contains an authenticated SQL injection vulnerability (CVE-2026-2497, CVSS 7.2) that allows Editor-level or higher users to directly manipulate or exfiltrate the entire WordPress database. Organizations using this plugin face data breach and data integrity risks from privileged insiders or accounts with editor access that become compromised. Immediate action is required to restrict access and isolate the exposure vector.

Business Impact: High
Compensating Controls

Restrict Editor and Administrator role assignments to essential personnel only; implement WAF rules targeting POST parameters containing SQL syntax; disable the plugin if operational requirements allow; enable and monitor database query logs for anomalous activity; conduct quarterly user access audits.

Threat Intelligence Overview

EPSS Score
0.3%
Top 76% exploitable
Prevalence
Low
niche WordPress gallery plugin with limited install base
Social Media
2
Sightings
Data Quality
6 sources
Confidence: High

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.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.3%
Patch available No
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Scheduled
Exploitation
None
System Exposure· derived
Open
Automatable
No
Human Impact
High
Technical Impact
Total

Priority Score

36
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +36
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

SQL injection exploits the way applications construct database queries by mixing user input directly into SQL statements.

CVE-2023-6553 CRITICAL POC
9.8 Dec 15

The Backup Migration plugin for WordPress is vulnerable to Remote Code Execution in all versions up to, and including, 1

CVE-2024-5084 CRITICAL POC
9.8 May 23

The Hash Form - Drag & Drop Form Builder plugin for WordPress is vulnerable to arbitrary file uploads due to missing fil

CVE-2024-44000 CRITICAL POC
9.8 Oct 20

Authentication bypass in the LiteSpeed Cache WordPress plugin (versions prior to 6.5.0.1) allows unauthenticated remote

CVE-2020-36847 CRITICAL POC
9.8 Jul 12

The Simple File List plugin for WordPress through version 4.2.2 contains an unauthenticated remote code execution vulner

CVE-2025-27007 CRITICAL POC
9.8 May 01

The SureTriggers WordPress plugin through version 1.0.82 contains a privilege escalation vulnerability that allows unaut

CVE-2016-1209 CRITICAL POC
9.8 May 14

The Ninja Forms plugin before 2.9.42.1 for WordPress allows remote attackers to conduct PHP object injection attacks via

CVE-2024-4443 CRITICAL POC
9.8 May 22

The Business Directory Plugin - Easy Listing Directories for WordPress plugin for WordPress is vulnerable to time-based

CVE-2024-1698 CRITICAL POC
9.8 Feb 27

SQL injection in the NotificationX WordPress plugin (versions up to and including 2.8.2) allows unauthenticated remote a

CVE-2023-6875 CRITICAL POC
9.8 Jan 11

The POST SMTP Mailer - Email log, Delivery Failure Notifications and Best Mail SMTP for WordPress plugin for WordPress i

CVE-2024-1512 CRITICAL POC
9.8 Feb 17

The MasterStudy LMS WordPress Plugin - for Online Courses and Education plugin for WordPress is vulnerable to union base

CVE-2024-4295 CRITICAL POC
9.8 Jun 05

The Email Subscribers by Icegram Express plugin for WordPress is vulnerable to SQL Injection via the ‘hash’ parameter in

CVE-2024-50498 CRITICAL POC
10.0 Oct 28

Remote code execution in the WP Query Console WordPress plugin (versions up to and including 1.0) by Ajit Bohra allows u

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy