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

Fix code scanning alert no. 327: SQL query built from user-controlled sources #460

Closed
wants to merge 1 commit into from

Conversation

ChaosEngine
Copy link
Owner

Fixes https://github.com/ChaosEngine/Dotnet-Playground/security/code-scanning/327

To fix the problem, we need to ensure that the SQL query is constructed using parameterized queries rather than string interpolation. This involves modifying the PagedSearchPostgresAsync method to use parameters for the sortOrderDirection and sortColumn values.

  1. Modify the SQL query to include placeholders for the sortOrderDirection and sortColumn values.
  2. Add parameters for these placeholders and set their values accordingly.
  3. Ensure that the SQL command uses these parameters when executing the query.

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

… sources

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