Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
This package allows you to use mysql-connector-pythons pooling feature from flask
import mysql.connector
from flask import Flask, abort, jsonify
from flask_mysqlpool import MySQLPool
app = Flask(__name__)
app.config['MYSQL_HOST'] = 'localhost'
app.config['MYSQL_PORT'] = 3306
app.config['MYSQL_USER'] = 'test'
app.config['MYSQL_PASS'] = 'test'
app.config['MYSQL_DB'] = 'world_x'
app.config['MYSQL_POOL_NAME'] = 'mysql_pool'
app.config['MYSQL_POOL_SIZE'] = 5
app.config['MYSQL_AUTOCOMMIT'] = True
db = MySQLPool(app)
@app.route('/')
def index():
try:
conn = db.connection.get_connection() # get connection from pool
cursor = conn.cursor(dictionary=True)
cursor.execute("select * from world_x.city limit 10", )
result = cursor.fetchall()
conn.close() # return connection to pool
return jsonify(result)
except mysql.connector.ProgrammingError as err:
print(err)
abort(500)
FAQs
Wrapper for mysql.connector.python to get a pool of mysql connections
We found that flask-mysqlpool 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
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.