PostgreSQLDatabase / datastore

CVE-2015-3166

CRITICAL · 9.8 CVSS v3.1 Published 2019-11-20
Fix available
A fix is available. Upgrade to 9.0.20 / 9.1.16 or later.
See remediation →
100/100
Remediation priority · Urgent
Remotely reachable No privileges Zero-click

Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.

NVD · unedited
The snprintf implementation in PostgreSQL before 9.0.20, 9.1.x before 9.1.16, 9.2.x before 9.2.11, 9.3.x before 9.3.7, and 9.4.x before 9.4.2 does not properly handle system-call errors, which allows attackers to obtain sensitive information or have other unspecified impact via unknown vectors, as demonstrated by an out-of-memory error.

Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.

dbcve analysis · high confidence

PostgreSQL's snprintf implementation fails to properly handle system-call errors, allowing attackers to potentially obtain sensitive information or cause unspecified impact via unknown vectors such as out-of-memory conditions.

MitigationUpgrade PostgreSQL to version 9.0.20, 9.1.16, 9.2.11, 9.3.7, 9.4.2 or later to patch the snprintf error-handling vulnerability.

Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.

Affected products & versions What the vendor confirmedThe version ranges the vendor confirmed as vulnerable. If your version sits inside a range here, treat yourself as exposed until you have upgraded.

NVD · CPE data
PostgreSQLDatabase / datastore
Affected:< 9.0.20>= 9.1, < 9.1.16>= 9.2, < 9.2.11>= 9.3, < 9.3.7>= 9.4, < 9.4.2
Debian LinuxOperating system
Affected:= 7.0= 8.0= 9.0
Ubuntu LinuxOperating system
Affected:= 12.04= 14.04= 14.10= 15.04

CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.

From the vector
Attack vector
Network
Complexity
Low
Privileges
None
User interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.

dbcve checks

Work through these to decide whether this CVE applies to you.

  1. Identify installed PostgreSQL version
    Run 'psql --version' or connect to the database and execute 'SELECT version();' to retrieve the server version string
    Affected if The version number is less than 9.0.20, or between 9.1.0 and 9.1.15, between 9.2.0 and 9.2.10, between 9.3.0 and 9.3.6, or between 9.4.0 and 9.4.1
  2. Check Debian system package version
    If using Debian, run 'dpkg -l | grep postgresql' to list installed PostgreSQL packages and their versions
    Affected if The installed postgresql version is 7.0, 8.0, or 9.0 (these Debian-specific versions are listed as affected)
  3. Check Ubuntu system package version
    If using Ubuntu, run 'dpkg -l | grep postgresql' to list installed PostgreSQL packages and their versions
    Affected if The installed postgresql version corresponds to Ubuntu 12.04, 14.04, 14.10, or 15.04 packages which ship the vulnerable PostgreSQL versions
  4. Verify snprintf is in use
    The vulnerability is in PostgreSQL's snprintf implementation - confirm the database is actively running and processing queries (the vulnerability triggers during snprintf calls with system call failures such as out-of-memory conditions)
    Affected if PostgreSQL is running and handling user queries, as the flaw manifests when snprintf encounters error conditions during formatting operations

A system is affected if it runs any PostgreSQL version below 9.0.20, between 9.1.0-9.1.15, 9.2.0-9.2.10, 9.3.0-9.3.6, or 9.4.0-9.4.1, or uses the Debian/Ubuntu distributions specified that ship these vulnerable versions.

Generated from the published advisory. Verify against your own configuration.

Check your environment

Paste your version and any relevant configuration and it will be compared against the affected criteria above. Do not include secrets or credentials.

AI-assisted, checked against the advisory. Informational, not a guarantee.

Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.

dbcve · scoped
Upgrade available Upgrade to 9.0.20 / 9.1.16 / 9.2.11 or later
Fixed in 9.0.209.1.169.2.11
Interim mitigation

Upgrade PostgreSQL to version 9.0.20, 9.1.16, 9.2.11, 9.3.7, 9.4.2 or later to patch the snprintf error-handling vulnerability.

Recommended fix High confidence

Upgrade to PostgreSQL 9.0.20, 9.1.16, 9.2.11, 9.3.7, or 9.4.2 (or a later stable release such as 9.4.x, 9.5+, 10+, 11+, 12+, 13+, 14+, or 15+ as appropriate for your environment)

  1. 1. Identify the currently installed PostgreSQL version by running: psql --version or SELECT version();
  2. 2. Stop the PostgreSQL service to prevent data corruption during upgrade: sudo systemctl stop postgresql (or sudo service postgresql stop)
  3. 3. Create a full backup of all databases using pg_dumpall: sudo -u postgres pg_dumpall > /path/to/backup.sql
  4. 4. For Debian/Ubuntu systems, update package lists and upgrade: sudo apt-get update && sudo apt-get install postgresql (or specify postgresql-9.x for version-specific upgrade)
  5. 5. If using a Red Hat/CentOS system, use: sudo yum update postgresql or sudo dnf update postgresql
  6. 6. Verify the new version is installed: psql --version
  7. 7. Start the PostgreSQL service: sudo systemctl start postgresql (or sudo service postgresql start)
  8. 8. Verify the database cluster is accessible and data is intact
Caveat Minor: Review release notes for any behavioral changes; major version upgrades may require application testing and pg_dump/restore. The snprintf error handling fix is a security patch with minimal expected compatibility impact.

Generated from the published advisory — verify against the referenced sources before acting.

Fix this in PostgreSQL Scoped from the published advisory
  • Consultation4.0 h
  • Implementation8.0 h
  • Testing6.0 h
  • Review / QA2.0 h
20.0 hours of engineering $3,500
Get the upgrade done

An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $5,600.

Scan for this in your stack

Free · runs locally
dbcve dependency scanner

Check whether your project pulls in CVE-2015-3166 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.

References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.

Primary sources

Practitioner notes

Contributed

Peer-ranked notes from engineers who’ve handled CVE-2015-3166 in production — separate from our analysis above.

No notes yet

Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.

What this is

A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.

What belongs here
  • Verified mitigations, workarounds, and config changes
  • Version or environment caveats, and links to real fixes
  • No weaponised exploit code, or anything meant to cause harm
  • No spam, self-promotion, credentials, or personal data