/

CVE-2025-67404

Severity:

CRITICAL RISK

(9.8)

SQL Injection (CWE-89) in CASAP Enrollment System 1.0

CVE-2025-67404

Deferred

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Database Compromise and Authentication Bypass

Severity:

CRITICAL RISK

(9.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A critical SQL injection flaw in the CASAP Automated Enrollment System 1.0 allows attackers to manipulate database queries via the fname, lname, and student_class parameters in save_stud.php.

When user input is concatenated directly into SQL statements without proper validation or parameterization, an attacker can bypass authentication, exfiltrate data, or modify enrollment records.

A critical SQL injection flaw in the CASAP Automated Enrollment System 1.0 allows attackers to manipulate database queries via the fname, lname, and student_class parameters in save_stud.php.

When user input is concatenated directly into SQL statements without proper validation or parameterization, an attacker can bypass authentication, exfiltrate data, or modify enrollment records.

Affected context

This vulnerability occurs in the web-based enrollment workflow where student information is submitted through forms and processed by save_stud.php.

It is relevant in deployments where user-provided data (such as first name, last name, and class selection) is sent to the server and used to build SQL queries without prepared statements or robust input handling.

Any instance exposed to untrusted users, including public-facing or shared institutional networks, may be affected if database access is not tightly restricted.

This vulnerability occurs in the web-based enrollment workflow where student information is submitted through forms and processed by save_stud.php.

It is relevant in deployments where user-provided data (such as first name, last name, and class selection) is sent to the server and used to build SQL queries without prepared statements or robust input handling.

Any instance exposed to untrusted users, including public-facing or shared institutional networks, may be affected if database access is not tightly restricted.

Exploit preconditions

  • Attack surface: HTTP requests to the save_stud.php endpoint handling student registration or record creation.
  • Required access: Ability to submit or intercept enrollment form data, typically as an unauthenticated or low-privileged user.
  • Trigger point: Processing of fname, lname, and student_class parameters where user input is concatenated into SQL queries.
  • Why exploitation is possible: The application constructs SQL statements directly from user-controlled values without using parameterized queries or adequate escaping, allowing injected syntax to alter the query's logic.
  • Attack surface: HTTP requests to the save_stud.php endpoint handling student registration or record creation.
  • Required access: Ability to submit or intercept enrollment form data, typically as an unauthenticated or low-privileged user.
  • Trigger point: Processing of fname, lname, and student_class parameters where user input is concatenated into SQL queries.
  • Why exploitation is possible: The application constructs SQL statements directly from user-controlled values without using parameterized queries or adequate escaping, allowing injected syntax to alter the query's logic.

Why this happens

The underlying issue maps to CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection').

In save_stud.php, user-supplied parameters (fname, lname, student_class) are likely inserted into SQL strings directly, treating untrusted input as part of the command structure.

This insecure pattern arises whenever applications rely on string concatenation to build database queries instead of separating data and code through prepared statements or query builders.

As a result, attackers can inject additional SQL keywords, operators, or subqueries to control the database interaction beyond the intended enrollment operation.

The underlying issue maps to CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection').

In save_stud.php, user-supplied parameters (fname, lname, student_class) are likely inserted into SQL strings directly, treating untrusted input as part of the command structure.

This insecure pattern arises whenever applications rely on string concatenation to build database queries instead of separating data and code through prepared statements or query builders.

As a result, attackers can inject additional SQL keywords, operators, or subqueries to control the database interaction beyond the intended enrollment operation.

Potential impact

  • May allow retrieval of sensitive student or administrative data from the database.
  • Could enable modification or deletion of enrollment records and related academic data.
  • Can lead to creation of fraudulent accounts or manipulation of user roles and permissions.
  • May be used to bypass authentication or authorization mechanisms implemented at the database level.
  • Could expose database credentials and internal schema details, facilitating broader system compromise.
  • May allow retrieval of sensitive student or administrative data from the database.
  • Could enable modification or deletion of enrollment records and related academic data.
  • Can lead to creation of fraudulent accounts or manipulation of user roles and permissions.
  • May be used to bypass authentication or authorization mechanisms implemented at the database level.
  • Could expose database credentials and internal schema details, facilitating broader system compromise.

General mitigation guidance

Effective mitigation focuses on ensuring that user input never alters the structure of SQL statements.

Common defensive patterns include:

  • Using parameterized queries or prepared statements so that input is always treated as data, not executable SQL.
  • Employing server-side validation and normalization of incoming values, especially for identifiers such as names and class fields.
  • Adopting ORM or query-builder abstractions that enforce separation between query logic and parameters by design.
  • Applying least-privilege database accounts so the application can perform only necessary operations, limiting the blast radius of any injected query.
  • Centralizing database access logic and enforcing secure coding guidelines to make safe patterns the default.

Effective mitigation focuses on ensuring that user input never alters the structure of SQL statements.

Common defensive patterns include:

  • Using parameterized queries or prepared statements so that input is always treated as data, not executable SQL.
  • Employing server-side validation and normalization of incoming values, especially for identifiers such as names and class fields.
  • Adopting ORM or query-builder abstractions that enforce separation between query logic and parameters by design.
  • Applying least-privilege database accounts so the application can perform only necessary operations, limiting the blast radius of any injected query.
  • Centralizing database access logic and enforcing secure coding guidelines to make safe patterns the default.

How teams detect issues like this

Organizations can detect SQL injection risks through:

  • Static analysis rules that flag dynamic SQL construction, string concatenation with request parameters, and unsafe API usage.
  • Manual code review of database interaction layers, looking for direct interpolation of $_POST or $_GET variables into query strings.
  • Runtime application security testing, including fuzzing of form fields (such as fname, lname, and student_class) with SQL meta-characters and payloads to observe anomalous database responses.
  • Logging and monitoring of unusual query patterns, including sudden schema access, union-based queries, or error messages revealing SQL syntax issues.
  • Enforcing secure coding policies in CI/CD pipelines and using automated tools to block deployments containing known injection patterns.

Organizations can detect SQL injection risks through:

  • Static analysis rules that flag dynamic SQL construction, string concatenation with request parameters, and unsafe API usage.
  • Manual code review of database interaction layers, looking for direct interpolation of $_POST or $_GET variables into query strings.
  • Runtime application security testing, including fuzzing of form fields (such as fname, lname, and student_class) with SQL meta-characters and payloads to observe anomalous database responses.
  • Logging and monitoring of unusual query patterns, including sudden schema access, union-based queries, or error messages revealing SQL syntax issues.
  • Enforcing secure coding policies in CI/CD pipelines and using automated tools to block deployments containing known injection patterns.

Sources

SourceLink
github.comgithub.com/um-dsp/TaintRadar/blob/main/sql_injection_cves/automated/20250811-casap-automated-enrollment-system-save_stud.php-fname-sqli/20250811-casap-automated-enrollment-system-save_stud.php-fname-sqli.md

Frequently asked

questions

Yes. Any remote user able to interact with the enrollment form or send crafted requests to save_stud.php can potentially exploit the SQL injection flaw, assuming the endpoint is network-accessible.

Typically only the ability to submit HTTP requests to the vulnerable endpoint is required. In many deployments, this can be done as an unauthenticated or minimally authenticated user, making exploitation relatively low-barrier.

The most robust fix is to replace all dynamically constructed SQL in save_stud.php with prepared statements or parameterized queries, ensuring that fname, lname, and student_class are always treated as bound parameters. This should be paired with strict input validation and least-privilege database access.

Establish secure coding standards that prohibit string-based query construction, adopt frameworks or ORMs that enforce parameterization by default, and integrate static analysis and security testing into the development lifecycle to catch unsafe patterns early. Regular security-focused code reviews of database-access code can further reduce the risk.

Yes. Any remote user able to interact with the enrollment form or send crafted requests to save_stud.php can potentially exploit the SQL injection flaw, assuming the endpoint is network-accessible.

Typically only the ability to submit HTTP requests to the vulnerable endpoint is required. In many deployments, this can be done as an unauthenticated or minimally authenticated user, making exploitation relatively low-barrier.

The most robust fix is to replace all dynamically constructed SQL in save_stud.php with prepared statements or parameterized queries, ensuring that fname, lname, and student_class are always treated as bound parameters. This should be paired with strict input validation and least-privilege database access.

Establish secure coding standards that prohibit string-based query construction, adopt frameworks or ORMs that enforce parameterization by default, and integrate static analysis and security testing into the development lifecycle to catch unsafe patterns early. Regular security-focused code reviews of database-access code can further reduce the risk.

Find out what's already
exploitable in your codebase.