-
-
Notifications
You must be signed in to change notification settings - Fork 616
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Flag str.replace as possible sql injection (#1044)
* Flag str.replace as possible sql injection This extends the existing implementation for detecting possible cases of SQL injection to account for `str.replace` used in the string construction. Use of `str.replace` can lead to SQL injection in much the same way as `str.format` can, and that is already considered in the pre-existing implementation, along with other common string constructions. Resolves #878 * Revert cosmetic change * Fix lint * Reduce str.replace to LOW confidence in all cases Since the rate of false positives may be higher for str.replace over other string constructions like str.format, we should reduce to LOW confidence to compensate for this. * Update bandit/plugins/injection_sql.py Correct version in versionchanged directive Co-authored-by: Eric Brown <ericwb@users.noreply.github.com> * Fix typo in comment --------- Co-authored-by: Ian Stapleton Cordasco <graffatcolmingov@gmail.com> Co-authored-by: Eric Brown <ericwb@users.noreply.github.com>
- Loading branch information
1 parent
5ec806d
commit fe9ca8b
Showing
3 changed files
with
27 additions
and
11 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
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