Project: Wordpress Plugin Photo Video Store 18.05

Vulnerability: #8928929 (2018-07-26 19:06:38)

Warning

There are many false positives, or unexploitable vulnerabilities. Please create working "PoC" exploit before reporting anything to vendor!

Details:

Sink @FUNCTION::mysqli_query
Risk _REQUEST
/photo-video-store/includes/payments/paypal/notification.php:103 (show/hide source)
83  			"send_money" ) ) {
84  			$transaction_id = pvs_transaction_add( "paypal", @$_REQUEST["txn_id"], $_REQUEST["product_type"],
85  				$_REQUEST["item_number"] );
86  
87  			if ( $_REQUEST["product_type"] == "credits" and ! pvs_is_order_approved( $_REQUEST["item_number"], 'credits' ) )
88  			{
89  				pvs_credits_approve( $_REQUEST["item_number"], $transaction_id );
90  				pvs_send_notification( 'credits_to_user', $_REQUEST["item_number"] );
91  				pvs_send_notification( 'credits_to_admin', $_REQUEST["item_number"] );
92  			}
93  
94  			if ( $_REQUEST["product_type"] == "subscription" and ! pvs_is_order_approved( $_REQUEST["item_number"], 'subscription' ) )
95  			{
96  				pvs_subscription_approve( $_REQUEST["item_number"] );
97  				pvs_send_notification( 'subscription_to_user', $_REQUEST["item_number"] );
98  				pvs_send_notification( 'subscription_to_admin', $_REQUEST["item_number"] );
99  			}
100  
101  			if ( $_REQUEST["product_type"] == "order" and ! pvs_is_order_approved( $_REQUEST["item_number"], 'order' ) )
102  			{
103 pvs_order_approve( $_REQUEST["item_number"] );
104 pvs_commission_add( $_REQUEST["item_number"] ); 105
Threat level 1

Callstack:

TMySQLConnection::execute /photo-video-store/includes/functions/mysqldb.php:19 (show/hide source)
1  <?php
2  // Exit if accessed directly.
3  if ( ! defined( 'ABSPATH' ) )
4  {
5  	exit;
6  }
7  
8  class TMySQLConnection
9  {
10  	var $connection;
11  
12  	function connect()
13  	{
14  		$this->connection = mysqli_connect( DB_HOST, DB_USER, DB_PASSWORD, DB_NAME );
15  	}
16  
17  	function execute( $query )
18  	{
19 if ( $mysqli_result = mysqli_query( $this->connection, $query ) )
20 { 21 return $mysqli_result;
TMySQLQuery::open /photo-video-store/includes/functions/mysqldb.php:52 (show/hide source)
32  }
33  
34  class TMySQLQuery
35  {
36  	var $connection;
37  	var $result;
38  	var $row;
39  	var $trow;
40  	var $eof;
41  	var $addnew;
42  	var $source;
43  	var $rc;
44  
45  	function __construct()
46  	{
47  		$this->connection = new TMySQLConnection;
48  	}
49  
50  	function open( $query )
51  	{
52 $this->result = $this->connection->execute( $query );
53 $this->movenext(); 54 }
@FUNCTION::pvs_affiliate_add_commission /photo-video-store/includes/functions/functions.php:7662 (show/hide source)
7642  				{
7643  					$user_info2 = get_userdata($user_info->aff_referal);
7644  
7645  					$total = $total * $user_info2->aff_commission_buyer / 100;
7646  					$sql = "insert into " . PVS_DB_PREFIX .
7647  						"affiliates_signups (userid,types,types_id,rates,total,data,aff_referal,status) values (" .
7648  						$user_info->ID . ",'" . $type . "'," . $id . "," . $user_info2-> aff_commission_buyer .
7649  						"," . $total . "," . pvs_get_time( date( "H" ), date( "i" ), date( "s" ), date( "m" ),
7650  						date( "d" ), date( "Y" ) ) . "," . $user_info->aff_referal . ",1)";
7651  					$db->execute( $sql );
7652  					pvs_send_notification( "commission_to_affiliate", $user_info->ID, "S" . $id,
7653  						"", $total );
7654  				}
7655  			}
7656  		}
7657  
7658  		if ( $type == "credits" )
7659  		{
7660  			$sql = "select user,credits from " . PVS_DB_PREFIX .
7661  				"credits_list where id_parent=" . ( int )$id;
7662 $dp->open( $sql );
7663 if ( ! $dp->eof ) 7664 {
@FUNCTION::pvs_order_approve /photo-video-store/includes/functions/functions.php:5223 (show/hide source)
5203  
5204  
5205  
5206  
5207  
5208  /**
5209   * Approve order
5210   *
5211   * @param  int $pid order ID.
5212   */
5213  function pvs_order_approve( $pid )
5214  {
5215  	global $db;
5216  	$dp = new TMySQLQuery;
5217  	$dp->connection = $db;
5218  
5219  	$sql = "update " . PVS_DB_PREFIX . "orders set status=1 where id=" . ( int )$pid;
5220  	$db->execute( $sql );
5221  
5222  	//Affiliate commission
5223 pvs_affiliate_add_commission( $pid, "orders" );
5224 5225 pvs_downloads_create( $pid );
@INLINE::/photo-video-store/includes/payments/paypal/notification.php /photo-video-store/includes/payments/paypal/notification.php:103 (show/hide source)
83  			"send_money" ) ) {
84  			$transaction_id = pvs_transaction_add( "paypal", @$_REQUEST["txn_id"], $_REQUEST["product_type"],
85  				$_REQUEST["item_number"] );
86  
87  			if ( $_REQUEST["product_type"] == "credits" and ! pvs_is_order_approved( $_REQUEST["item_number"], 'credits' ) )
88  			{
89  				pvs_credits_approve( $_REQUEST["item_number"], $transaction_id );
90  				pvs_send_notification( 'credits_to_user', $_REQUEST["item_number"] );
91  				pvs_send_notification( 'credits_to_admin', $_REQUEST["item_number"] );
92  			}
93  
94  			if ( $_REQUEST["product_type"] == "subscription" and ! pvs_is_order_approved( $_REQUEST["item_number"], 'subscription' ) )
95  			{
96  				pvs_subscription_approve( $_REQUEST["item_number"] );
97  				pvs_send_notification( 'subscription_to_user', $_REQUEST["item_number"] );
98  				pvs_send_notification( 'subscription_to_admin', $_REQUEST["item_number"] );
99  			}
100  
101  			if ( $_REQUEST["product_type"] == "order" and ! pvs_is_order_approved( $_REQUEST["item_number"], 'order' ) )
102  			{
103 pvs_order_approve( $_REQUEST["item_number"] );
104 pvs_commission_add( $_REQUEST["item_number"] ); 105