CVE-2014-125092: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (CWE-79)
value: A vulnerability was found in MaxButtons Plugin up to 1.26.0 on WordPress and classified as problematic. This issue affects the function maxbuttons_strip_px of the file includes/maxbuttons-button.php. The manipulation of the argument button_id leads to cross site scripting. The attack may be initiated remotely. Upgrading to version 1.26.1 is able to address this issue. The patch is named e74564c9e3b7429808e317f4916bd1c26ef0b806. It is recommended to upgrade the affected component. The associated identifier of this vulnerability is VDB-222323.
CWE description: 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.
CVSS v3 base score: 6.1
Published: 2023-03-05T21:15Z
Repository: https://github.com/wp-plugins/maxbuttons
Language: PHP
Files changed: includes/maxbuttons-button.php, maxbuttons.php, readme.txt
Commit date: 2014-10-02 12:44:46 +0000
Commit message: 1.26.1 Updates. XSS Vulnerability fixed.

git-svn-id: https://plugins.svn.wordpress.org/maxbuttons/trunk@1000617 b8457f37-d9ea-0310-8a92-e5e31aec5664

Diff: diff --git a/includes/maxbuttons-button.php b/includes/maxbuttons-button.php
index f34b652..cbebeab 100644
--- a/includes/maxbuttons-button.php
+++ b/includes/maxbuttons-button.php
@@ -1,12 +1,14 @@
 <?php
 include_once 'arrays.php';
 include_once 'constants.php';
 
-if (isset($_GET['id']) && $_GET['id'] != '') {
+if (isset($_GET['id']) && $_GET['id'] != '' && intval($_GET['id']) != 0) {
 	$button = maxbuttons_get_button($_GET['id']);
-}
+} elseif(isset($_GET['id'])) {
+	die();
+} else {}
 
 $maxbutton_name_value = isset($button) ? $button->name : '';
 $maxbutton_description_value = isset($button) ? $button->description : '';
 $maxbutton_url_value = isset($button) ? $button->url : '';
 $maxbutton_text_value = isset($button) ? $button->text : '';
@@ -191,12 +193,15 @@ function maxbuttons_strip_px($value) {
 }
 ?>
 
 <script type="text/javascript">
 	<?php if ($redirect == true) { ?>
+		<?php if(intval($button_id != 0)) { ?>
 		window.location = "<?php echo admin_url() ?>admin.php?page=maxbuttons-controller&action=button&id=<?php echo $button_id ?>";
-	<?php } ?>
+	<?php } else {
+		die();
+	} } ?>
 	
 	jQuery(document).ready(function() {		
 		<?php if (isset($_GET['id']) && $_GET['id'] > 0) { ?>
 			jQuery("#maxbuttons .message").show();
 		<?php } ?>
diff --git a/maxbuttons.php b/maxbuttons.php
index 6c9f2b4..c3a85c9 100644
--- a/maxbuttons.php
+++ b/maxbuttons.php
@@ -1,11 +1,11 @@
 <?php
 /*
 Plugin Name: MaxButtons
 Plugin URI: http://maxbuttons.com
 Description: The best WordPress button generator. This is the free version; the Pro version <a href="http://maxbuttons.com/?ref=mbfree">can be found here</a>.
-Version: 1.26.0
+Version: 1.26.1
 Author: Max Foundry
 Author URI: http://maxfoundry.com
 
 Copyright 2014 Max Foundry, LLC (http://maxfoundry.com)
 */
@@ -15,11 +15,11 @@ maxbuttons_set_activation_hooks();
 
 $maxbuttons_installed_version = get_option('MAXBUTTONS_VERSION_KEY');
 
 function maxbuttons_set_global_paths() {
 	define('MAXBUTTONS_VERSION_KEY', 'maxbuttons_version');
-	define('MAXBUTTONS_VERSION_NUM', '1.26.0');
+	define('MAXBUTTONS_VERSION_NUM', '1.26.1');
 	define('MAXBUTTONS_PLUGIN_NAME', trim(dirname(plugin_basename(__FILE__)), '/'));
 	define('MAXBUTTONS_PLUGIN_URL', plugins_url() . '/' . MAXBUTTONS_PLUGIN_NAME);
 }
 
 function maxbuttons_set_activation_hooks() {
diff --git a/readme.txt b/readme.txt
index d6dfd2c..e24e3c4 100644
--- a/readme.txt
+++ b/readme.txt
@@ -1,29 +1,29 @@
 === MaxButtons: WordPress Button Generator ===
 Contributors: maxfoundry, arcware, johnbhartley
 Tags: button, buttons, css, css3, css3 icon, call to action, free, icon, icons, link, permalink, plugin, seo, shortcode, shortcodes, shortlinks, wordpress button plugin, wordpress button generator, css3 button plugin, css3 button generator, css wordpress button, css3 wordpress button, social media button, wordpress buttons plugin, wp button creator, create wordpress buttons, button generator, create button icon, font awesome, fontawesome
 Requires at least: 3.4
 Tested up to: 4.0
-Stable tag: 1.26.0
+Stable tag: 1.26.1
 
 A CSS3 button generator for WordPress that's powerful and so easy to use that anyone can create beautiful buttons.
 
 == Description ==
 Create great-looking CSS3 buttons that can be used on any post or page in your WordPress site. The easy to use button editor makes it a snap to generate awesome CSS3 buttons in very little time.
 
 = Helpful Links = 
 
-* [How to Create WordPress Buttons?](http://www.maxbuttons.com/#CSS3/?utm_source=wordpress&utm_medium=mbrepo&utm_content=how-to-create&utm_campaign=plugin) 
-* [How to make a WordPress Buttons?](http://www.maxbuttons.com/?utm_source=wordpress&utm_medium=mbrepo&utm_content=how-to-make&utm_campaign=plugin) 
-* [What is a WordPress Button Generator?](http://maxbuttons.com/tour/button-editor/?utm_source=wordpress&utm_medium=mbrepo&utm_content=what-is-generator&utm_campaign=plugin)
-* [How do I see my WordPress Buttons?](http://maxbuttons.com/tour/button-list/?utm_source=wordpress&utm_medium=mbrepo&utm_content=how-to-see&utm_campaign=plugin)
-* [What's the best way to use Font Awesome with Wordpress?](http://www.maxbuttons.com/?utm_source=wordpress&utm_medium=mbrepo&utm_content=font-awesome&utm_campaign=plugin)
+* [How to Create WordPress Buttons?](http://www.maxbuttons.com/#CSS3/?utm_source=wordpress&utm_medium=mbrepo&utm_content=how-to-create&utm_campaign=repo) 
+* [How to make a WordPress Buttons?](http://www.maxbuttons.com/?utm_source=wordpress&utm_medium=mbrepo&utm_content=how-to-make&utm_campaign=repo) 
+* [What is a WordPress Button Generator?](http://maxbuttons.com/tour/button-editor/?utm_source=wordpress&utm_medium=mbrepo&utm_content=what-is-generator&utm_campaign=repo)
+* [How do I see my WordPress Buttons?](http://maxbuttons.com/tour/button-list/?utm_source=wordpress&utm_medium=mbrepo&utm_content=how-to-see&utm_campaign=repo)
+* [What's the best way to use Font Awesome with Wordpress?](http://www.maxbuttons.com/?utm_source=wordpress&utm_medium=mbrepo&utm_content=font-awesome&utm_campaign=repo)
 
 
 = WordPress Button Pack Libraries =
 
-* [How do Button Pack libraries make me and my firm more effective?](http://www.maxbuttons.com/shop/category/button-packs/?utm_source=wordpress&utm_medium=mbrepo&utm_content=how-to-create&utm_campaign=plugin)
+* [How do Button Pack libraries make me and my firm more effective?](http://www.maxbuttons.com/shop/category/button-packs/?utm_source=wordpress&utm_medium=mbrepo&utm_content=how-to-create&utm_campaign=repo)
 * [What is a good Vector Icon Library to use with MaxButtons Pro?](http://maxvectors.com/)
 
 = Highlights =
 
 * No coding, the plugin takes care of everything
@@ -36,21 +36,21 @@ Create great-looking CSS3 buttons that can be used on any post or page in your W
 * See your buttons on different color backgrounds
 * Predefined defaults make getting started super easy
 
 = Upgrade to MaxButtons Pro =
 
-Take your buttons to the next level with [MaxButtons Pro](http://www.maxbuttons.com/pricing/?utm_source=wordpress&utm_medium=mbrepo&utm_content=MBPro&utm_campaign=plugin), which gives you additional features such as:
+Take your buttons to the next level with [MaxButtons Pro](http://www.maxbuttons.com/pricing/?utm_source=wordpress&utm_medium=mbrepo&utm_content=MBPro&utm_campaign=repo), which gives you additional features such as:
 
 * **Icon Support** - Put icons to the left, right, top, or bottom of your text.
 * **Multi-line text** - To add a second line of text for communicating extra information.
 * **Google Web Fonts** - To make your buttons stand out with beautiful typography.
 * **Button Packs** - Be more productive through the use of our value priced, ready-made button sets.
 * **Import/Export** - Useful for backing up and/or moving your buttons. Also, use any of the great [free icons](http://maxbuttons.com/free-icons/) listed on our site.
 * **Height and Width** - Explicit options to set button height and width.
 * **Shopp Integration** - Use buttons created with MaxButtons Pro as the shopping cart buttons of the Shopp e-commerce plugin.
 
-And the best part is that you can get this awesome [CSS3 button generator](http://www.maxbuttons.com/?utm_source=wordpress&utm_medium=mbrepo&utm_content=CSS3&utm_campaign=plugin) for **only $19!**
+And the best part is that you can get this awesome [CSS3 button generator](http://www.maxbuttons.com/?utm_source=wordpress&utm_medium=mbrepo&utm_content=CSS3&utm_campaign=repo) for **only $19!**
 
 = How To Use =
 
 1. Click the MaxButtons page from the admin menu.
 1. Click the Add New button.
@@ -135,10 +135,13 @@ Enable the container option and set the alignment property to either "display: i
 		<td>[maxbutton id="3"]</td>
 	</tr>
 </table>`
 
 == Changelog ==
+= 1.26.1 =
+* Fixed an XSS vulnerability on the button creation page
+
 = 1.26.0 =
 * Placed button description in ThickBox when opened in Content Editor
 * Added ability to get shortcode by button name along with button id
 
 = 1.25.0 =

Vulnerable code: if (isset($_GET['id']) && $_GET['id'] != '') {
}
	<?php } ?>
Version: 1.26.0
	define('MAXBUTTONS_VERSION_NUM', '1.26.0');
Stable tag: 1.26.0
* [How to Create WordPress Buttons?](http://www.maxbuttons.com/#CSS3/?utm_source=wordpress&utm_medium=mbrepo&utm_content=how-to-create&utm_campaign=plugin) 
* [How to make a WordPress Buttons?](http://www.maxbuttons.com/?utm_source=wordpress&utm_medium=mbrepo&utm_content=how-to-make&utm_campaign=plugin) 
* [What is a WordPress Button Generator?](http://maxbuttons.com/tour/button-editor/?utm_source=wordpress&utm_medium=mbrepo&utm_content=what-is-generator&utm_campaign=plugin)
* [How do I see my WordPress Buttons?](http://maxbuttons.com/tour/button-list/?utm_source=wordpress&utm_medium=mbrepo&utm_content=how-to-see&utm_campaign=plugin)
* [What's the best way to use Font Awesome with Wordpress?](http://www.maxbuttons.com/?utm_source=wordpress&utm_medium=mbrepo&utm_content=font-awesome&utm_campaign=plugin)
* [How do Button Pack libraries make me and my firm more effective?](http://www.maxbuttons.com/shop/category/button-packs/?utm_source=wordpress&utm_medium=mbrepo&utm_content=how-to-create&utm_campaign=plugin)
Take your buttons to the next level with [MaxButtons Pro](http://www.maxbuttons.com/pricing/?utm_source=wordpress&utm_medium=mbrepo&utm_content=MBPro&utm_campaign=plugin), which gives you additional features such as:
And the best part is that you can get this awesome [CSS3 button generator](http://www.maxbuttons.com/?utm_source=wordpress&utm_medium=mbrepo&utm_content=CSS3&utm_campaign=plugin) for **only $19!**
Fixed code: if (isset($_GET['id']) && $_GET['id'] != '' && intval($_GET['id']) != 0) {
} elseif(isset($_GET['id'])) {
	die();
} else {}
		<?php if(intval($button_id != 0)) { ?>
	<?php } else {
		die();
	} } ?>
Version: 1.26.1
	define('MAXBUTTONS_VERSION_NUM', '1.26.1');
Stable tag: 1.26.1
* [How to Create WordPress Buttons?](http://www.maxbuttons.com/#CSS3/?utm_source=wordpress&utm_medium=mbrepo&utm_content=how-to-create&utm_campaign=repo) 
* [How to make a WordPress Buttons?](http://www.maxbuttons.com/?utm_source=wordpress&utm_medium=mbrepo&utm_content=how-to-make&utm_campaign=repo) 
* [What is a WordPress Button Generator?](http://maxbuttons.com/tour/button-editor/?utm_source=wordpress&utm_medium=mbrepo&utm_content=what-is-generator&utm_campaign=repo)
* [How do I see my WordPress Buttons?](http://maxbuttons.com/tour/button-list/?utm_source=wordpress&utm_medium=mbrepo&utm_content=how-to-see&utm_campaign=repo)
* [What's the best way to use Font Awesome with Wordpress?](http://www.maxbuttons.com/?utm_source=wordpress&utm_medium=mbrepo&utm_content=font-awesome&utm_campaign=repo)
* [How do Button Pack libraries make me and my firm more effective?](http://www.maxbuttons.com/shop/category/button-packs/?utm_source=wordpress&utm_medium=mbrepo&utm_content=how-to-create&utm_campaign=repo)
Take your buttons to the next level with [MaxButtons Pro](http://www.maxbuttons.com/pricing/?utm_source=wordpress&utm_medium=mbrepo&utm_content=MBPro&utm_campaign=repo), which gives you additional features such as:
And the best part is that you can get this awesome [CSS3 button generator](http://www.maxbuttons.com/?utm_source=wordpress&utm_medium=mbrepo&utm_content=CSS3&utm_campaign=repo) for **only $19!**
= 1.26.1 =
* Fixed an XSS vulnerability on the button creation page