Bug 736604 - (CVE-2011-2766) CVE-2011-2766 perl-FCGI, fcgi: Certain environment variables shared between first and subsequent HTTP requests
CVE-2011-2766 perl-FCGI, fcgi: Certain environment variables shared between f...
Status: CLOSED ERRATA
Product: Security Response
Classification: Other
Component: vulnerability (Show other bugs)
unspecified
All Linux
medium Severity medium
: ---
: ---
Assigned To: Red Hat Product Security
impact=moderate,public=20110907,repor...
: Security
Depends On: 736608 736609
Blocks:
  Show dependency treegraph
 
Reported: 2011-09-08 04:23 EDT by Jan Lieskovsky
Modified: 2011-10-10 03:58 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2011-10-10 03:58:48 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
CPAN 68380 None None None Never

  None (edit)
Description Jan Lieskovsky 2011-09-08 04:23:17 EDT
It was found that the perl Fast CGI module did not properly clean up certain environment variables, related to a particular HTTP request, between subsequent incoming requests. Any environment variable set in the first pass through the code by processing the first request, that wasn't set in some subsequent request, has been added to the hash containing environment variables for that subsequent request. A remote attacker could use this flaw to bypass the authentication process and obtain access to resources, which would be otherwise protected by authentication.

References:
[1] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=607479
Comment 1 Jan Lieskovsky 2011-09-08 04:37:08 EDT
This issue affects the versions of the perl-FCGI package, as shipped with Fedora release of 14 and 15. Please schedule an update once final upstream patch known.

--

This issue affects the version of the perl-FCGI package, as present within EPEL-6 repository. Please schedule an update once final upstream patch known.

--

This issue did NOT affect the versions of the fcgi package, as shipped with Fedora release of 14 and 15. Though the fcgi package in those releases contains embedded copy of the perl-FCGI package, the code in question does not contain the regression in FCGI's accept() routine yet.

--

This issue did NOT affect the versions of the fcgi package, as present within EPEL-5 and EPEL-6 repositories. Though the fcgi package in those releases contains embedded copy of the perl-FCGI package, the code in question does not contain the regression in FCGI's accept() routine yet.
Comment 2 Jan Lieskovsky 2011-09-08 04:39:02 EDT
CVE Request:
[2] http://www.openwall.com/lists/oss-security/2011/09/08/1
Comment 3 Jan Lieskovsky 2011-09-08 04:40:09 EDT
Created perl-FCGI tracking bugs for this issue

Affects: fedora-all [bug 736608]
Affects: epel-6 [bug 736609]
Comment 4 Jan Lieskovsky 2011-09-08 04:48:37 EDT
Sample code snippet (from Debian bug report [1]) to demonstrate the deficiency:

<quote>

#! /usr/bin/perl -w

use CGI::Fast qw(:standard :cgi-lib);
use Data::Dumper;
use strict;

while ( my $cgi = getRequest() ) {

    print $cgi->header();

    print "<pre>========= ID:$$ =========\n";
    while (my ($key,$value) = each %ENV) {
       print "$key=$value\n";
    }
    print "========= VARS =========\n";
    print Dumper($cgi->Vars());
    print "========= COOKIE =========\n";
    print Dumper($cgi->cookie());
    print ".</pre>";

    #%ENV = undef;
}

sub getRequest {
    %ENV = () if $main::clearENV; # Clear the ENV
    $main::clearENV = 1;          # Do not clear the ENV the first time otherwise the Fast::CGI "slow mode" will not work anymore
    return new CGI::Fast;
}


I used 2 wget together to examine it:
(posted to the proxy server to disable caching)

$ http_proxy=http://proxy:8080 watch -d 'wget -qO - --post-data='xxx' --header "Cookie: usernaam=test" http://www.myserver.nl/env.fcgi'
$ watch -d 'wget -qO - http://www.myserver.nl/env.fcgi'

</quote>
Comment 5 Jan Lieskovsky 2011-09-08 09:42:35 EDT
The CVE identifier of CVE-2011-2766 has been assigned to this issue:
http://www.openwall.com/lists/oss-security/2011/09/08/2
Comment 6 Till Maas 2011-09-09 11:40:15 EDT
Is fcgi-perl from EPEL5 affected by this bug as well?
Comment 7 Jan Lieskovsky 2011-09-09 13:00:11 EDT
(In reply to comment #6)
> Is fcgi-perl from EPEL5 affected by this bug as well?

No, fcgi in EPEL-5 contains CPAN v0.67 version of the FCGI module (thus is not yet affected by this).
Comment 8 Fedora Update System 2011-10-09 17:02:08 EDT
perl-FCGI-0.71-4.el6 has been pushed to the Fedora EPEL 6 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 9 Jan Lieskovsky 2011-10-10 03:58:48 EDT
This issue has been addressed in the following updates:
1) perl-FCGI-0.74-1.fc16,
2) perl-FCGI-0.74-1.fc15,
3) perl-FCGI-0.74-1.fc14,
4) perl-FCGI-0.71-4.el6.

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