CVE-2026-7130
Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.
NVD · uneditedA flaw has been found in SourceCodester Pharmacy Sales and Inventory System 1.0. The affected element is an unknown function of the file /ajax.php?action=delete_category. Executing a manipulation of the argument ID can lead to sql injection. The attack may be performed from remote. The exploit has been published and may be used.
Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.
dbcve analysis · high confidenceSQL injection vulnerability in SourceCodester Pharmacy Sales and Inventory System 1.0 allows remote attackers to inject arbitrary SQL commands via the ID parameter in the /ajax.php?action=delete_category endpoint. The application fails to sanitize user input before using it in SQL queries.
Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.
CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.
From the vector- Attack vector
- Network
- Complexity
- Low
- Privileges
- None
- User interaction
- None
- Scope
- Unchanged
- Confidentiality
- Low
- Integrity
- Low
- Availability
- Low
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L
Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.
dbcve checksWork through these to decide whether this CVE applies to you.
-
Confirm the application versionLocate and inspect the version information file in the SourceCodester Pharmacy Sales and Inventory System installation directory, or check any About/Version page within the application UI. Compare against version 1.0.Affected if The installed version is 1.0 (the only affected version listed)
-
Verify the ajax.php endpoint existsCheck for the presence of the file ajax.php in the web root or application directory of the Pharmacy Sales and Inventory System installation.Affected if The ajax.php file exists and is accessible via the web server
-
Locate the delete_category action handlerOpen ajax.php and search for the code block handling 'delete_category' under the action parameter. Note how the ID parameter is processed and used in database queries.Affected if The delete_category action is present and processes the ID parameter without visible input sanitization or parameterized queries
-
Inspect SQL query construction for the ID parameterWithin the delete_category code block, examine how the ID parameter value is incorporated into the SQL query. Look for direct string concatenation or interpolation of the ID into the query without using prepared statements or escaping functions.Affected if The ID parameter is used directly in SQL query construction without sanitization, prepared statements, or parameter binding
-
Check if the endpoint is accessibleAttempt to access or probe the endpoint /ajax.php?action=delete_category to confirm it is reachable and processes requests. This may require authenticated access depending on application configuration.Affected if The endpoint responds and processes the ID parameter without validation
A user is affected if they are running SourceCodester Pharmacy Sales and Inventory System version 1.0 and the ajax.php file contains the delete_category action that directly uses the ID parameter in unsanitized SQL queries.
Generated from the published advisory. Verify against your own configuration.
Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.
dbcve · scopedReplace dynamic SQL queries with prepared statements/parameterized queries for the ID parameter in the delete_category function. Consider implementing input validation and least-privilege database accounts.
- 1. Access the server hosting the SourceCodester Pharmacy Sales and Inventory System and locate the file `ajax.php` in the web root.
- 2. Open `ajax.php` and find the code block that handles the `delete_category` action (e.g., `if(isset($_GET['action']) && $_GET['action'] == 'delete_category')`).
- 3. Identify the SQL query that directly uses the `id` parameter (for example: `DELETE FROM categories WHERE id = " . $_GET['id']`).
- 4. Replace the dynamic SQL with a prepared statement. Using MySQLi: `$stmt = $conn->prepare("DELETE FROM categories WHERE id = ?"); $stmt->bind_param("i", $id);`. Using PDO: `$stmt = $pdo->prepare("DELETE FROM categories WHERE id = :id"); $stmt->bindParam(':id', $id, PDO::PARAM_INT);`.
- 5. Sanitize the input by casting the `id` to an integer: `$id = isset($_GET['id']) ? intval($_GET['id']) : 0;` (or use `filter_var($_GET['id'], FILTER_VALIDATE_INT)`).
- 6. Execute the prepared statement with the sanitized `$id`.
- 7. Save the modified `ajax.php` and test the fix: call `/ajax.php?action=delete_category&id=1` (should delete the category) and attempt `/ajax.php?action=delete_category&id=1 OR 1=1` (should fail or return no data).
- 8. Deploy the patched file to production and verify that the SQL injection vulnerability is no longer present.
Generated from the published advisory — verify against the referenced sources before acting.
- Consultation3.0 h
- Implementation2.0 h
- Testing2.0 h
- Review / QA1.0 h
An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $2,304.
Scan for this in your stack
Free · runs locallyCheck whether your project pulls in CVE-2026-7130 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.
References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.
Primary sourcesPractitioner notes
ContributedPeer-ranked notes from engineers who’ve handled CVE-2026-7130 in production — separate from our analysis above.
The advisory tells you what broke. It rarely tells you what actually worked. If you’ve dealt with this one, that detail is what the next engineer is searching for.
- The version that genuinely resolved it — not the one the vendor claimed
- A config change or rule that shut the vector down
- A gotcha in the upgrade path that cost you an afternoon
No notes yet
Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.
A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.
- Verified mitigations, workarounds, and config changes
- Version or environment caveats, and links to real fixes
- No weaponised exploit code, or anything meant to cause harm
- No spam, self-promotion, credentials, or personal data