Ballerina compiler has a "Taint Analyzer" built-in, which supports Ballerina to become a security-aware programming language. The taint analyzer will help in preventing numerous security vulnerabilities including SQLi, path manipulations and XXS. You can go through the "How to Write Secure Ballerina Programs" page to read more about this.
However, the way you are performing the SQL query is absolutely correct and there is no security problem with that. Looking at the error message, it seems line 56 should be a location where you call caller->respond( resp )
action to return a HTTP response.
Why I am suggesting this is because caller->respond( resp )
is the location where we set some value to message
parameter of the respond
action.
If this is the case, please check if the response content you are trying to send is a fully validated value. Taint analyzer has detected that the response you are about to send contains untrusted (tainted) data, leading to XSS or other security vulnerabilities. You can check the "Taint Analysis — Examples" section of this blog post to understand how this error could occur and how to properly validate data and mitigate from this error.
Furthermore, if you can share the full Ballerina code, I can update the answer with further details on how to address the exact issue.