简体   繁体   中英

Django request.POST.get SQL injection

I'm currently getting POST data using the method request.POST.get(). I'd like to know if this method gives me raw POST data or if it's correctly escaping and protected against SQL injection.

Thank you in advance for your help.

Galaf

If you're feeding the result of request.POST right into a SQL query (ie, without using the Django ORM), you will most definitely be vulnerable to SQL injection.

But, if you are using the Django ORM (or another well-written ORM, such as SQLAlchemy), all of your input data will be sanitized.

tldr; you're safe

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM