脆弱性

お届け先入力ページでのSQLインジェクション

  • 情報公開日:2008年 11月 04日
  • 危険度:中
  • 対象:Ver 2.1.2未満
------------------------------------------
脆弱性の種類
------------------------------------------
SQLインジェクション
-----------------------------------------
脆弱性のあるファイル
-----------------------------------------
data/class/pages/shopping/LC_Page_Shopping_Deliv.php
-----------------------------------------
対策
-----------------------------------------
=========================================
変更前 2系
=========================================
155行目付近

2系 変更前
if (SC_Utils_Ex::sfIsInt($_POST['deliv_check'])) {
    // 登録済みの別のお届け先を受注一時テーブルに書き込む
    $this->lfRegistOtherDelivData($uniqid, $objCustomer, $_POST['deliv_check']);
    // 正常に登録されたことを記録しておく
    $objSiteSess->setRegistFlag();
    // お支払い方法選択ページへ移動
    $this->sendRedirect($this->getLocation(URL_SHOP_PAYMENT, array(), true));
    exit;
}


=========================================
変更後 2系
=========================================
$objQuery = new SC_Query();
if (SC_Utils_Ex::sfIsInt($_POST['deliv_check'])) {
    $deliv_count = $objQuery->count("dtb_other_deliv","customer_id=? and other_deliv_id = ?" ,array($objCustomer->getValue('customer_id'), $_POST['deliv_check']));
    if ($deliv_count != 1) {
        SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR);
    }
    // 登録済みの別のお届け先を受注一時テーブルに書き込む
    $this->lfRegistOtherDelivData($uniqid, $objCustomer, $_POST['deliv_check']);
    // 正常に登録されたことを記録しておく
    $objSiteSess->setRegistFlag();
    // お支払い方法選択ページへ移動
    $this->sendRedirect($this->getLocation(URL_SHOP_PAYMENT, array(), true));
    exit;
}


=========================================
変更前 2系モバイル
=========================================
343行目付近

if (SC_Utils_Ex::sfIsInt($_POST['other_deliv_id'])) {
                    // 登録済みの別のお届け先を受注一時テーブルに書き込む
                    $this->lfRegistOtherDelivData($uniqid, $objCustomer, $_POST['other_deliv_id']);
                    // 正常に登録されたことを記録しておく
                    $objSiteSess->setRegistFlag();
                    // お支払い方法選択ページへ移動
                    $this->sendRedirect($this->getLocation(MOBILE_URL_SHOP_PAYMENT), true);
                    exit;
                }

=========================================
変更後 2系モバイル
=========================================
$objQuery = new SC_Query();
if (SC_Utils_Ex::sfIsInt($_POST['other_deliv_id'])) {
    $deliv_count = $objQuery->count("dtb_other_deliv","customer_id=? and other_deliv_id = ?" ,array($objCustomer->getValue('customer_id'),$_POST['other_deliv_id']));
    if ($deliv_count != 1) {
        SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR);
    }
    // 登録済みの別のお届け先を受注一時テーブルに書き込む
    $this->lfRegistOtherDelivData($uniqid, $objCustomer, $_POST['other_deliv_id']);
    // 正常に登録されたことを記録しておく
    $objSiteSess->setRegistFlag();
    // お支払い方法選択ページへ移動
    $this->sendRedirect($this->getLocation(MOBILE_URL_SHOP_PAYMENT), true);
    exit;
}

EC-CUBE公式アドバイザー
無料ご相談窓口

  • 他社のASPやパッケージとの違いを知りたい
  • BtoCのサイトにBtoB機能を追加したい
  • 何から手をつければよいかわからない
  • オープンソースならではの注意事項を知りたい
  • 自社にマッチした制作会社を探したい
  • サイト制作だけでなく運営もサポートしてほしい

新規構築・リニューアル・取引先向けのWeb受発注システム(BtoB)や事業の拡大など、
今抱えている課題を解決する最適な業者探しを、アドバイザーがお手伝いします。