{"dataType": "CVE_RECORD", "containers": {"adp": [{"metrics": [{"cvssV3_0": {"scope": "CHANGED", "version": "3.0", "baseScore": 5.4, "attackVector": "NETWORK", "baseSeverity": "MEDIUM", "vectorString": "CVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:C/C:L/I:L/A:N", "integrityImpact": "LOW", "userInteraction": "NONE", "attackComplexity": "HIGH", "availabilityImpact": "NONE", "privilegesRequired": "NONE", "confidentialityImpact": "LOW"}}, {"other": {"type": "Unknown", "content": {"data": "{\"description\":\"Moderate\"}"}}}], "affected": [{"vendor": "redhat", "product": "PyGreSQL", "platforms": ["cpe:/o:redhat:enterprise_linux:6"], "defaultStatus": "affected"}], "references": [{"url": "https://access.redhat.com/security/cve/CVE-2009-2940"}], "descriptions": [{"lang": "en", "value": "The CVE program describes this issue as: 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. \n            Red Hat Enterprise Linux 6 is now in Production 3 Phase of the support and maintenance life cycle. This has been rated as having Moderate security impact and is not currently planned to be addressed in future updates. For additional information, refer to the Red Hat Enterprise Linux Life Cycle: https://access.redhat.com/support/policy/updates/errata/.\n\nThis issue did not affect the versions of PyGreSQL as shipped with Red Hat Enterprise Linux 7."}], "providerMetadata": {"orgId": "53f830b8-0a3f-465b-8143-3b8a9948e749", "shortName": "redhat", "dateUpdated": "2009-10-14T00:00:00Z", "x_subShortName": "redhat_6"}}, {"metrics": [{"other": {"type": "Unknown", "content": {"data": "{\"description\":\"low\"}"}}}], "affected": [{"vendor": "debian", "product": "python-pygresql", "versions": [{"status": "affected", "version": "0", "lessThan": "1:4.0-1", "versionType": "deb"}], "platforms": ["bookworm", "forky", "sid", "trixie"], "defaultStatus": "unaffected"}, {"vendor": "debian", "product": "python-pygresql-dbg", "versions": [{"status": "affected", "version": "0", "lessThan": "1:4.0-1", "versionType": "deb"}], "platforms": ["bookworm", "forky", "sid", "trixie"], "defaultStatus": "unaffected"}], "references": [{"url": "https://security-tracker.debian.org/tracker/CVE-2009-2940"}], "descriptions": [{"lang": "en", "value": "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."}], "providerMetadata": {"orgId": "79363d38-fa19-49d1-9214-5f28da3f3ac5", "shortName": "debian", "dateUpdated": "2009-10-14T00:00:00.000Z", "x_subShortName": "debian"}}, {"metrics": [{"cvssV3_0": {"scope": "CHANGED", "version": "3.0", "baseScore": 5.4, "attackVector": "NETWORK", "baseSeverity": "MEDIUM", "vectorString": "CVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:C/C:L/I:L/A:N", "integrityImpact": "LOW", "userInteraction": "NONE", "attackComplexity": "HIGH", "availabilityImpact": "NONE", "privilegesRequired": "NONE", "confidentialityImpact": "LOW"}}, {"other": {"type": "Unknown", "content": {"data": "{\"description\":\"Moderate\"}"}}}], "affected": [{"vendor": "redhat", "product": "PyGreSQL", "platforms": ["cpe:/o:redhat:enterprise_linux:7"], "defaultStatus": "unaffected"}], "references": [{"url": "https://access.redhat.com/security/cve/CVE-2009-2940"}], "descriptions": [{"lang": "en", "value": "Red Hat's versions of the associated software have been determined to NOT be affected by CVE-2009-2940."}], "providerMetadata": {"orgId": "53f830b8-0a3f-465b-8143-3b8a9948e749", "shortName": "redhat", "dateUpdated": "2009-10-14T00:00:00Z", "x_subShortName": "redhat_7"}}, {"metrics": [{"other": {"type": "Unknown", "content": {"data": "{\"description\":\"HIGH\"}"}}}], "affected": [{"vendor": "pypi", "product": "pygresql", "versions": [{"status": "affected", "version": "4.0", "lessThan": "4.1", "versionType": "custom"}, {"status": "affected", "version": "0", "versionType": "custom", "lessThanOrEqual": "3.8.1"}, {"status": "affected", "version": "3.8.1", "versionType": "custom", "lessThanOrEqual": "4.0"}], "defaultStatus": "unaffected"}], "references": [{"url": "http://secunia.com/advisories/37046"}, {"url": "http://secunia.com/advisories/37654"}, {"url": "http://ubuntu.com/usn/usn-870-1"}, {"url": "http://www.debian.org/security/2009/dsa-1911"}, {"url": "http://www.osvdb.org/59028"}, {"url": "https://github.com/PyGreSQL/PyGreSQL"}, {"url": "https://github.com/PyGreSQL/PyGreSQL/commit/8e19320b130946eed6f043297e3e4e005a523612"}, {"url": "https://github.com/PyGreSQL/PyGreSQL/commit/f7237d773e6f4d5a7da3d99bb6bc5062bd07935e"}, {"url": "https://github.com/advisories/GHSA-xv6x-43gq-4hfj"}, {"url": "https://github.com/pypa/advisory-database/tree/main/vulns/pygresql/PYSEC-2009-18.yaml"}, {"url": "https://nvd.nist.gov/vuln/detail/CVE-2009-2940"}], "descriptions": [{"lang": "en", "value": "PyGreSQL 3.8 did not use PostgreSQL’s safe `string` and `bytea` functions in its own escaping functions. As a result, applications written to use PyGreSQL’s escaping functions are vulnerable to SQL injections when processing certain multi-byte character sequences. Because the safe functions require a database connection, to maintain backwards compatibility, `pg.escape_string()` and `pg.escape_bytea()` are still available, but applications will have to be adjusted to use the new `pyobj.escape_string()` and `pyobj.escape_bytea()` functions. For example, code containing:\n\n```python\nimport pg\nconnection = pg.connect(...)\nescaped = pg.escape_string(untrusted_input)\n```\nshould be adjusted to use:\n\n```python\nimport pg\nconnection = pg.connect(...)\nescaped = connection.escape_string(untrusted_input)\n```"}, {"lang": "en", "value": "PyGreSQL Might Be Vulnerable to Encoding-Based SQL Injection"}, {"lang": "en", "value": "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."}], "providerMetadata": {"orgId": "28c92f92-d60d-412d-b760-e73465c3df22", "shortName": "pypi", "dateUpdated": "2009-10-22T16:30:00Z", "x_subShortName": "pypi"}}], "cna": {"metrics": [{"format": "CVSS", "cvssV2_0": {"version": "2.0", "baseScore": 7.5, "accessVector": "NETWORK", "vectorString": "AV:N/AC:L/Au:N/C:P/I:P/A:P", "authentication": "NONE", "integrityImpact": "PARTIAL", "accessComplexity": "LOW", "availabilityImpact": "PARTIAL", "confidentialityImpact": "PARTIAL"}}], "affected": [{"vendor": "unknown", "product": "unknown", "defaultStatus": "unknown"}], "references": [{"url": "http://secunia.com/advisories/37046", "tags": ["vendor-advisory"]}, {"url": "http://secunia.com/advisories/37654"}, {"url": "http://ubuntu.com/usn/usn-870-1"}, {"url": "http://www.debian.org/security/2009/dsa-1911"}, {"url": "http://www.osvdb.org/59028"}], "descriptions": [{"lang": "en", "value": "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."}, {"lang": "es", "value": "El módulo pygresql v3.8.1 y v4.0 para Python no soporta de forma adecuada la función PQescapeStringConn, lo que podría permitir a atacantes remotos aprovechas cuestiones de escape incluidas en las codificaciones de carácter multibyte."}], "problemTypes": [{"descriptions": [{"lang": "en", "description": "NVD-CWE-Other"}]}], "providerMetadata": {"orgId": "00000000-0000-4000-A000-000000000003", "shortName": "DISCARDED_CNA", "dateUpdated": "2009-10-22T16:30:00Z", "x_subShortName": "nvd"}}}, "cveMetadata": {"cveId": "CVE-2009-2940", "state": "PUBLISHED", "dateUpdated": "2025-04-09T00:30:58Z", "assignerOrgId": "8254265b-2729-46b6-b9e3-3dfca2d5bfca", "datePublished": "2009-10-22T16:30:00Z", "assignerShortName": "mitre"}, "dataVersion": "5.0"}