Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1336 CNY

100%

CVE-2025-7461 PoC — code-projects Modern Bag action.php sql injection

Source
Associated Vulnerability
Title: code-projects Modern Bag action.php sql injection (CVE-2025-7461)
Description:A vulnerability was found in code-projects Modern Bag 1.0 and classified as critical. Affected by this issue is some unknown functionality of the file /action.php. The manipulation of the argument proId leads to sql injection. The attack may be launched remotely. The exploit has been disclosed to the public and may be used.
Readme
# CVE-2025-7461: SQL Injection Vulnerability Analysis in Modern Bag E-commerce System

🌐 **Language / 语言**: **English** | [简体中文](README_zh.md)

---

## Vulnerability Overview

**Vulnerability Database:**
[https://vuldb.com/?id.316112](https://vuldb.com/?id.316112)

**Project Source:**
[https://code-projects.org/modern-bag-in-php-css-javascript-and-mysql-free-download/](https://code-projects.org/modern-bag-in-php-css-javascript-and-mysql-free-download/)

| Item | Details |
|------|---------|
| **Product Name** | Modern Bag E-commerce System |
| **Version** | V1.0 |
| **Vulnerability Type** | SQL Injection (Boolean-based blind, Error-based, Time-based blind) |
| **Affected File** | `/action.php` |
| **Severity Level** | Medium |
| **CVSS 3.1 Score** | **6.9** |

## Detailed Vulnerability Analysis

### Vulnerability Location
**Primary Vulnerability Point:** Lines 272-289 in `action.php`

```php
// Vulnerable code
if (isset($_POST["addToProduct"])) {
    if (isset($_SESSION["uid"])) {
        $p_id = $_POST["proId"];  // Direct user input retrieval
        $user_id = $_SESSION["uid"];
        
        // Direct concatenation into SQL query without any filtering
        $sql = "SELECT * FROM cart WHERE p_id = '$p_id' AND user_id = '$user_id'";
        $run_query = mysqli_query($con, $sql);
        $count = mysqli_num_rows($run_query);
        // ... subsequent code
    }
}
```

### 🔬 Root Cause Analysis

#### **Lack of Input Validation**
```php
$p_id = $_POST["proId"]; 
```
The application directly accepts user input from the `proId` parameter without any validation or sanitization.

#### **String Concatenation for SQL Construction**
```php
$sql = "SELECT * FROM cart WHERE p_id = '$p_id' AND user_id = '$user_id'";
```
The SQL query is constructed using direct string concatenation, making it vulnerable to injection attacks.

#### **Inadequate Error Handling**
```php
$run_query = mysqli_query($con, $sql)
    or die(mysqli_error($con));  // ❌ Direct exposure of database errors
```
Database errors are directly exposed to attackers, providing valuable information for exploitation.

---
**Report Prepared:** 2025
**Vulnerability ID:** CVE-2025-7461
**Severity:** Medium (CVSS 3.1: 6.9)
**Status:** Disclosed 
File Snapshot

Log in to view the POC file snapshot cached by Shenlong Bot

Log in to view
Remarks
    1. It is advised to access via the original source first.
    2. Local POC snapshots are reserved for subscribers — if the original source is unavailable, the local mirror is part of the paid plan.
    3. Mirroring, verifying, and maintaining this POC archive takes ongoing effort, so local snapshots are a paid feature. Your subscription keeps the archive online — thank you for the support. View subscription plans →