Skip to content

Fix code scanning alert no. 3: Database query built from user-controlled sources#584

Merged
adubovikov merged 1 commit intomasterfrom
alert-autofix-3
Jan 7, 2025
Merged

Fix code scanning alert no. 3: Database query built from user-controlled sources#584
adubovikov merged 1 commit intomasterfrom
alert-autofix-3

Conversation

@adubovikov
Copy link
Member

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

To fix the problem, we need to use parameterized queries instead of string concatenation to safely embed user input into the SQL query. This can be achieved by using the gorm library's query parameterization features.

  • Replace the string concatenation in the GetTransactionData function with parameterized queries.
  • Modify the GetTransactionData function to accept additional parameters for the whitelist values and use them in the query safely.

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

…led sources

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@adubovikov adubovikov marked this pull request as ready for review January 7, 2025 11:19
@adubovikov adubovikov merged commit 63f628d into master Jan 7, 2025
5 checks passed
@adubovikov adubovikov deleted the alert-autofix-3 branch January 7, 2025 11:20
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

Comments