exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

Hardened-PHP Project Security Advisory 2006-01.112

Hardened-PHP Project Security Advisory 2006-01.112
Posted Jan 15, 2006
Authored by Stefan Esser, Hardened-PHP Project | Site hardened-php.net

Hardened-PHP Project Security Advisory - Since PHP5 a user supplied session ID is sent back to the user within a Set-Cookie HTTP header. Because there were no checks performed on the validity of this session id, it was possible to inject arbitrary HTTP headers into the response body of applications using PHP's builtin session functionality by supplying a special crafted session id. Versions 5.1.1 and below are affected. PHP4 is not affected.

tags | advisory, web, arbitrary, php
SHA-256 | 4971bbe2e06b48a7908ab9d7d47baf826e68790f86a6405adda7b5e886c9d6e9

Hardened-PHP Project Security Advisory 2006-01.112

Change Mirror Download
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


Hardened-PHP Project
www.hardened-php.net

-= Security Advisory =-


Advisory: PHP ext/session HTTP Response Splitting Vulnerability
Release Date: 2006/01/12
Last Modified: 2006/01/12
Author: Stefan Esser [sesser@hardened-php.net]

Application: PHP5 <= 5.1.1
Not Affected: PHP4
PHP5 with Hardening-Patch
Severity: PHP applications using PHP5's session extension are
vulnerable to HTTP Response Splitting attacks
Risk: Critical
Vendor Status: Vendor has released a bugfixed version
References: http://www.hardened-php.net/advisory_012006.112.html


Overview:

PHP is a widely-used general-purpose scripting language that is
especially suited for Web development and can be embedded into HTML.

During the development of the Hardening-Patch which adds security
hardening features to the PHP codebase, several vulnerabilities
within PHP were discovered. This advisory describes one of these
flaws concerning a weakness in the session extension.

Since PHP5 a user supplied session ID is sent back to the user within
a Set-Cookie HTTP header. Because there were no checks performed on
the validity of this session id, it was possible to inject arbitrary
HTTP headers into the response body of applications using PHP's
builtin session functionality by supplying a special crafted session
id.

This can be used to perform HTTP Response Splitting and Cross Site
Scripting (XSS) attacks on all applications using the session
extension.


Details:

PHP's own session functionality is using a so-called permissive
system to accept any kind of user supplied session ID. While this is
often criticized as the cause of easier session fixation attacks
against PHP applications, it also means that the session ID has to be
considered as user input in PHP applications.

Therefore it is up to the PHP application to decide if it accepts
the supplied session ID or rejects it because of f.e. not accepted
characters.

Until PHP5 the built-in session extension assumes that a user
supplied session ID is already known on the client side and therefore
it is not sent back to the client within a cookie. This behaviour
has changed in PHP5 and because there was no additional checks
added, this enables an attacker to inject anything he wants into the
Set-Cookie HTTP header. This obviously leads to HTTP Response
Splitting vulnerabilities in all applications using PHP's built-in
session handling.

By simply terminating the HTTP headers from within the Set-Cookie
HTTP header it is of course possible to inject part of the request
body and perform all kinds of Cross Site Scripting (XSS) attacks.

Because PHP's default session storage module, files, will issue a PHP
warning that a session ID with illegal characters was used, this is
not exploitable in some situations where output buffering is switched
off (on server and in the application), the files module is used and
PHP is configured to display warnings.

This means the recommended settings for PHP webservers are vulnerable
and because at least one of the conditions above are not met on nearly
all production servers, most PHP servers are vulnerable to this.

PHP servers using our Hardening-Patch are not vulnerable to this
because they ship with a HTTP Response Splitting protection enabled
by default and also use a strict session ID mode, which disallows all
session IDs not created by PHP itself.


Proof of Concept:

The Hardened-PHP project is not going to release exploits for this
vulnerability to the public.


Recommendation:

It is strongly recommended to upgrade to the latest appropriate PHP
release as soon as possible. On the one hand there are also other
fixes in it and on the other hand it finally comes with a HTTP
Response Splitting protection.

Additionally we always recommend to run PHP with the Hardening-Patch
applied, because this vulnerability once again proved that our users
are protected against unknown vulnerabilities before they become
public knowledge.


GPG-Key:

http://www.hardened-php.net/hardened-php-signature-key.asc

pub 1024D/0A864AA1 2004-04-17 Hardened-PHP Signature Key
Key fingerprint = 066F A6D0 E57E 9936 9082 7E52 4439 14CC 0A86 4AA1


Copyright 2006 Stefan Esser. All rights reserved.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQFDxpDDRDkUzAqGSqERAoqyAJ4gFYE2bPVC1N4AAhidWFk2460gsACgmY2d
qK3r8cAsVboCg0ca+cMqS1w=
=HGR8
-----END PGP SIGNATURE-----

Login or Register to add favorites

File Archive:

April 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Apr 1st
    10 Files
  • 2
    Apr 2nd
    26 Files
  • 3
    Apr 3rd
    40 Files
  • 4
    Apr 4th
    6 Files
  • 5
    Apr 5th
    26 Files
  • 6
    Apr 6th
    0 Files
  • 7
    Apr 7th
    0 Files
  • 8
    Apr 8th
    22 Files
  • 9
    Apr 9th
    14 Files
  • 10
    Apr 10th
    10 Files
  • 11
    Apr 11th
    13 Files
  • 12
    Apr 12th
    14 Files
  • 13
    Apr 13th
    0 Files
  • 14
    Apr 14th
    0 Files
  • 15
    Apr 15th
    30 Files
  • 16
    Apr 16th
    10 Files
  • 17
    Apr 17th
    22 Files
  • 18
    Apr 18th
    45 Files
  • 19
    Apr 19th
    8 Files
  • 20
    Apr 20th
    0 Files
  • 21
    Apr 21st
    0 Files
  • 22
    Apr 22nd
    11 Files
  • 23
    Apr 23rd
    68 Files
  • 24
    Apr 24th
    23 Files
  • 25
    Apr 25th
    0 Files
  • 26
    Apr 26th
    0 Files
  • 27
    Apr 27th
    0 Files
  • 28
    Apr 28th
    0 Files
  • 29
    Apr 29th
    0 Files
  • 30
    Apr 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close