CVE-2015-10116 (PHP, published 2023-06-06T01:15Z)
Description: value: A vulnerability classified as problematic has been found in RealFaviconGenerator Favicon Plugin up to 1.2.12 on WordPress. This affects the function install_new_favicon of the file admin/class-favicon-by-realfavicongenerator-admin.php. The manipulation leads to cross-site request forgery. It is possible to initiate the attack remotely. Upgrading to version 1.2.13 is able to address this issue. The identifier of the patch is 949a1ae7216216350458844f50a72f100b56d4e7. It is recommended to upgrade the affected component. The identifier VDB-230661 was assigned to this vulnerability.
Severity: nan (CVSS v3 base score: 8.8)
Weakness: CWE-352 \u2014 Cross-Site Request Forgery (CSRF)
The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request.
Repository: https://github.com/wp-plugins/favicon-by-realfavicongenerator
Files changed:
README.txt
admin/class-favicon-by-realfavicongenerator-admin.php
admin/views/appearance.php
favicon-by-realfavicongenerator.php
Commit message: XSS vulnerability fixed, reported by Kacper Szurek

git-svn-id: https://plugins.svn.wordpress.org/favicon-by-realfavicongenerator/trunk@1125286 b8457f37-d9ea-0310-8a92-e5e31aec5664


Vulnerable code:
Stable tag: 1.2.12
Create and install your favicon for all platforms: PC/Mac of course, but also iPhone/iPad, Android devices, Windows 8 tablets...
			$zip_path = Favicon_By_RealFaviconGenerator_Common::get_tmp_dir();
			if ( ! file_exists( $zip_path ) ) {
				mkdir( $zip_path, 0755, true );
			$response->downloadAndUnpack( $zip_path );
			$this->store_pictures( $response );
			$this->store_preview( $response->getPreviewPath() );
			Favicon_By_RealFaviconGenerator_Common::remove_directory( $zip_path );
			update_option( Favicon_By_RealFaviconGenerator_Common::OPTION_HTML_CODE, $response->getHtmlCode() );
			
			$this->set_favicon_configured( true, $response->isFilesInRoot(), $response->getVersion() );
 * Version:           1.2.12

Fixed code:
Stable tag: 1.2.13
Create and install your favicon for all platforms: PC/Mac, iPhone/iPad, Android devices, Windows 8 tablets...
= 1.2.13 =

- XSS vulnerability fixed, reported by [Kacper Szurek](http://security.szurek.pl/)

	const NONCE_ACTION_NAME = 'favicon_generation';
		// Nonce
		$nonce = wp_create_nonce( NONCE_ACTION_NAME );

			if ( ! wp_verify_nonce( $response->getCustomParameter(), NONCE_ACTION_NAME ) ) {
				// Attack in progress?
?>
{
	"status": "error",
	"message": "<?php _e( 'Nonce was not recognized. This case is supposed to happen only in case of XSS attack. If you feel like something is wrong, please <a href=\"mailto:contact@realfavicongenerator.net\">contact us</a>.', FBRFG_PLUGIN_SLUG ) ?>"
}
<?php
			else {
				$zip_path = Favicon_By_RealFaviconGenerator_Common::get_tmp_dir();
				if ( ! file_exists( $zip_path ) ) {
					mkdir( $zip_path, 0755, true );
				}
				$response->downloadAndUnpack( $zip_path );
				$this->store_pictures( $response );
				$this->store_preview( $response->getPreviewPath() );
				Favicon_By_RealFaviconGenerator_Common::remove_directory( $zip_path );
				update_option( Favicon_By_RealFaviconGenerator_Common::OPTION_HTML_CODE, $response->getHtmlCode() );
				
				$this->set_favicon_configured( true, $response->isFilesInRoot(), $response->getVersion() );
			}
		params.favicon_generation.callback.custom_parameter = "<?php echo $nonce ?>";
 * Version:           1.2.13