Python Flask XSS - Escape Characters - SQL injection - Cross-Site Scripting - OWASP - Web Security

preview_player
Показать описание
This is a quick video, that cuts right to the point for escaping and protection Flask and other Python web frameworks from the perils of XSS/SQLi or SQL injection/XSRF/etc. Simply include the following in your Flask project.. import flask with escape and apply format and escape to your input(s) ex. username below:
from flask import Flask, request, escape
Рекомендации по теме
Комментарии
Автор


Want another free pro-anti-1337-hax tip? Sure.. just cd into your directory with all your Python files relevant to your Flask or other web-based app. And run these simple commands:
grep -in *py

While this is not completely exhaustive, this should make spotting input areas simpler. Just find how your inputs are declared, and make sure the variables are securely handled. You may point the above grep into various directories to be more exhaustive. The reason to not just apply the recursive flag is because you will end up with a bunch of in-built Python scripts spitting across your terminal. Good luck - stay well

Last edit: if your grep results look something like this:
username = request.args.get('username')
You might want to change that to this:
username =

Because the format(escape( ... is what is going to "make safer" the input, well from common XSS attacks.

noirth-security
welcome to shbcf.ru