Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2026-107757 Overview
The Gallery Custom Links plugin for WordPress contains a stored cross-site scripting (XSS) vulnerability affecting all versions up to and including 2.3.3. The flaw stems from insufficient input sanitization and output escaping across two coordinated inputs: the display_name field in profile.php and comment bodies submitted through wp-comments-post.php. Authenticated attackers with subscriber-level access or above can inject arbitrary web scripts that execute when other users view affected pages. The vulnerability resides in the plugin's output-buffering pass, which rewrites rendered page content using the bundled simple_html_dom parser after WordPress sanitization filters have already run.
Critical Impact
Authenticated subscriber accounts can store JavaScript payloads that execute in other visitors' browsers, enabling session theft, forced actions, and page defacement across any WordPress page processed by the plugin's output buffer.
Affected Products
- WordPress Gallery Custom Links plugin, versions up to and including 2.3.3
- Deployments bundling kub-at/php-simple-html-dom-parser as shipped with the plugin
- WordPress sites allowing subscriber-level registration with comments enabled
Discovery Timeline
- 2026-10-14 - CVE-2026-107757 published to NVD
- 2026-10-14 - Last updated in NVD database
Technical Details for CVE-2026-107757
Vulnerability Analysis
The vulnerability is a stored XSS classified under [CWE-79], triggered by a two-part payload submitted by the same authenticated attacker. The plugin enables output buffering by default and reparses the entire rendered page through the simple_html_dom library before delivery. During that pass, attacker-controlled markers in the comment body and display_name are substituted after WordPress sanitization has already executed, bypassing the protections normally provided by wp_filter_comment_kses and esc_attr().
An HTML comment payload placed in a comment body is preserved verbatim by WordPress comment kses rules. A matching simple_html_dom noise key stored in the attacker's display_name survives esc_attr() because the characters are attribute-safe. When the plugin's buffered pass runs, the parser substitutes the key with the attacker's HTML comment content, producing executable script in the delivered response.
Root Cause
The root cause is the plugin treating output-buffered page content as trusted after WordPress sanitization. The core logic in classes/core.php (referenced at line 103 and line 215) relies on the bundled parser whose noise-key substitution routines (simple_html_dom.php L502, L2112, L2207) replace stored markers with raw HTML. Neither the plugin nor the parser re-escapes substituted content before emitting it.
Attack Vector
An attacker registers or uses an existing subscriber-level account. The attacker sets a display_name containing a simple_html_dom noise key, then submits a comment that embeds the matching HTML comment payload. When any visitor loads a page processed by the plugin's output buffer, the parser substitutes the key, injecting attacker-controlled script into the response. Exploitation requires precise coordination of both inputs and knowledge of the parser's internal key format, reflecting the high attack complexity captured in the CVSS vector.
The exploitation chain is described in the plugin source and the Wordfence Threat Intelligence Report. No verified proof-of-concept code is published; technical reproduction requires reading the referenced parser source.
Detection Methods for CVE-2026-107757
Indicators of Compromise
- Comment records in wp_comments containing HTML comment delimiters (<!-- ... -->) wrapping <script>, onerror, or event-handler payloads.
- display_name values in wp_users containing opaque alphanumeric tokens that resemble simple_html_dom noise keys rather than human names.
- Server access logs showing POST requests to wp-comments-post.php and profile.php from the same subscriber account within a short window.
Detection Strategies
- Audit user profile updates for subscriber accounts and flag non-standard characters or long tokens inserted into display_name.
- Scan rendered page output for script tags originating from comment or profile fields that would not normally produce executable HTML.
- Review WordPress audit logs for correlated profile edits and comment submissions by the same low-privilege account.
Monitoring Recommendations
- Alert on new user registrations followed by immediate profile edits and comment submissions on sites running Gallery Custom Links 2.3.3 or earlier.
- Monitor outbound requests from authenticated session pages to unexpected third-party domains, which can indicate exfiltration via injected scripts.
- Track plugin version inventory across managed WordPress sites and flag any instance still running an unpatched release.
How to Mitigate CVE-2026-107757
Immediate Actions Required
- Update the Gallery Custom Links plugin to the version containing Changeset #3737485 or later.
- Review and sanitize existing display_name values and recent comments for stored payload fragments before re-enabling the plugin.
- Rotate administrator session cookies and invalidate active sessions if exploitation is suspected.
Patch Information
The vendor addressed the issue in the plugin changeset identified by WordPress Changeset #3737485, which modifies the bundled simple_html_dom.php substitution logic. Review the patched parser source for the specific sanitization changes applied.
Workarounds
- Deactivate the Gallery Custom Links plugin until the patched release is deployed.
- Restrict new user registration or elevate the minimum role required to submit comments on affected sites.
- Deploy a web application firewall rule that strips HTML comment delimiters from comment bodies submitted by subscriber-level accounts.
# Configuration example: disable open registration and require moderation
wp option update users_can_register 0
wp option update comment_moderation 1
wp option update comment_previously_approved 1
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

