Is MySQL more resistant to SQL injection attack than PostgreSQL (under Perl/DBI)?

前端 未结 4 528
误落风尘
误落风尘 2021-01-06 08:12

I am reviewing a Linux based perl web application that contains a login handler with the ubiquitous

my $sth = $DB->prepare(\"SELECT password from passwords where use

4条回答
  •  走了就别回头了
    2021-01-06 08:52

    Guarding against injection attacks is not the responsibility of the database, it's the responsibility of the developer. If the developer writes code that creates queries by concatenating strings derived from user input the resulting queries will be vulnerable to injection attacks, and all the code spent on sanitization, etc, is IMHO a waste of time. If the code is written to use parameterized queries, and user input is relegated to being used as parameter values, the resulting queries will be reasonably safe from injection attacks. (And I'd be interested in hearing how it might be possible to do an injection attack through a parameter value).

    Share and enjoy.

提交回复
热议问题