
Security News
VulnCon 2025: NVD Scraps Industry Consortium Plan, Raising Questions About Reform
At VulnCon 2025, NIST scrapped its NVD consortium plans, admitted it can't keep up with CVEs, and outlined automation efforts amid a mounting backlog.
flask-sanitize-escape
Advanced tools
Sanitization functions for Flask backend input to prevent XSS, RCE, SQLi and many others
A Flask middleware extension for automatic input sanitization, guarding against common web vulnerabilities like XSS, SQL injection, and other code injection attacks.
pip install flask-sanitize-escape
from flask import Flask
from flask_sanitize_escape import SanitizeEscapeExtension
app = Flask(__name__)
# Initialize the extension with options
sanitize_extension = SanitizeEscapeExtension(
app, sanitize_quotes=True, custom_characters=["$", "#", "%"]
)
sanitize_extension.init_app(app) # Register the middleware
NOTE
It is suggested to use sanitize_quotes=True
@app.route('/submit', methods=['POST'])
def submit_data():
data = g.sanitized_json # accessing JSON from request.get_json()
data = g.sanitized_args # accessing arguments from request.args
data = g.sanitized_form # accessing values from request.form
# Safely process the sanitized data...
Stay tune for upcoming version
We welcome contributions! Feel free to open issues for bugs or feature requests, or submit pull requests with improvements.
This project is licensed under the MIT License - see the LICENSE file for details.
FAQs
Sanitization functions for Flask backend input to prevent XSS, RCE, SQLi and many others
We found that flask-sanitize-escape demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
At VulnCon 2025, NIST scrapped its NVD consortium plans, admitted it can't keep up with CVEs, and outlined automation efforts amid a mounting backlog.
Product
We redesigned our GitHub PR comments to deliver clear, actionable security insights without adding noise to your workflow.
Product
Our redesigned Repositories page adds alert severity, filtering, and tabs for faster triage and clearer insights across all your projects.