Fix SQL Injection for UAT#52
Open
NormanWenzelWSS wants to merge 1 commit into
Open
Conversation
NormanWenzelWSS
commented
Oct 30, 2023
| protected AttackResult injectableQueryIntegrity(String name, String auth_tan) { | ||
| StringBuffer output = new StringBuffer(); | ||
| String query = "SELECT * FROM employees WHERE last_name = '" + name + "' AND auth_tan = '" + auth_tan + "'"; | ||
| String query = "SELECT * FROM employees WHERE last_name = '" + name + "' AND auth_tan = " + "?"; |
Owner
Author
There was a problem hiding this comment.
Mend Code Security Check
New finding (1 of 4)
The Mend Code Security Check of your branch failed because of a SQL Injection finding in this line.
| Severity | Vulnerability Type | CWE | File | Data Flows | Date |
|---|---|---|---|---|---|
| SQL Injection | 1 | 2023-07-04 09:25am | |||
NormanWenzelWSS
commented
Oct 30, 2023
| SqlInjectionLesson8.log(connection, query); | ||
| ResultSet results = statement.executeQuery(query); | ||
| statement.setString(1, auth_tan); | ||
| ResultSet results = statement.executeQuery(); |
Owner
Author
There was a problem hiding this comment.
Mend Code Security Check
New finding (2 of 4)
The Mend Code Security Check of your branch failed because of a XSS finding in this line.
| Severity | Vulnerability Type | CWE | File | Data Flows | Date |
|---|---|---|---|---|---|
| XSS | 1 | 2023-07-04 09:25am | |||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

This PR contains an automated remediation suggestion created by Mend SAST. It will fix the following vulnerability in your custom code: