Recently when I was looking through some code which looks more or less like this:
$query = "call someProcedure(?,?,{$unsafeString})";
Then there is some code where the list of arguments is prepared and after that, there is generated prepared statement from string query
Given that unsafeString
is coming from user, it is not being validated or escaped and it is interpolated in query string. I was wondering, can this be a serious threat and how it can be exploited?
I tried to add second statement at the end, but seems like prepared statements allow me to execute only first query and I also tried to use select statement to get some values from dB, but seems like some stored procedure does not allow to do that.
So I was wondering, can I state that this is safe? or there is some possibilities to exploit it?