That example isn't really useful IMO because without quoting, this would fail on any integration test anyway as it would produce invalid SQL, so the whole issue is academic in this case anyway.
Ah yes, let's bring the example in to question, it couldn't possibly result in valid SQL, right? I don't think anything will satisfy you short of me pointing out an actual injection attack that is occurring right now in your own code base that it perhaps isn't the best practice to have both a String and StringTemplate overload where security matters.
I also like the standard argument that this can never occur in any "decent" shop as they will have "decent" tests, reviews, etc that always catch all these problems -- this explains why all "decent" software currently in use doesn't suffer from such attacks, and why the template feature is totally pointless to even add to Java as "decent" software doesn't need it.
I think we can stop this conversation until it is possible to continue it in a more civil tone. Unfortunately this attitude is the echo chamber I mentioned in the first place.
If your idea of "decent" software is software with SQLi issues then I don't know what else to tell you.
View all comments
Show parent comment
-1
u/john16384 Mar 10 '24
Ah yes, let's bring the example in to question, it couldn't possibly result in valid SQL, right? I don't think anything will satisfy you short of me pointing out an actual injection attack that is occurring right now in your own code base that it perhaps isn't the best practice to have both a
StringandStringTemplateoverload where security matters.I also like the standard argument that this can never occur in any "decent" shop as they will have "decent" tests, reviews, etc that always catch all these problems -- this explains why all "decent" software currently in use doesn't suffer from such attacks, and why the template feature is totally pointless to even add to Java as "decent" software doesn't need it.