Atomic Edge analysis of CVE-2026-9829: This vulnerability is a time-based SQL Injection in the Photo Gallery by 10Web plugin (versions <= 1.8.41). It affects the 'compact_album_order_by' shortcode parameter. An authenticated attacker with Contributor-level access can inject malicious SQL queries. These queries can extract sensitive data from the WordPress database. The vulnerability has a CVSS score of 6.5.
The root cause is insufficient input sanitization and lack of parameterized queries in the plugin's data handling. The vulnerability originates in the shortcode processing. The 'compact_album_order_by' parameter, which controls the sorting order for album views, is passed without sanitization into an SQL query. The vulnerable code is in the 'photo-gallery/frontend/models/model.php' file, specifically in the model function that builds the SQL query for album galleries. The user-supplied 'compact_album_order_by' value is directly concatenated into an ORDER BY clause. The shortcode input is initially stored by the 'shortcode_bwg' AJAX handler in 'admin/controllers/Shortcode.php'. The vulnerable code path lacks an escape on the parameter, allowing an attacker to break out of the intended SQL structure.
An attacker with Contributor-level access can craft a malicious shortcode containing SQL injection payload in the 'compact_album_order_by' parameter. The shortcode is saved via a POST request to /wp-admin/admin-ajax.php with the action 'shortcode_bwg'. A key aspect of the vulnerability is that by omitting the 'page' parameter, the nonce verification is bypassed. After saving, the malicious shortcode is stored. The attack is then triggered when an unauthenticated user or visitor loads a page containing the crafted shortcode. The 'bwg_frontend_data' AJAX handler processes the shortcode and executes the injected SQL. The injection is time-based, meaning an attacker uses conditional SQL commands (e.g., IF(condition, SLEEP(5), 0)) to infer data from the database based on the response time.
The patch introduces several sanitization functions in 'framework/WDWLibrary.php' to fix the vulnerability. Three new functions are added: 'sanitize_album_sort_column', 'sanitize_sort_direction', and 'sanitize_image_sort_column'. These functions use whitelisting to ensure only valid, expected values are used in SQL queries. 'sanitize_album_sort_column' limits the column name to a set of allowed values ('order', 'name', 'modified_date', 'id'). 'sanitize_sort_direction' restricts the sort order to either 'ASC' or 'DESC'. The core fix in 'frontend/models/model.php' applies these sanitization functions. Before the patch, the user input was used directly in 'ORDER BY `' . $sort_by . '` ' . $order_by. After the patch, the input is sanitized first, and then the sanitized values are used to construct the query. The patch also adds 'sanitize_shortcode_tagtext' to sanitize shortcode attributes at the point of storage, preventing the malicious payload from being saved in the first place. Additionally, the nonce check in 'admin/controllers/Shortcode.php' was improved.
Successful exploitation of this SQL injection vulnerability can allow an attacker to extract sensitive information from the WordPress database. This includes usernames, password hashes, user session tokens, private post content, and other plugin-specific data. The attacker can achieve data exfiltration of the entire database over time, using time-based inference techniques. There is no direct privilege escalation to administrator, but the extracted credentials could be leveraged for further attacks. The vulnerability does not allow direct file modification or remote code execution.

