Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CX SQL_Injection @ src/main/webapp/vulnerability/DisplayMessage.jsp [master] #39

Open
RobertMickleCx opened this issue Aug 29, 2022 · 0 comments

Comments

@RobertMickleCx
Copy link
Owner

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

The application's rs=stmt.executeQuery method executes an SQL query with executeQuery, at line 16 of src\main\webapp\vulnerability\DisplayMessage.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.An attacker would be able to inject arbitrary syntax and data into the SQL query, by crafting a malicious payload and providing it via the input ""msgid""; this input is then read by the rs=stmt.executeQuery method at line 16 of src\main\webapp\vulnerability\DisplayMessage.jsp. This input then flows through the code, into a query and to the database server - without sanitization.This may enable an SQL Injection attack.

Severity: High

CWE:89

Checkmarx

Training
Recommended Fix

Lines: 16


Code (Line #16):

rs=stmt.executeQuery("select * from UserMessages where msgid="+request.getParameter("msgid"));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant