Is SQL injection possible with POST?

Sql Injection is possible if parameters are passed via GET. But is this also possible through POST. If so, can https prevent this?

+3
source share
6 answers

Yes, possibly with $_POST, as well as with $_GET, $_COOKIEand $_REQUEST. HTTPS will not protect you at all. You should use some function to protect you, for example mysql_real_escape_string or use prepared statements .

All messages from a web browser should be treated as "untrustworthy . " Other methods you cannot trust are Ajax, file uploadsand JavaScript form validations(among others). All of this data comes directly from a web browser and should not be trusted before you filter it or verify the data.

The only thing you can trust is $_SESSIONif you only included validated data in your variables $_SESSION.

+19
source
  • Yes, you can enter SQL through POST. Anyone can change what sends POST requests (find the addon for firefox called "hackbar"
  • https , -. .
+7

.

+4

, .

SQL- , SQL-, . , GET POST, . , , .

+2

, , - . , , , - - SQL-, , , .

, PHP , - Codesense mysqli wrapper. , , , , , .

SQL , SQL, .

+2
source

https cannot protect you here. Filter input (s)

0
source

Source: https://habr.com/ru/post/1728933/


All Articles