CVE-2006-10001 (PHP, published 2023-03-05T21:15Z)
Description: value: A vulnerability, which was classified as problematic, was found in Subscribe to Comments Plugin up to 2.0.7 on WordPress. This affects an unknown part of the file subscribe-to-comments.php. The manipulation leads to cross site scripting. It is possible to initiate the attack remotely. Upgrading to version 2.0.8 is able to address this issue. The identifier of the patch is 9683bdf462fcac2f32b33be98f0b96497fbd1bb6. It is recommended to upgrade the affected component. The identifier VDB-222321 was assigned to this vulnerability.
Severity: nan (CVSS v3 base score: 5.4)
Weakness: CWE-79 \u2014 Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
Repository: https://github.com/wp-plugins/subscribe-to-comments
Files changed:
subscribe-to-comments.php
Commit message: version 2.0.8, XSS fix thanks to MustLive, more fixes for addresses with + symbols

git-svn-id: https://plugins.svn.wordpress.org/subscribe-to-comments/trunk@6401 b8457f37-d9ea-0310-8a92-e5e31aec5664


Vulnerable code:
Version: 2.0.7
	<form action="http://<?php echo $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] ?>" method="post">
	<input type="hidden" name="ref" value="<?php echo 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; ?>" />
				$this->{$var} = trim($_REQUEST[$var]);
		$message .= get_bloginfo('wpurl') . "/wp-subscription-manager.php?email=" . $this->email . "&new_email=" . $this->new_email . "&key=" . $this->generate_key($this->email . $this->new_email) . ".\n\n";
		$message .= get_bloginfo('wpurl') . "/wp-subscription-manager.php?email=" . $email . "&key=" . $this->generate_key($email . 'blockrequest') . "&blockemailconfirm=true" . ".\n\n";

			$link = add_query_arg('email', urlencode($email), $link);
		$link = add_query_arg('ref', urlencode('http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']), $link);

Fixed code:
Version: 2.0.8
	<form action="http://<?php echo $_SERVER['HTTP_HOST'] . wp_specialchars($_SERVER['REQUEST_URI']); ?>" method="post">
	<input type="hidden" name="ref" value="<?php echo urlencode('http://' . $_SERVER['HTTP_HOST'] . wp_specialchars($_SERVER['REQUEST_URI'])); ?>" />
		// version 2.0.8 -- allow plugin file to be renamed or placed in a subdirectory
		if ( 'edit.php?page=subscribe-to-comments.php' == $this->form_action )
			$this->form_action = 'edit.php?page=' . STC_PLUGIN_BASENAME;


				$this->{$var} = wp_specialchars(trim($_REQUEST[$var]));
		$message .= get_bloginfo('wpurl') . "/wp-subscription-manager.php?email=" . urlencode($this->email) . "&new_email=" . urlencode($this->new_email) . "&key=" . $this->generate_key($this->email . $this->new_email) . ".\n\n";
		$message .= get_bloginfo('wpurl') . "/wp-subscription-manager.php?email=" . urlencode($email) . "&key=" . $this->generate_key($email . 'blockrequest') . "&blockemailconfirm=true" . ".\n\n";
			$link = add_query_arg('email', urlencode(urlencode($email)), $link);
		$link = add_query_arg('ref', urlencode('http://' . $_SERVER['HTTP_HOST'] . wp_specialchars($_SERVER['REQUEST_URI'])), $link);
		$link = str_replace('+', '%2B', $link);

define('STC_PLUGIN_BASENAME', plugin_basename(__FILE__));