Issue
I am trying to find out what ${data} means in this query and is this query vulnerable to SQL injection?
SELECT * FROM test WHERE ${data};
Solution
${data} is not part of the SQL language.
It looks like string interpolation, which is almost certainly vulnerable to sql injection.
I say "almost" because some ORM tools will use interpolation hooks to do correct query parameterization... but even these would tend to look at individual values, and not the entire WHERE clause. It's also possible the where clause provided for interpolation includes valid placeholders for parameterized queries, and there is additional code we don't see to handle this correctly. But it doesn't seem very likely.
Answered By - Joel Coehoorn Answer Checked By - Terry (sql.easybugfix Volunteer)
Post a Comment
Post a Comment