labml
labml copied to clipboard
False positive(?)
I'm getting a number of, what I think are, false positives like such as:
Brakeman error:
High | SystemsController | index | SQL Injection | Possible SQL injection near line 12: System.order("#{(+System::SORTS[params[:sort]]+ or "created_at DESC")}")
Line from code:
System.order("#{System::SORTS[params[:sort]] || 'created_at DESC'}")
Because this is being passed into an order and the param itself is only being used to find a particular value from a predetermined Hash I don't believe this could actually be subject to SQL injection. But do correct me if I'm wrong.
Hi Tony,
You are correct. Unfortunately, unless this code is inside the same class where System::SORTS is defined, I can't think of a way to prevent this warning at the moment.
@presidentbeef ok I see. Thanks for confirming anyway.