chinwagsocial/config
Claire 5e9118c9bb Fix error-prone SQL queries (#15828)
* Fix error-prone SQL queries in Account search

While this code seems to not present an actual vulnerability, one could
easily be introduced by mistake due to how the query is built.

This PR parameterises the `to_tsquery` input to make the query more robust.

* Harden code for Status#tagged_with_all and Status#tagged_with_none

Those two scopes aren't used in a way that could be vulnerable to an SQL
injection, but keeping them unchanged might be a hazard.

* Remove unneeded spaces surrounding tsquery term

* Please CodeClimate

* Move advanced_search_for SQL template to its own function

This avoids one level of indentation while making clearer that the SQL template
isn't build from all the dynamic parameters of advanced_search_for.

* Add tests covering tagged_with, tagged_with_all and tagged_with_none

* Rewrite tagged_with_none to avoid multiple joins and make it more robust

* Remove obsolete brakeman warnings

* Revert "Remove unneeded spaces surrounding tsquery term"

The two queries are not strictly equivalent.

This reverts commit 86f16c537e06c6ba4a8b250f25dcce9f049023ff.
2022-02-02 14:21:12 +01:00
..
environments add ssl option in smtp setting (#14309) 2020-07-15 14:43:49 +02:00
initializers Fix reviving revoked sessions and invalidating login (#16943) 2022-01-28 22:53:15 +01:00
locales Normalize locale files (#15434) 2020-12-27 05:30:56 +01:00
webpack Add subresource integrity for JS and CSS assets (#15096) 2020-11-06 11:56:31 +01:00
application.rb Fix media processing getting stuck on too much stdin/stderr (#16136) 2022-01-28 22:39:48 +01:00
boot.rb Add clean error message when RAILS_ENV is unset (#15381) 2020-12-20 18:05:03 +01:00
brakeman.ignore Fix error-prone SQL queries (#15828) 2022-02-02 14:21:12 +01:00
database.yml
deploy.rb Bump capistrano from 3.14.0 to 3.14.1 (#14037) 2020-06-17 06:31:30 +02:00
environment.rb Make PreviewCard records reuseable between statuses (#4642) 2017-09-01 16:20:16 +02:00
i18n-tasks.yml Change move handler to carry blocks over (#14144) 2020-07-01 13:51:15 +02:00
navigation.rb Add IP-based rules (#14963) 2020-10-12 16:33:49 +02:00
pghero.yml Fix PgHero Content-Security-Policy when CDN_HOST is used (#13595) 2020-05-04 13:52:41 +02:00
puma.rb
routes.rb Add import/export feature for bookmarks (#14956) 2020-11-19 17:48:13 +01:00
secrets.yml
settings.yml Add ability to require invite request text (#15326) 2020-12-14 10:03:09 +01:00
sidekiq.yml Fix to isolate the sidekiq process that runs the scheduler job (#15314) 2020-12-15 03:04:03 +01:00
themes.yml
webpacker.yml