Permalink
Show file tree
Hide file tree
25 changes: 21 additions & 4 deletions
25
app/parameters/sipity/parameters/search_criteria_for_works_parameter.rb
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Adding protection against SQL injection
Prior to this commit, the SearchCriteriaForWorksParameter class was to optimistic in the additional_attributes it received. This was "okay" in that these attributes were passed from within the application (and not from user input). However, I wanted to tighten that up further which is why I added the changes to fetch the attributes from a map. And even with all of this, [brakeman][1] identified this as a weak chance for SQL injection. So I also added a config/brakeman.yml file to skip over this file. (alas I can't skip over a singular violation) [1]:https://rubygems.org/gems/brakeman
- Loading branch information
Jeremy Friesen
committed
Aug 12, 2021
1 parent
641b1d5
commit d1704c7
Showing
2 changed files
with
26 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| # We're hand building a SQL line, for which we've taken precautions to | ||
| # avoid SQL injection. | ||
| :skip_files: | ||
| - app/parameters/sipity/parameters/search_criteria_for_works_parameter.rb |