Refactor #23300
closedDo not use string interpolation when composing SQL queries.
Description
Using string interpolation when composing SQL queries is just one step away from creating a security issue. It's against the Rails best practices to do so. Doing so actually results into Brakeman complaining loudly.
Task: replace string interpolation with use of parameterization of queries and/or AREL.
Updated by Marek Hulán over 6 years ago
- Status changed from New to Need more information
Could you share the list of such places? Or is that based on brakeman scan only? Was it just Foreman core or also some plugins that you've scanned?
Updated by Anonymous over 6 years ago
Brakeman is there: http://ci.theforeman.org/job/test_brakeman (although that's going to be deleted soon). The Rails 5.2 warnings can be seen in the new deprecations in https://github.com/theforeman/foreman/pull/5428
Updated by Martin Povolny over 6 years ago
I started with Brakeman scan and `grep` and with Foreman only and did not spend much time on this yet.
I think that basic checking should be done on regular basis possibly as part of the CI and also for plugins. Brakeman can be used and/or services such as Hakiri (https://hakiri.io/).
I don't have a list of issues. Initial one can be obtained by running Brakeman.
In my opinion as a starting point all issues reported by Brakeman should be fixed or marked as false positives in the Brakeman config file (to be included with Foreman).
Updated by Anonymous over 6 years ago
- Related to Tracker #21834: Rails 5.2 upgrade tasks added
Updated by Anonymous over 6 years ago
- Related to Refactor #23234: remove friendly_id <5.0 workarounds added
Updated by Anonymous over 6 years ago
- Pull request https://github.com/theforeman/foreman/pull/5367 added
Updated by Anonymous over 6 years ago
- Blocks Tracker #24837: Rails 6.0 Tracker added
Updated by Anonymous almost 6 years ago
- Status changed from Need more information to New
- Pull request deleted (
https://github.com/theforeman/foreman/pull/5367)
Updated by Anonymous over 5 years ago
- Related to Bug #26414: Api error when querying LDAP users added
Updated by Anonymous almost 5 years ago
- Related to deleted (Bug #26414: Api error when querying LDAP users )
Updated by Anonymous almost 5 years ago
- Blocks deleted (Tracker #24837: Rails 6.0 Tracker)
Updated by Anonymous almost 5 years ago
- Blocks Tracker #28570: Rails 6.1 Tracker added
Updated by Anonymous almost 5 years ago
- Related to Tracker #24837: Rails 6.0 Tracker added
Updated by Anonymous over 4 years ago
- Related to Refactor #29520: Wrap sql in Arel.sql() where needed added
Updated by The Foreman Bot about 3 years ago
- Status changed from New to Ready For Testing
- Pull request https://github.com/theforeman/foreman/pull/8979 added
Updated by Leos Stejskal almost 3 years ago
- Status changed from Ready For Testing to Closed
Applied in changeset foreman|09c865a37172d422564afbf7c8d6467e882e3ad5.