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. 11: Database query built from user-controlled sources #586

Closed
wants to merge 1 commit into from

Conversation

adubovikov
Copy link
Member

Fixes https://github.com/sipcapture/homer-app/security/code-scanning/11

To fix the problem, we should ensure that user-provided data is safely embedded into the SQL query using parameterized queries or prepared statements. In this case, we can rely on GORM's parameterized query capabilities to handle the user input safely.

  • Modify the Update method in data/service/userSettings.go to use GORM's parameterized queries.
  • Ensure that the sqlWhere map is constructed in a way that GORM can safely handle the parameters.

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

…lled sources

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