Bug 497503 (CVE-2009-1341)

Summary: CVE-2009-1341 perl-DBD-Pg: dequote_bytea memory leak
Product: [Other] Security Response Reporter: Tomas Hoger <thoger>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: jorton, kasal, kreilly, ldimaggi, mjc, mmaslano, psplicha, security-response-team, vdanen
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-05-26 17:23:35 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 497999, 498000, 498001, 833953    
Bug Blocks:    

Description Tomas Hoger 2009-04-24 11:14:16 UTC
Bryce Nesbitt notified us about memory leak in DBD-Pg's dequote_bytea (quote.c) caused by:

    New(0, result, strlen((char *)string)+1, unsigned char);
    result = string;

    ...

    Renew(result, (*retlen), unsigned char);

When DBD::Pg is used to get date from tables with columns of BYTEA PostgreSQL, memory is leaked.  This can result in out-of-memory conditions when the affected perl script is long-running one or used with e.g. mod_perl.

This problem should be fixed in DBD-Pg versions 2.x, where extraneous New / Renew calls are removed.

Comment 1 Tomas Hoger 2009-04-24 11:14:41 UTC
This issue does not affect perl-DBD-Pg versions shipped in Red Hat Enterprise
Linux 2.1, 3, and 4.  Version 1.49 shipped in Red Hat Enterprise Linux 5, Red
Hat Application Stack v1 and v2 is affected.

Comment 4 Tomas Hoger 2009-04-28 13:36:58 UTC
Upstream report:
  https://rt.cpan.org/Public/Bug/Display.html?id=21392

Comment 5 Tomas Hoger 2009-04-29 06:23:21 UTC
Public now via Debian DSA:
  http://www.debian.org/security/2009/dsa-1780

Comment 6 Vincent Danen 2009-05-01 16:51:26 UTC
Common Vulnerabilities and Exposures assigned an identifier CVE-2009-1341 to
the following vulnerability:

Name: CVE-2009-1341
URL: http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2009-1341
Assigned: 20090417
Reference: MISC: https://launchpad.net/bugs/cve/2009-1341
Reference: CONFIRM: http://cpansearch.perl.org/src/TURNSTEP/DBD-Pg-2.13.1/Changes
Reference: CONFIRM: http://rt.cpan.org/Public/Bug/Display.html?id=21392
Reference: CONFIRM: http://security.debian.org/pool/updates/main/libd/libdbd-pg-perl/libdbd-pg-perl_1.49-2+etch1.diff.gz
Reference: DEBIAN:DSA-1780
Reference: URL: http://www.debian.org/security/2009/dsa-1780

Memory leak in the dequote_bytea function in quote.c in the DBD::Pg
(aka DBD-Pg or libdbd-pg-perl) module before 2.0.0 for Perl allows
context-dependent attackers to cause a denial of service (memory
consumption) by fetching data with BYTEA columns.

Comment 8 errata-xmlrpc 2009-05-13 14:27:16 UTC
This issue has been addressed in following products:

  Red Hat Enterprise Linux 5

Via RHSA-2009:0479 https://rhn.redhat.com/errata/RHSA-2009-0479.html

Comment 9 errata-xmlrpc 2009-05-26 17:06:15 UTC
This issue has been addressed in following products:

  Red Hat Web Application Stack for RHEL 5

Via RHSA-2009:1067 https://rhn.redhat.com/errata/RHSA-2009-1067.html

Comment 10 Tomas Hoger 2009-05-26 17:23:35 UTC
Red Hat Application Stack v1 for Enterprise Linux AS (version 4) is now in the maintenance phase of its life cycle:

  http://www.redhat.com/security/updates/rhappstack/

According to the published Errata Support Policy, only security issues with critical security impact are fixed in Red Hat Application Stack during the maintenance phase.  This issue was rated as having moderate security impact and therefore will not be fixed in Red Hat Application Stack v1.