4 "warning_type": "SQL Injection",
6 "fingerprint": "011b2643940ba1112f7a737e403abe3616ad91764703c801cc35a48d36b721da",
8 "message": "Possible SQL injection",
9 "file": "app/models/concerns/spree/product_scopes.rb",
11 "link": "https://brakemanscanner.org/docs/warning_types/sql_injection/",
12 "code": "where(\"#{price_table_name}.amount <= ?\", price)",
19 "user_input": "price_table_name",
20 "confidence": "Medium",
24 "note": "interpolating table name"
27 "warning_type": "Redirect",
29 "fingerprint": "05d3870f66d650510c859a8949d5686b05eb028825083b096d0f65fedf80b118",
30 "check_name": "Redirect",
31 "message": "Possible unprotected redirect",
32 "file": "lib/spree/core/controller_helpers/auth.rb",
34 "link": "https://brakemanscanner.org/docs/warning_types/redirect/",
35 "code": "redirect_to((session[\"spree_user_return_to\"] or (request.env[\"HTTP_REFERER\"] or default)))",
39 "class": "Spree::Core::ControllerHelpers::Auth",
40 "method": "redirect_back_or_default"
42 "user_input": "request.env[\"HTTP_REFERER\"]",
50 "warning_type": "SQL Injection",
52 "fingerprint": "1c12fcb833b0ddffa07880acb7e604922c0d1d52de598316186241baf16551cd",
54 "message": "Possible SQL injection",
55 "file": "app/finders/spree/taxons/find.rb",
57 "link": "https://brakemanscanner.org/docs/warning_types/sql_injection/",
58 "code": "taxons.joins(\"INNER JOIN #{Spree::Taxon.table_name} AS parent_taxon ON parent_taxon.id = #{Spree::Taxon.table_name}.parent_id\").join_translation_table(Taxon, \"parent_taxon\").where([\"#{Taxon.translation_table_alias}.permalink = ?\", parent_permalink])",
62 "class": "Spree::Taxons::Find",
63 "method": "by_parent_permalink"
65 "user_input": "Taxon.translation_table_alias",
73 "warning_type": "SQL Injection",
75 "fingerprint": "1f02952550c2f54d044c9577a45e7ba7c7990c8b8a59d1dac83a96790237f507",
77 "message": "Possible SQL injection",
78 "file": "app/models/concerns/spree/product_scopes.rb",
80 "link": "https://brakemanscanner.org/docs/warning_types/sql_injection/",
81 "code": "joins(:properties).join_translation_table(Property).join_translation_table(ProductProperty).where(\"#{ProductProperty.translation_table_alias}.value = ?\", value)",
85 "class": "Spree::ProductScopes",
88 "user_input": "ProductProperty.translation_table_alias",
96 "warning_type": "SQL Injection",
98 "fingerprint": "7928c0813a0bf084ead091b4554ef6abea9ae9c7167936f5c62da9e328b9f736",
100 "message": "Possible SQL injection",
101 "file": "app/models/concerns/spree/product_scopes.rb",
103 "link": "https://brakemanscanner.org/docs/warning_types/sql_injection/",
104 "code": "joins(:properties).join_translation_table(Property).join_translation_table(ProductProperty).where(\"#{ProductProperty.translation_table_alias}.value = ?\", value)",
111 "user_input": "ProductProperty.translation_table_alias",
112 "confidence": "Weak",
119 "warning_type": "SQL Injection",
121 "fingerprint": "857c335935a00f584137f31dbcb1a4532af5c8bb5cf53a86058b4af98c6597dc",
123 "message": "Possible SQL injection",
124 "file": "lib/spree/translation_migrations.rb",
126 "link": "https://brakemanscanner.org/docs/warning_types/sql_injection/",
127 "code": "ActiveRecord::Base.connection.execute(\"\\n UPDATE #{resource_class.table_name}\\n SET #{resource_class.translatable_fields.map do\n \"#{f}=null\"\n end.join(\", \")};\\n \")",
131 "class": "Spree::TranslationMigrations",
132 "method": "transfer_translation_data"
134 "user_input": "resource_class.translatable_fields.map do\n \"#{f}=null\"\n end.join(\", \")",
135 "confidence": "Medium",
142 "warning_type": "SQL Injection",
144 "fingerprint": "965d3919f811ab63b7b8d62da528559a7f38dc122c57efea7136e7ec5ef1f062",
146 "message": "Possible SQL injection",
147 "file": "app/models/concerns/spree/product_scopes.rb",
149 "link": "https://brakemanscanner.org/docs/warning_types/sql_injection/",
150 "code": "where(\"#{price_table_name}.amount >= ?\", price)",
154 "class": "Spree::ProductScopes",
157 "user_input": "price_table_name",
158 "confidence": "Medium",
162 "note": "interpolating table name"
165 "warning_type": "SQL Injection",
167 "fingerprint": "98607ecfb86c2d3c2567390f813861edbc42d6ffa9f482afb7c0b3464eaf6e73",
169 "message": "Possible SQL injection",
170 "file": "app/models/concerns/spree/translatable_resource_scopes.rb",
172 "link": "https://brakemanscanner.org/docs/warning_types/sql_injection/",
173 "code": "joins(\"LEFT OUTER JOIN #{translatable_class::Translation.table_name} #{translatable_class.translation_table_alias}\\n ON #{translatable_class.translation_table_alias}.#{\"#{translatable_class.table_name.singularize}_id\"} = #{(translatable_class.table_name or join_on_table_alias)}.id\\n AND #{translatable_class.translation_table_alias}.locale = '#{Mobility.locale}'\")",
177 "class": "Spree::TranslatableResourceScopes",
178 "method": "join_translation_table"
180 "user_input": "translatable_class.translation_table_alias",
181 "confidence": "Medium",
188 "warning_type": "SQL Injection",
190 "fingerprint": "abd8e90e7a7dfbcdcd6d44fd3fb550598aee6d7a9ef2bb132ad1a18a3c50be30",
192 "message": "Possible SQL injection",
193 "file": "app/models/concerns/spree/product_scopes.rb",
195 "link": "https://brakemanscanner.org/docs/warning_types/sql_injection/",
196 "code": "where(\"#{price_table_name}.amount <= ?\", price)",
200 "class": "Spree::ProductScopes",
203 "user_input": "price_table_name",
204 "confidence": "Medium",
208 "note": "interpolating table name"
211 "warning_type": "SQL Injection",
213 "fingerprint": "c1c97347a2d74ea41d46519e3bfbd94c511a1bd9c285f3f2a1fa0cb7e624d232",
215 "message": "Possible SQL injection",
216 "file": "lib/spree/translation_migrations.rb",
218 "link": "https://brakemanscanner.org/docs/warning_types/sql_injection/",
219 "code": "ActiveRecord::Base.connection.execute(\"\\n UPDATE #{resource_class.table_name}\\n SET (#{resource_class.translatable_fields.join(\", \")}) = #{(\"ROW\" or \"\")}(#{resource_class.translatable_fields.map do\n \"#{resource_class::Translation.table_name}.#{f}\"\n end.join(\", \")})\\n FROM #{resource_class::Translation.table_name}\\n WHERE #{resource_class::Translation.table_name}.#{\"#{resource_class.table_name.singularize}_id\"} = #{resource_class.table_name}.id\\n \")",
223 "class": "Spree::TranslationMigrations",
224 "method": "revert_translation_data_transfer"
226 "user_input": "resource_class.translatable_fields.join(\", \")",
227 "confidence": "Medium",
234 "warning_type": "SQL Injection",
236 "fingerprint": "c2bc48d98076b7c4fc3314c6a85f7bd1132efe5fcc346da4d28df7c25f93633f",
238 "message": "Possible SQL injection",
239 "file": "app/models/spree/variant.rb",
241 "link": "https://brakemanscanner.org/docs/warning_types/sql_injection/",
242 "code": "joins(:product).join_translation_table(Product).where(\"LOWER(#{Product.translation_table_alias}.name) LIKE LOWER(:query)\\n OR LOWER(sku) LIKE LOWER(:query)\", :query => (\"%#{query}%\"))",
246 "class": "Spree::Variant",
247 "method": "Spree::Variant.product_name_or_sku_cont"
249 "user_input": "Product.translation_table_alias",
250 "confidence": "Weak",
257 "warning_type": "SQL Injection",
259 "fingerprint": "ed253ae6b1b4ea3fe3d87d3652380fecab80133319b1ed041d98d163fd16b815",
261 "message": "Possible SQL injection",
262 "file": "app/finders/spree/taxons/find.rb",
264 "link": "https://brakemanscanner.org/docs/warning_types/sql_injection/",
265 "code": "taxons.joins(:parent).join_translation_table(Taxon, \"parents_spree_taxons\").where([\"#{Taxon.translation_table_alias}.permalink = ?\", parent_permalink])",
269 "class": "Spree::Taxons::Find",
270 "method": "by_parent_permalink"
272 "user_input": "Taxon.translation_table_alias",
273 "confidence": "Weak",
280 "warning_type": "SQL Injection",
282 "fingerprint": "efcc57e1a5648d7db59d1beaf5e399d2278539a8667b19c520b305a6ca7e15e8",
284 "message": "Possible SQL injection",
285 "file": "app/models/concerns/spree/product_scopes.rb",
287 "link": "https://brakemanscanner.org/docs/warning_types/sql_injection/",
288 "code": "where(\"#{price_table_name}.amount >= ?\", price)",
295 "user_input": "price_table_name",
296 "confidence": "Medium",
300 "note": "interpolating table name"
303 "warning_type": "SQL Injection",
305 "fingerprint": "f14dd62fac0dd1e9d5532dd5efc770e2eb873a8db80faf366b6295378634754a",
307 "message": "Possible SQL injection",
308 "file": "lib/spree/translation_migrations.rb",
310 "link": "https://brakemanscanner.org/docs/warning_types/sql_injection/",
311 "code": "ActiveRecord::Base.connection.execute(\"\\n INSERT INTO #{resource_class::Translation.table_name} (#{resource_class.translatable_fields.join(\", \")}, #{\"#{resource_class.table_name.singularize}_id\"}, locale, created_at, updated_at)\\n SELECT #{resource_class.translatable_fields.join(\", \")}, id, '#{default_locale}' as locale, created_at, updated_at FROM #{resource_class.table_name};\\n \")",
315 "class": "Spree::TranslationMigrations",
316 "method": "transfer_translation_data"
318 "user_input": "resource_class.translatable_fields.join(\", \")",
319 "confidence": "Medium",
326 "updated": "2023-03-22 20:11:32 +0100",
327 "brakeman_version": "5.4.1"