Online Book Store Project v1.0 - Unauthenticated SQL Injection (SQLi)

Summary

NameOnline Book Store Project v1.0 - Unauthenticated SQL Injection (SQLi)
Code name
ProductOnline Book Store Project
Affected versionsVersion 1.0
StatePublic
Release date2023-09-28

Vulnerabilities

KindUnauthenticated SQL Injection (SQLi)
Rule
RemoteYes
CVSSv3.1 VectorCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
CVSSv3.1 Base Score9.8
Exploit availableYes
CVE ID(s)

Description

The 'bookisbn' parameter of the cart.php resource does not validate the characters received and they are sent unfiltered to the database. The relevant vulnerable code is:

cart.php:

if(isset($_SESSION['cart']) && (array_count_values($_SESSION['cart']))){
    $_SESSION['total_price'] = total_price($_SESSION['cart']);
    $_SESSION['total_items'] = total_items($_SESSION['cart']);

cart_functions.php:

function total_price($cart){ $price = 0.0; if(is_array($cart)){ foreach($cart as $isbn => $qty){
            $bookprice = getbookprice($isbn);
            if($bookprice){
                $price += $bookprice * $qty;
            }
        }
    }
    return $price;
}

database_functions.php:

function getbookprice($isbn){
    $conn = db_connect();
    $query = "SELECT book_price FROM books WHERE book_isbn = '$isbn'";
    $result = mysqli_query($conn, $query);
    if(!$result){
        echo "get book price failed! " . mysqli_error($conn);
        exit;
    }
    $row = mysqli_fetch_assoc($result);
    return $row['book_price'];
}

Our security policy

We have reserved the ID CVE-2023-43739 to refer to this issue from now on.

System Information

  • Version: Online Book Store Project v1.0
  • Operating System: Any

Mitigation

There is currently no patch available for this vulnerability.

Credits

The vulnerability was discovered by Andres Roldan from Fluid Attacks' Offensive Team.

References

Vendor page https://projectworlds.in/

Timeline

Time-lapse-logo

2023-09-21

Vulnerability discovered.

Time-lapse-logo

2023-09-21

Vendor contacted.

Time-lapse-logo

2023-09-28

Public Disclosure.

Fluid Logo Footer

Hacking software for over 20 years

Fluid Attacks tests applications and other systems, covering all software development stages. Our team assists clients in quickly identifying and managing vulnerabilities to reduce the risk of incidents and deploy secure technology.

Copyright © 0 Fluid Attacks. We hack your software. All rights reserved.