脆弱性

モバイルサイトのマイページでのSQLインジェクション

  • 情報公開日:2008年 11月 04日
  • 危険度:中
  • 対象:Ver 2.1.2未満
------------------------------------------
脆弱性の種類
------------------------------------------
SQLインジェクション
-----------------------------------------
脆弱性のあるファイル
-----------------------------------------
data/class/pages/mypage/LC_Page_Mypage_Order.php
-----------------------------------------
対策
-----------------------------------------
=======================================================
変更前
=======================================================
function lfGetOrderDetail($order_id) {
        		$objQuery = new SC_Query();
        		$objQuery->setorder("classcategory_id1, classcategory_id2");
$arrRet = $objQuery->select($col, "dtb_order_detail", $where, array($order_id));
        		return $arrRet;
    	}
=======================================================
変更後
=======================================================
function lfGetOrderDetail($order_id) {
        		$objQuery = new SC_Query();
        		$objCustomer = new SC_Customer();
        		//customer_idを検証
        		$customer_id = $objCustomer->getValue("customer_id");
$order_count = $objQuery->count("dtb_order", "order_id = ? and customer_id = ?", array($order_id, $customer_id));
        		if ($order_count != 1) return array();
$col = "product_id, classcategory_id1, classcategory_id2, quantity";
        		$where = "order_id = ?";
        		$objQuery->setorder("classcategory_id1, classcategory_id2");
$arrRet = $objQuery->select($col, "dtb_order_detail", $where, array($order_id));
        		return $arrRet;
    	}
close icon
EC-CUBEペイメントプラス

決済導入なら、EC-CUBE公式決済

公式決済について詳しく知る

EC-CUBE公式 Amazon Pay

CVRアップの事例多数

Amazon Payについて詳しく知る

無料相談受付中!

アドバイザーに相談する