Skip to content

Conversation

@austenstone
Copy link
Member

Potential fix for https://github.com/octodemo/vulnerable-node/security/code-scanning/24

To fix the problem, we need to use parameterized queries to safely embed user-provided data into the SQL query strings. This approach ensures that the user input is treated as a literal value and not as part of the SQL command, thus preventing SQL injection attacks.

We will modify the functions getProduct, search, purchase, and get_purcharsed in the model/products.js file to use parameterized queries provided by the pg-promise library.

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

…om user-controlled sources

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
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