O
O
ortsuev332019-11-23 12:25:20
Laravel
ortsuev33, 2019-11-23 12:25:20

Are there vulnerabilities if I don't process the string?

I have an alias url parameter, before there was an id , I processed it stupidly leading to a number , but what about the string , I know that there are prepared queries through the query builder and you shouldn’t worry about sql injections. Do I still need to take or process a parameter somehow?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vitaliy Orlov, 2019-11-23
@ortsuev33

With prepared parameters, it's not worth it. Just don't use a parameter in a Raw Expression that won't be processed further. Those. this is not how you should do it

$users = DB::table('users')
                     ->select( DB::raw($_GET['select_only_columns']) )
                     ->where('status', '<>', 1)
                     ->groupBy('status')
                     ->get();

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question