CVE-2024-9774
Medium · 6.5CVSS
6.5
EPSS
0.7%
Published
Dec 27, 2024
CISA due date
—
Cloudanix analysis
A bug in a database helper library can let someone with elevated access run unauthorized commands against the database.
- Exploitation
- Remote Authenticated
- Attacker needs
- High Privilege
- Complexity
- Low
- Impact
- Data Tampering
- Component
- Library
- Class
- SQL Injection
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
Unary operators in python-sql fail to escape non-Expression objects, permitting injection of arbitrary SQL syntax into generated queries.
Why it matters to the business
Attackers can read or modify sensitive database contents, resulting in data breaches, integrity loss, and compliance violations with moderate urgency given low EPSS and absence from KEV.
How an attack unfolds
An authenticated attacker supplies malicious input containing unary operators combined with SQL fragments; the library omits escaping for non-Expression values, allowing the fragments to alter the executed query structure.
How to fix it
Upgrade python-sql to a patched release that ensures escaping for all operands in unary operators; adopt parameterized queries and strict input validation as defense-in-depth.
How to confirm the fix worked
Inspect source for unary operator usage, replay test cases with non-Expression inputs, and confirm that injected fragments no longer appear in generated SQL.
Typical attack path
- Locate application code paths that pass user-controlled values to unary operators in python-sql
- Craft payload using unary operator syntax plus injected SQL clauses
- Submit payload through normal application interfaces
- Observe or leverage results of the modified database query
How to detect it
Review application and database logs for unexpected SQL syntax or clauses that match patterns typical of unary operator misuse; correlate with application input sources.
What your security team should do
- Audit all direct and transitive uses of python-sql across the environment
- Apply library updates and retest query generation paths
- Enable detailed database query logging to detect anomalous statements
The record
A vulnerability was found in python-sql where unary operators do not escape non-Expression.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| PyPI | python-sql | 0 | 1.5.2 |
| Debian:11 | python-sql | 0 | 1.2.1-1+deb11u1 |
| Debian:12 | python-sql | 0 | 1.4.0-1+deb12u1 |
| Debian:13 | python-sql | 0 | 1.5.2-1 |
| SUSE:Package Hub 15 SP5 | python-python-sql | 0 | 1.5.1-bp155.3.6.1 |
| SUSE:Package Hub 15 SP6 | python-python-sql | 0 | 1.5.1-bp156.2.6.1 |
| Ubuntu:16.04:LTS | python-sql | 0 | No fix |
| Ubuntu:18.04:LTS | python-sql | 0 | No fix |
| Ubuntu:20.04:LTS | python-sql | 0 | No fix |
| Ubuntu:22.04:LTS | python-sql | 0 | No fix |
| Ubuntu:24.04:LTS | python-sql | 0 | No fix |
| Ubuntu:24.10 | python-sql | 0 | No fix |
| Ubuntu:Pro:16.04:LTS | python-sql | 0 | No fix |
| Ubuntu:Pro:18.04:LTS | python-sql | 0 | No fix |
| Ubuntu:Pro:20.04:LTS | python-sql | 0 | No fix |
| openSUSE:Leap 15.5 | python-python-sql | 0 | 1.5.1-bp155.3.6.1 |
| openSUSE:Leap 15.6 | python-python-sql | 0 | 1.5.1-bp156.2.6.1 |
Related vulnerabilities
- CVE-2026-55467 OpenPrinting CUPS is an open source printing system for Linux and other Unix-like… CWE-150
- CVE-2026-82710 Improper Neutralization of Escape, Meta, or Control Sequences vulnerability in… CWE-150
- CVE-2026-19591 OpenAI Codex CLI for Windows, macOS, and Linux and Codex Desktop for Windows and macOS… CWE-150
- CVE-2026-73506 Oh My Posh is the most customisable and low-latency cross platform/shell prompt renderer. CWE-150
- CVE-2026-73414 Shescape is a simple shell escape library for JavaScript. CWE-150
- CVE-2026-72913 Kitty is a cross-platform GPU based terminal. CWE-150
- CVE-2026-64654 GitHub CLI (gh) is GitHub's official command line tool. CWE-150
- CVE-2026-49147 App::Ack versions through 3.10.0 for Perl print unsanitised terminal escape sequences… CWE-150