CVE-2015-10077 (published 2023-02-10T15:15Z)

A vulnerability was found in webbuilders-group silverstripe-kapost-bridge 0.3.3. It has been declared as critical. Affected by this vulnerability is the function index/getPreview of the file code/control/KapostService.php. The manipulation leads to sql injection. The attack can be launched remotely. Upgrading to version 0.4.0 is able to address this issue. The patch is named 2e14b0fd0ea35034f90890f364b130fb4645ff35. It is recommended to upgrade the affected component. The associated identifier of this vulnerability is VDB-220471.

CVSS v3 base score: 9.8, CRITICAL (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H)

Weakness information:
cwe_id: CWE-89
cwe_name: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
description: The product constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. Without sufficient removal or quoting of SQL syntax in user-controllable inputs, the generated SQL query can cause those inputs to be interpreted as SQL instead of ordinary user data.
extended_description: 
            
            
         
         

Fix information:
repo_url: https://github.com/webbuilders-group/silverstripe-kapost-bridge
commit_details: repo_url: https://github.com/webbuilders-group/silverstripe-kapost-bridge
author: UndefinedOffset
author_date: 2015-10-13 16:23:50-03:00
msg: Fixed potential sql injection points
repository: repo_url: https://github.com/webbuilders-group/silverstripe-kapost-bridge
repo_name: webbuilders-group/silverstripe-kapost-bridge
description: Bridge for Kapost driven content authoring, provides support for basic content pages. But also provides a flexible api to allow for custom content types.
repo_language: PHP
owner: webbuilders-group
file_changes: filename: KapostService.php
change_type: ModificationType.MODIFY
diff: @@ -121,11 +121,11 @@ class KapostService extends Controller implements PermissionProvider {
      */
     public function preview() {
         $auth=$this->request->getVar('auth');
-        $token=KapostPreviewToken::get()->filter('Code', Convert::raw2xml($auth))->first();
+        $token=KapostPreviewToken::get()->filter('Code', Convert::raw2sql($auth))->first();
         
         //Verify the token exists and hasn't expired yet
         if(!empty($token) && $token!==false && $token->exists() && time()-strtotime($token->Created)<self::config()->preview_expiry*60 && $token->KapostRefID==$this->urlParams['ID']) {
-            $kapostObj=KapostObject::get()->filter('KapostRefID', Convert::raw2xml($this->urlParams['ID']))->sort('"Created" DESC')->first();
+            $kapostObj=KapostObject::get()->filter('KapostRefID', Convert::raw2sql($this->urlParams['ID']))->sort('"Created" DESC')->first();
             if(!empty($kapostObj) && $kapostObj!==false && $kapostObj->exists()) {
                 $previewController=$kapostObj->renderPreview();
                 
@@ -734,7 +734,7 @@ class KapostService extends Controller implements PermissionProvider {
         
         
         //Detect if the record already exists or not so we can decide whether to create a new record or edit an existing
-        $existing=KapostObject::get()->filter('KapostRefID', Convert::raw2xml($content_id))->first();
+        $existing=KapostObject::get()->filter('KapostRefID', Convert::raw2sql($content_id))->first();
         if(!empty($existing) && $existing!==false && $existing->exists()) {
             $resultID=$content_id;
             
@@ -743,7 +743,7 @@ class KapostService extends Controller implements PermissionProvider {
             $resultID=$this->newPost($blog_id, $content, false, true);
             
             //Find the object
-            $existing=KapostObject::get()->filter('KapostRefID', Convert::raw2xml($resultID))->first();
+            $existing=KapostObject::get()->filter('KapostRefID', Convert::raw2sql($resultID))->first();
         }
         
         //Make sure we got the kapost hash back or an id if we got an object back we assume that it's a response

programming_language: PHP