CVE-2009-2940 json
PyGreSQL Might Be Vulnerable to Encoding-Based SQL Injection
published 2009-10-22 17 y ago modified 2026-06-16 4 mo ago also GHSA-xv6x-43gq-4hfj , PYSEC-2009-18 , EUVD-2022-5860
- cvss
- 7.5
- version 2.0, NVD
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 2.7%
- EPSS 2.7% chance of exploitation in 30 days, percentile 86%
- public exploits
- 0
- none known
Summary
The pygresql module 3.8.1 and 4.0 for Python does not properly support the PQescapeStringConn function, which might allow remote attackers to leverage escaping issues involving multibyte character encodings.
Patch / fix
- pypi pygresql 4.1
- pygresql Debian 14, Debian 13, Debian 12 1:4.0-1
debian advisories DEBIAN-CVE-2009-2940
Vendor advisories
What the vendors themselves say about their products: affected, fixed or not affected, and what to do.
red hat product security vex CVE-2009-2940 updated cvss 5.4
PyGreSQL: Missing a function to call PQescapeStringConn()
-
Red Hat Enterprise Linux 6 PyGreSQLaffected: no fix planned “Will not fix”
-
Red Hat Enterprise Linux 7 PyGreSQLnot affected: vulnerable code not present
Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf
Exploit prediction
2.70% chance of exploitation in the next 30 days, higher than 86% of all scored CVEs (FIRST EPSS, 2026-11-08).
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| NVD | 2.0 | 7.5 | AV:N/AC:L/Au:N/C:P/I:P/A:P |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| pypi | pygresql | <=3.8.1 >=4.0, <4.1 >=3.8.1, <=4.0 |
4.1 |
Classification
- Weakness
-
- CWE-89 Improper Neutralization of Special Elements used in an SQL Command
References
-
github.com
/PyGreSQL/PyGreSQL/commit/8e19320b130946eed6f043297e3e4e005a523612
web
-
github.com
/PyGreSQL/PyGreSQL/commit/f7237d773e6f4d5a7da3d99bb6bc5062bd07935e
web
-
debian.org
/security/2009/dsa-1911
vendor-advisory, web, advisory
-
ubuntu.com
/usn/usn-870-1
vendor-advisory, web
-
secunia.com
/advisories/37046
third-party-advisory, vendor-advisory, advisory
-
osvdb.org
/59028
vdb-entry, web
-
secunia.com
/advisories/37654
third-party-advisory, advisory
-
nvd.nist.gov
/vuln/detail/CVE-2009-2940
advisory
-
github.com
/PyGreSQL/PyGreSQL
package
-
github.com
/pypa/advisory-database/tree/main/vulns/pygresql/PYSEC-2009-18.yaml
web
-
github.com
/advisories/GHSA-xv6x-43gq-4hfj
advisory
Sources
- CVE List CVE-2009-2940
- GitHub Advisory GHSA-xv6x-43gq-4hfj
- NVD CVE-2009-2940
- OSV PYSEC-2009-18
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.