SQLAlchemy SQL Injection Vulnerabilities

sqlalchemy Updated 02 Oct 2025

Summary

06/11/2021
N/A
Yes i
Unrated
Not published

DLA-2811-1: sqlalchemy - security update. Affects sqlalchemy versions < 1.0.15+ds1-1+deb9u1. Fixed in 1.0.15+ds1-1+deb9u1. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

Background

SQLAlchemy is a SQL toolkit and Object Relational Mapper (ORM) for Python. It provides a set of high-level API for interacting with databases, allowing developers to write SQL queries in a more Pythonic way. SQLAlchemy is widely used in various Python applications and frameworks. However, two SQL injection vulnerabilities have been discovered in SQLAlchemy, specifically when the 'order_by' or 'group_by' parameters can be controlled by an attacker.

Vulnerability Detail

The SQL injection vulnerabilities in SQLAlchemy arise when user-controlled input is not properly sanitized or validated before being used in the 'order_by' or 'group_by' clauses. An attacker can exploit these vulnerabilities by injecting malicious SQL code, which can lead to unauthorized access, data manipulation, or even remote code execution on the database server. These vulnerabilities can have severe consequences, including data breaches, data loss, and compromise of the entire application or system.

How To Fix

Minimum fixed version

1.0.15+ds1-1+deb9u1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade sqlalchemy

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

There is no specific workaround mentioned for these vulnerabilities. However, it is essential to follow secure coding practices and implement proper input validation and sanitization to mitigate the risk of SQL injection attacks.

Conclusion

SQLAlchemy is affected by two SQL injection vulnerabilities that can be exploited by attackers to execute malicious SQL code. To mitigate these vulnerabilities, it is recommended to upgrade to the fixed version of SQLAlchemy and ensure proper input validation and sanitization. For further support on vulnerability remediation, you can contact DevNack.com.

See every vulnerability recorded for sqlalchemy →

Share this vulnerability

FAQ

SQLAlchemy is a SQL toolkit and Object Relational Mapper (ORM) for Python. It provides a set of high-level API for interacting with databases, allowing developers to write SQL queries in a more Pythonic way.

SQL injection vulnerabilities occur when user-controlled input is not properly sanitized or validated before being used in SQL queries. Attackers can exploit these vulnerabilities by injecting malicious SQL code, leading to unauthorized access, data manipulation, or even remote code execution on the database server.

To fix these vulnerabilities, it is recommended to upgrade to the fixed version of SQLAlchemy. For Debian 9 stretch, the fixed version is 1.0.15+ds1-1+deb9u1. Additionally, ensure that all user-controlled input is properly sanitized and validated before being used in SQL queries.

The SQL injection vulnerabilities in SQLAlchemy can have severe consequences, including data breaches, data loss, and compromise of the entire application or system. Attackers can gain unauthorized access to sensitive data, manipulate data, or execute arbitrary code on the database server.

Specific known exploits for these vulnerabilities have not been mentioned in the provided information. However, it is crucial to address these vulnerabilities promptly to prevent potential exploitation.

Related vulnerabilities

Recent vulnerabilities recorded for sqlalchemy.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

How To Fix

Minimum fixed version

1.0.15+ds1-1+deb9u1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade sqlalchemy

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback