
SKataria185401 (Community Member) asked a question.
Hi,
We are getting below flow in our application-
CWE ID: 89 Exploitability: Neutral Category: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
Our implementation is
We have huge SQL query with IN clause, like- select * from table where column IN '$values$'
values we get dynamically and we replace in above query on $values$ place.
We can not use prepared statement as jdbc driver doesn't support prepared statement with IN clause.
We tried many approaches but unable to fix the issue.
Can someone please guide on how to fix CWE 89 when dynamically using values on IN clause ?
Thanks
.png)
The CWE ID: 89 vulnerability, also known as SQL injection, can allow an attacker to manipulate an SQL query and gain unauthorized access to data. It is important to address this vulnerability in your application. Here are some steps to fix this issue:
Overall, the key is to avoid using concatenated strings to construct queries, and instead use parameterized queries, stored procedures or a safe library/framework.