Skip to content

Conversation

fba223
Copy link
Owner

@fba223 fba223 commented Oct 14, 2024

Fixes https://github.com/fba223/demo-python/security/code-scanning/1

To fix the SQL injection vulnerability, we should use parameterized queries. This approach ensures that user input is properly escaped and treated as data rather than executable code.

In the provided code, we need to modify the SQL queries on lines 16 and 22 to use parameterized queries. This can be done by using placeholders (%s) in the SQL string and passing the user-provided values as parameters to the cursor.execute method.

Suggested fixes powered by Copilot Autofix. Review carefully before merging.

…ources

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@fba223
Copy link
Owner Author

fba223 commented Oct 14, 2024

yets

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.

1 participant