Skip to content

CX SQL_Injection @ src/main/webapp/ForgotPassword.jsp [master] #56

@kmcdon83

Description

@kmcdon83

SQL_Injection issue exists @ src/main/webapp/ForgotPassword.jsp in branch master

The application's rs=stmt.executeQuery method executes an SQL query with executeQuery, at line 42 of src\main\webapp\ForgotPassword.jsp. The application constructs this SQL query by embedding an untrusted string into the query without proper sanitization. The concatenated string is submitted to the database, where it is parsed and executed accordingly.
The attacker would be able to inject arbitrary data into the SQL query, by simply altering the user input ""username"", which is read by the rs=stmt.executeQuery method at line 42 of src\main\webapp\ForgotPassword.jsp. This input then flows through the code to the database server, without sanitization.
This may enable an SQL Injection attack.

Severity: High
CWE:89
Vulnerability details and guidance
Internal Guidance
Checkmarx
Lines: 42


Code (Line #42):

                  rs=stmt.executeQuery("select * from users where username='"+request.getParameter("username").trim()+"' and secret='"+request.getParameter("secret")+"'");

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions