Cloudanix VulnDB

CVE-2024-9774

Medium · 6.5

CVSS

6.5

EPSS

0.7%

Published

Dec 27, 2024

CISA due date

—

Cloudanix analysis

Monitor only SSVC: Track

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

  1. Locate application code paths that pass user-controlled values to unary operators in python-sql
  2. Craft payload using unary operator syntax plus injected SQL clauses
  3. Submit payload through normal application interfaces
  4. 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