← Back
CVE-2009-2940
SQL Injection in pygresql (CVE-2009-2940)
Summary
SQL injection in pygresql (CVE-2009-2940). Risk of unauthorized operations or information disclosure. Mitigation: upgrade to `4.1` or later.
AI summary snake-internal / snake-material-v2
A vulnerability tracked as **CVE-2009-2940** has been found in pygresql.
Risk of unauthorized operations or information disclosure. CVSS score: ?/10.
What to do: upgrade pygresql to **4.1** or later.
If unsure, ask your IT team or search "pygresql CVE-2009-2940" on the vendor's site.
CVE-2009-2940 (pygresql) — CWE-89 /
Patched: `4.1` — apply immediately
Plan: 1) Audit SBOM/dependencies, 2) Stage→prod upgrade, 3) Add WAF/proxy monitoring on affected endpoints, 4) Hunt IOCs in logs.
Refs: see the GHSA / vendor advisory / patched release linked on this page.
❓ What is the problem
**SQL injection** (CWE-89) exists in pygresql.
📍 Affected scope
pygresql — .
🔥 Severity
Severity: ?. Risk of unauthorized operations or information disclosure
🔧 How to fix
Update to **4.1**.
🛡️ Workaround
Until the patch is applied: disable the affected feature, apply WAF rules, or restrict access via network ACLs.
🔍 Detection
Search webserver/proxy logs for unusual request patterns matching this CVE's known IOCs. Run `grep -r 'pygresql' .` against your dependency files (package-lock.json, requirements.txt, go.sum) to find affected services.
Response Actions (7 steps)
Concrete steps and command examples for SOC/SRE teams to execute in order
-
1Identify exposure identify
grep -r 'pygresql' . | grep -v node_modulesリポジトリと本番環境の依存ファイル (package-lock.json / requirements.txt / go.sum / Gemfile.lock 等) で `pygresql` を grep し、稼働しているサービス・バージョンを把握する。
-
6Apply patch patch
Upgrade pygresql to 4.1ステージング環境で 4.1 に上げて回帰テスト → 本番反映。回帰テストはアプリの主要ハッピーパスと、Step 3 で見つけた異常検知の続報チェックを含めること。
-
7Post-deployment verification verify
Confirm patched version is live in productionパッチ適用後、ステージングで PoC または同等の悪用パターンを再現して脆弱性が閉じたことを確認。本番では Step 3 と同じログクエリでアラート再発が無いか継続監視。
Affected packages
PyPI
pygresql
[{"type":"ECOSYSTEM","events":[{"introduced":"3.8.1"},{"last_affected":"4.0"}]}]
pip
PyGreSQL
[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"4.1"}]}]
References
- advisory https://nvd.nist.gov/vuln/detail/CVE-2009-2940
- advisory http://www.debian.org/security/2009/dsa-1911
- advisory http://secunia.com/advisories/37046
- advisory http://secunia.com/advisories/37654
- advisory https://github.com/advisories/GHSA-xv6x-43gq-4hfj
- package https://github.com/PyGreSQL/PyGreSQL
- web https://github.com/PyGreSQL/PyGreSQL/commit/8e19320b130946eed6f043297e3e4e005a523612
- web https://github.com/PyGreSQL/PyGreSQL/commit/f7237d773e6f4d5a7da3d99bb6bc5062bd07935e
- web http://ubuntu.com/usn/usn-870-1
- web http://www.osvdb.org/59028
- web https://github.com/pypa/advisory-database/tree/main/vulns/pygresql/PYSEC-2009-18.yaml