Skip to content

Conversation

@mkovelam
Copy link
Owner

No description provided.

@amazon-inspector-preprod-iad
Copy link

⏳ I'm reviewing this pull request for security vulnerabilities and code quality issues. I'll provide an update when I'm done

String sql = "SELECT * FROM people WHERE favorite_color='" + favoriteColor + "'";
java.sql.Statement statement = connection.createStatement();
// Noncompliant: user-given input is not sanitized before use.
statement.execute(sql);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Description: Potential SQL Injection detected. Untrusted input is being directly included in an SQL query without proper parameterization. This can allow attackers to modify the query structure and execute arbitrary SQL commands. Use PreparedStatement with parameterized queries instead. Always validate and sanitize inputs before using them in queries. Learn more https://cwe.mitre.org/data/definitions/89.html

Severity: High

String sql = "SELECT * FROM people WHERE favorite_color='" + favoriteColor + "'";
java.sql.Statement statement = connection.createStatement();
// Noncompliant: user-given input is not sanitized before use.
statement.execute(sql);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Description: We detected an SQL command that might use unsanitized input. This can result in an SQL injection. To increase the security of your code, sanitize inputs before using them to form a query string.

Learn more

Severity: High

@amazon-inspector-preprod-iad
Copy link

✅ I finished the code review, and left comments with the issues I found.

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

Successfully merging this pull request may close these issues.

2 participants