79515649

Date: 2025-03-17 20:10:13
Score: 1
Natty:
Report link

These elements (columns) cannot be bound into JDBC which is why this mechanism will not support them as parameterized. There are two options to do this safely - ideally you should use both:

The second is important because characters can sometimes be used to end a column and add a SQL injection. I believe the current characters are safe but you want to future proof this against someone adding to the list.

Within your function is would be better (as @juliane mentions) to return the value in your validation function. That will allow you to mark the return value as "sanitized" for SQL injection purposes in many code checking tools. Snyk seems to allow you do this with custom santizers but I couldn't track down a lot of documentation on how to do this. The benifit here is that everywhere you use this validation function would then be automatically recognized by Snyk.

Reasons:
  • Long answer (-1):
  • No code block (0.5):
  • User mentioned (1): @juliane
  • Low reputation (0.5):
Posted by: Egret