Skip to content
Back to Blog
·10 min read·news

SQL Injection in Lost & Found Systems: Critical CVE-2023-2668 Explained

CVE-2023-2668 is a critical unauthenticated SQL injection flaw in open-source systems widely used by Indian SMBs. Learn the attack pattern and how to protect your applications.

BR

Bachao.AI Research Team

Cybersecurity Research

Source: NIST NVD

Scan Your Stack for This
SQL Injection in Lost & Found Systems: Critical CVE-2023-2668 Explained

Business impact of this development

Emerging threats move fast. Indian SMBs are primary targets because they're under-defended. Here's what you need to know and do now.

Last year, security researchers disclosed a critical SQL injection vulnerability in SourceCodester's Lost and Found Information System version 1.0. On the surface, this might sound like a niche issue affecting only colleges and airports. But vulnerabilities like this routinely become entry points for large-scale breaches—because the underlying pattern is far more common than any single application.

This post breaks down CVE-2023-2668, how it works, and what Indian SMBs must do to avoid similar exposure in their own systems.

What Happened

CVE-2023-2668 is a critical SQL injection vulnerability in the Lost and Found Information System (a popular open-source project on SourceCodester). The vulnerability exists in the admin panel's category management feature, specifically in how the system handles the id parameter in GET requests.

The vulnerable endpoint:

admin/?page=categories/manage_category&id=[PAYLOAD]

An unauthenticated attacker can craft a malicious SQL query and inject it directly into the id parameter. Because the application doesn't properly sanitize or validate user input before passing it to the database, the injected SQL executes with full database privileges.

What this means in practice:

    1. Attackers can read sensitive data (student records, lost item descriptions, contact information, payment details)
    2. They can modify or delete database records
    3. They can potentially escalate privileges and gain admin access
    4. In worst cases, they can execute commands on the underlying server
The vulnerability was disclosed publicly, meaning exploit code is available. This makes it a high-risk, high-likelihood threat for any organization using this system.

Originally reported by NIST NVD (CVE-2023-2668, VDB-228884)

A03:2021SQL Injection — OWASP Top 10 critical web vulnerability (OWASP)
40-50%Custom-built Indian SMB web applications found with SQL injection vulnerabilities
6 hoursCERT-In mandatory incident reporting window under CERT-In Directions 2022 (CERT-In)

Why This Matters for Indian Businesses

You might be thinking: "We don't use a Lost and Found system, so this doesn't affect us."

The real risk is the pattern — not the specific application.

The Pattern, Not Just the System

SQL injection vulnerabilities like CVE-2023-2668 are not rare. According to OWASP's top 10 vulnerabilities, SQL injection remains a critical category. This includes:

    1. Custom-built web applications
    2. Open-source software (especially older versions)
    3. Third-party management systems
    4. Legacy applications from smaller vendors
If any of these describe your stack, you are likely exposed to similar vulnerabilities.

DPDP Act Compliance Risk

India's Digital Personal Data Protection (DPDP) Act 2023 requires businesses to implement reasonable security measures to protect personal data, report data breaches to the Data Protection Board within 72 hours, and maintain audit trails demonstrating due diligence.

A SQL injection breach that exposes customer data puts you in direct violation of DPDP requirements. Penalties can reach up to ₹250 crores under the DPDP Act for significant data protection failures.

CERT-In Reporting Mandate

India's CERT-In requires organizations to report significant cybersecurity incidents within 6 hours under CERT-In Directions 2022. A SQL injection breach that compromises data qualifies. Failing to report violates the Information Technology Act Section 70B and can result in penalties and reputational damage.

Real Impact on Indian Institutions

Many Indian colleges, universities, and small institutions use open-source systems like this or similar applications. A single breach can expose student records, payment details from lost item claims, staff information, and institutional data — all of which is valuable to attackers on dark web marketplaces and useful for targeted phishing campaigns.

Technical Breakdown: How CVE-2023-2668 Works

The Vulnerable Code Pattern

php
<?php
// VULNERABLE CODE - DO NOT USE
$id = $_GET['id']; // User input directly from URL
$query = "SELECT * FROM categories WHERE id = " . $id; // Concatenated into SQL
$result = mysqli_query($connection, $query);
?>

When a user visits:

admin/?page=categories/manage_category&id=1

The query becomes: SELECT * FROM categories WHERE id = 1

But when an attacker visits:

admin/?page=categories/manage_category&id=1 OR 1=1 --

The query becomes: SELECT * FROM categories WHERE id = 1 OR 1=1 --

The 1=1 is always true, so the query returns all categories. The -- comments out the rest.

Attack Escalation

From here, an attacker can:

Extract all data:

sql
admin/?page=categories/manage_category&id=1 UNION SELECT username, password, email FROM admin_users --

Modify data:

sql
admin/?page=categories/manage_category&id=1; UPDATE admin_users SET password='hacked' WHERE id=1; --

Delete records:

sql
admin/?page=categories/manage_category&id=1; DROP TABLE categories; --

Attack Flow

graph TD A[Attacker Crafts Malicious URL] -->|injects SQL payload| B[Request Reaches Web Server] B -->|id=1 OR 1=1 appended| C[PHP Code Concatenates String] C -->|builds unsafe query| D[SQL Query Executes on DB] D -->|all rows returned| E[Sensitive Data Exposed] E -->|UNION query escalation| F[Admin Credentials Extracted] F -->|full system compromise| G[Breach Complete] style A fill:#5f1e1e,stroke:#EF4444,color:#e2e8f0 style D fill:#5f1e1e,stroke:#EF4444,color:#e2e8f0 style E fill:#5f1e1e,stroke:#EF4444,color:#e2e8f0 style F fill:#5f1e1e,stroke:#EF4444,color:#e2e8f0 style G fill:#5f1e1e,stroke:#EF4444,color:#e2e8f0 style B fill:#1e3a5f,stroke:#3B82F6,color:#e2e8f0 style C fill:#1e3a5f,stroke:#3B82F6,color:#e2e8f0
⚠️
WARNING
CVE-2023-2668 requires no authentication. An attacker needs only a browser and a modified URL. This is why it is classified critical severity — exploitation is trivial and the blast radius is significant.

Why This Is Critical

Unlike vulnerabilities that require authentication, complex exploitation, or specific configurations, CVE-2023-2668 requires none of these. An unauthenticated attacker can exploit it with just a modified URL — no special tools, no complex payload. This makes it a high-likelihood threat even for attackers with minimal skills.

Know your vulnerabilities before attackers do

Run a free VAPT scan — takes 5 minutes, no signup required.

Book Your Free Scan

How to Protect Your Business

Step 1: Patch or Replace the Vulnerable System

Check if SourceCodester has released a patched version. If not:

    1. Implement a Web Application Firewall (WAF) to block SQL injection patterns as a temporary measure
    2. Consider migrating to a maintained alternative
    3. Take the system offline if it handles sensitive personal data

Step 2: Implement Parameterized Queries

If you're a developer maintaining this or similar code, parameterized queries are the definitive fix:

php
<?php
// SECURE CODE - USE THIS INSTEAD
$id = $_GET['id'];

// Prepared statements — user input is treated as data, never as SQL
$stmt = $connection->prepare("SELECT * FROM categories WHERE id = ?");
$stmt->bind_param("i", $id); // "i" means integer type
$stmt->execute();
$result = $stmt->get_result();
?>

Or using PDO:

php
<?php
$id = $_GET['id'];
$stmt = $pdo->prepare("SELECT * FROM categories WHERE id = ?");
$stmt->execute([$id]);
$result = $stmt->fetchAll();
?>

Parameterized queries ensure that user input is treated as data, never as executable SQL code.

Step 3: Deploy a Web Application Firewall

A WAF can block common SQL injection patterns as a defense-in-depth layer:

bash
# ModSecurity (open-source WAF) on Apache
sudo apt-get install libapache2-mod-security2
sudo a2enmod security2
sudo systemctl restart apache2

The OWASP ModSecurity Core Rule Set blocks most SQL injection and XSS patterns out of the box.

Step 4: Harden Database Permissions

Limit blast radius even if SQL injection occurs:

sql
-- Create a restricted database user for the application
CREATE USER 'app_user'@'localhost' IDENTIFIED BY 'strong_password';

-- Grant only necessary permissions
GRANT SELECT, INSERT, UPDATE ON lost_and_found.* TO 'app_user'@'localhost';

-- Deny dangerous operations
REVOKE DROP, DELETE, CREATE ON lost_and_found.* FROM 'app_user'@'localhost';

FLUSH PRIVILEGES;

This way, even if an attacker injects SQL, they cannot drop tables or access other databases.

Step 5: Monitor for Attack Patterns

bash
# Monitor MySQL for suspicious SQL injection patterns
tail -f /var/log/mysql/general.log | grep -iE "OR 1=1|UNION|DROP|DELETE|--"

# Enable slow query log to catch anomalous queries
mysql -u root -p -e "SET GLOBAL slow_query_log = 'ON';"

SQL Injection Prevention Checklist for Indian SMBs

ControlDescriptionPriority
Parameterized queriesReplace all string-concatenated SQLCritical
WAF deploymentBlock injection patterns at perimeterHigh
DB least privilegeApp user has minimal required permissionsHigh
Input validationWhitelist expected input types/rangesHigh
Error suppressionNever expose SQL errors in productionMedium
CERT-In reportingDocument and practice the 6-hour reporting workflowHigh
Regular VAPTQuarterly scan for injection vulnerabilitiesMedium

How Bachao.AI Helps Detect This

Bachao.AI by Dhisattva AI Pvt Ltd automates what enterprise security teams do manually: scanning every input parameter across your web applications for injection vulnerabilities.

For a system like the one affected by CVE-2023-2668, a VAPT scan would:

    1. Send structured payloads to every form and URL parameter
    2. Detect SQL error responses indicating injectable endpoints
    3. Flag the id parameter in the admin category management page
    4. Provide a remediation report with parameterized query guidance
    5. Map findings to CVE database entries and OWASP categories
This is how Indian SMBs can achieve the same security visibility that large enterprises have — without a dedicated security team.

Action Plan

This week:

    1. [ ] Audit all web applications for open-source or custom SQL query construction
    2. [ ] Check if any use SourceCodester Lost and Found System version 1.0
    3. [ ] Review code for string-concatenated SQL queries
This month:
    1. [ ] Replace vulnerable SQL patterns with parameterized queries
    2. [ ] Deploy WAF if handling sensitive personal data
    3. [ ] Create a CERT-In incident response plan
Ongoing:
    1. [ ] Schedule quarterly VAPT scans
    2. [ ] Monitor CERT-In advisories for newly disclosed CVEs
    3. [ ] Train developers on secure coding practices (OWASP SAMM framework)

Frequently Asked Questions

What is SQL injection? SQL injection is a web security vulnerability where an attacker inserts malicious SQL code into input fields or URL parameters. When the application passes this input directly to the database without sanitization, the injected SQL executes — allowing data theft, modification, or deletion.

What is CVE-2023-2668? CVE-2023-2668 is a critical SQL injection vulnerability (CVSS 9.8) in SourceCodester Lost and Found Information System v1.0. The id parameter in the admin category management page is directly concatenated into SQL queries without validation, allowing unauthenticated remote attackers to extract or modify all database content.

Does this affect Indian businesses specifically? Yes. Open-source systems from SourceCodester and similar repositories are widely deployed in Indian educational institutions, government offices, and SMBs. Under India's DPDP Act 2023 and CERT-In Directions 2022, a breach via this vulnerability triggers mandatory reporting obligations.

Are parameterized queries enough? Parameterized queries fix the root cause of SQL injection. Combined with a WAF, database least-privilege, and error suppression in production, they provide robust protection against this class of vulnerability.

How do I know if my application has SQL injection vulnerabilities? Run a VAPT scan on your web applications. Automated scanners test every input parameter and URL for injection flaws, including SQL injection patterns mapped to the OWASP Top 10.

What should I do if I suspect my system has been compromised? Isolate the affected system, preserve all logs, and notify CERT-In within 6 hours per CERT-In Directions 2022. Engage a qualified security professional for forensic analysis.


Protect your business with Bachao.AI — India's automated vulnerability assessment and penetration testing platform by Dhisattva AI Pvt Ltd, DPIIT Recognized Startup. Get a comprehensive security scan of your web applications and infrastructure. Visit Bachao.AI to get started.

BR

Bachao.AI Research Team

Cybersecurity Research

AI-powered security research and threat intelligence from the Bachao.AI team. Covering the latest vulnerabilities, CVEs, and cybersecurity developments affecting Indian businesses.

Get cybersecurity insights for Indian SMBs

Weekly vulnerability alerts, DPDP compliance tips, and security guides. No spam — unsubscribe anytime.

We respect your privacy. Your email is never shared.

Check whether this class of vulnerability is exposed in your systems

Free automated scan — risk score in under 2 hours. No credit card required.

Scan Your Stack for This
Find your vulnerabilitiesStart free scan →