Bug 547662 (CVE-2009-4034) - CVE-2009-4034 postgresql: incorrect verification of SSL certificates with NUL in name
Summary: CVE-2009-4034 postgresql: incorrect verification of SSL certificates with NUL...
Alias: CVE-2009-4034
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
Depends On: 552617
TreeView+ depends on / blocked
Reported: 2009-12-15 10:55 UTC by Tomas Hoger
Modified: 2021-11-12 20:02 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2010-02-22 16:33:14 UTC

Attachments (Terms of Use)

Description Tomas Hoger 2009-12-15 10:55:07 UTC
A CVE-2009-2408-like flaw was found in the way PostgreSQL handled CommonNames with embedded NUL character (\0) in SSL certificates.  An attacker able to get a specially-crafted certificate signed by the CA trusted by PostgreSQL client or server could use this flaw to perform a MITM attack against the client, or authenticate as different user when client certificate authentication was configured on the server.

Description from the upstream security page:


  NULL Bytes in SSL Certificates can be used to falsify client or server
  authentication. This only affects users who have SSL enabled, perform
  certificate name validation or client certificate authentication, and
  where the Certificate Authority (CA) has been tricked into issuing invalid
  certificates. The use of a CA that can be trusted to always issue valid
  certificates is recommended to ensure you are not vulnerable to this issue.

  Affected versions:
  8.4, 8.3, 8.2, 8.1, 8.0, 7.4

  Fixed in:
  8.4.2, 8.3.9, 8.2.15, 8.1.19, 8.0.23, 7.4.27

Upstream commit:

Comment 1 Tomas Hoger 2009-12-15 11:01:32 UTC
While the upstream applied the fix to all currently supported versions, this really only is a security flaw in 8.4 and later versions.  Previous versions do not compare connection host name with the certificate CommonName at all.  Client certificate authentication was also only introduced in 8.4.

With the patch applied in older versions, a certificate with \0 in CN will cause the client to abort connection even though no other name validation is performed.

We are not treating this as security in pre-8.4 versions.  Future postgresql packages updates may, however, contain this fix (e.g. when rebasing to newer upstream point releases).

Comment 3 Fedora Update System 2009-12-16 17:11:10 UTC
postgresql-8.3.9-1.fc11 has been submitted as an update for Fedora 11.

Comment 4 Fedora Update System 2009-12-18 04:36:21 UTC
postgresql-8.3.9-1.fc11 has been pushed to the Fedora 11 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 5 Fedora Update System 2009-12-18 04:39:40 UTC
postgresql-8.4.2-1.fc12 has been pushed to the Fedora 12 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 7 Tomas Hoger 2010-02-22 16:33:14 UTC
Fixed in Fedora, not a security flaw for Red Hat Enterprise Linux 3, 4 and 5 (see comment #1).

Note You need to log in before you can comment on or make changes to this bug.