Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.