Safeguard
Vulnerability Analysis•

CVE-2025-25351: Critical SQL Injection in PHPGurukul Expense Tracker

CVE-2025-25351 is a critical SQL injection in Daily Expense Tracker System 1.1. No fix is listed, so fix the query code, limit access or retire the app.

Safeguard Security Team
4 min read

CVE-2025-25351 is a critical severity (CVSS 9.8) SQL injection flaw in PHPGurukul Daily Expense Tracker System 1.1. The dateexpense input handled by /dets/add-expense.php reaches a database query unsafely. The record lists no patched release, so fix the query code, restrict access to the app, or retire it.

What's affected

  • Product: PHPGurukul Daily Expense Tracker System, a PHP or web application of the kind often downloaded as a learning project or small business tool.
  • Affected: version 1.1, as named in the record.
  • Fixed: the record names no fixed release. Check the vendor's site before assuming one exists.
  • Entry point: /dets/add-expense.php, through the dateexpense input.
  • Access: no login is needed. The attack is network based and needs no user interaction.
  • Public exploit information: the researcher's writeup is linked from the record. We did not retrieve details beyond the record.

How to check if you're exposed

Start by finding out whether you run this application at all. Look at your web roots and application inventory for the product name, and check which version the install reports.

Then look at the code. Search for the file and the input named in the record.

grep -rn "dateexpense" --include=*.php <path-to-app> | head -20

Read the query that handles the value. If the code builds the SQL string by joining the request value into it, the flaw is present. Prepared statements with bound values are the safe pattern.

Check the web server logs for requests to the affected page.

grep "add-expense.php" /var/log/nginx/access.log | less

Look for long or odd looking values, repeated requests from one address, and requests outside business hours. Then compare the database for rows you did not add, rows that have gone missing, or accounts you do not recognise.

What to do now

  1. Check whether the application is needed. If not, remove it, because an unpatched app with a public exploit write up has no good reason to stay online.
  2. If you need it, change the query code at the affected file so the value is bound as a parameter rather than joined into the SQL string.
  3. Restrict access with authentication at the web server, an allow list of addresses or a VPN until the code is fixed.
  4. Run the database account the app uses with the least privileges it needs, so a query flaw cannot drop tables or reach unrelated data.
  5. Back up the database, then review it for unexpected rows, changed values and new accounts.
  6. Rotate any credentials stored in the app's configuration if you saw suspicious requests.
  7. Check the vendor or project page regularly for a fixed release.

Why it matters

The class is SQL injection. A value from the request is joined into a database query as text, so the database cannot distinguish the developer's query from the caller's input. The input here is dateexpense, handled by /dets/add-expense.php.

  • CWE-89 is improper neutralization of special elements in an SQL command. Input that should be treated as data ends up inside the query text, so the database cannot tell the application's query from the caller's input.

The record tags CWE-89 alone. The standard fix is the same for every case of this class: use parameterised queries, validate input to the shape you expect, and give the database account only the rights the page needs.

This is the second flaw in the same file. A sibling record, CVE-2025-25349, covers the costitem parameter. A date field is a good reminder that input is not safe because it looks structured. A date typed into a form can be any text by the time it reaches the server.

// Generic pattern: bind the value instead of building the query string
$stmt = $con->prepare("SELECT * FROM some_table WHERE id = ?");
$stmt->bind_param("i", $id);
$stmt->execute();

Tutorial style PHP projects are a common source of this pattern. They are meant to teach, not to defend, and teams sometimes deploy them as they are. If you use one in production, treat it as code you now maintain, and review every place where a request value reaches a query.

Quick check

Why does a date field matter?

Because the server cannot trust the format. Anything that arrives in a request is text until the server checks it.

Is the costitem field affected too?

CVE-2025-25349 covers the costitem parameter of the same file.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.