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

CodeIgniter 2.1.4 Weak Encryption

CodeIgniter 2.1.4 Weak Encryption
Posted Jun 11, 2014
Authored by Robin Bailey

CodeIgniter versions 2.1.4 suffer from a weakly encrypted cookie vulnerability if the Mcrypt PHP library is not installed.

tags | advisory, php
SHA-256 | ecbf837304eedee509b6d4b0af685f95cc4f63942f6dad1dd1b88c9a74a1f9e9

CodeIgniter 2.1.4 Weak Encryption

Change Mirror Download
Class                      Weak encryption
Remote Yes
Published 6th June 2014

Credit Robin Bailey of Dionach (vulns@dionach.com)
Vulnerable CodeIgniter <= 2.1.4

Session cookies created by the CodeIgniter PHP framework contain a number of variables in a serialized PHP array. To prevent users from tampering with this cookie two options are available: either an MD5 checksum is used or the cookie is encrypted.

If the application is configured to encrypt the cookie, it will attempt to use 256bit AES from the Mcrypt PHP library. If this library is not available (note that the library was not required, and was not mentioned in the framework documentation) then it will silently fall back to using a custom XOR based encryption.

Because the structure of the session cookie is known, and the cookie contains a number of user-defined parameters (such as the UserAgent), it is possible to decrypt the cookie by performing an offline brute-force attack to obtain the (hashed) encryption key with keys of increasing length. Real world tests showed that this takes between a few seconds and a few minutes.

Once the encryption key has been obtained, there are a number of attacks that can be performed:

1. The session cookie can be decrypted, which may expose session variables.
2. The cookie is passed to an unserialize() call immediately after decryption, so PHP object injection may be possible depending on the classes available (note that the core CodeIgniter classes are not exploitable).
3. Session variables can be injected, which can lead to an authentication bypass in some applications by injecting a "username" or "email" session variable.

Full details of the vulnerability and proof of concept attack scripts are available here:

http://www.dionach.com/blog/codeigniter-session-decoding-vulnerability
https://github.com/Dionach/CodeIgniterXor

After this issue was reported to the vendor (EllisLab), CodeIgniter 2.2.0 was released that removes the XOR based encryption, and required Mcrypt if encryption is used in the application. Note that this vulnerability can be mitigated by installing Mcrypt, as the vulnerable code will no longer be used.

Timeline:

27/05/2014 Vulnerability identified
28/05/2014 Initial vendor contact
28/05/2014 Vendor response to contact
29/05/2014 Vulnerability disclosed to vendor
29/05/2014 Vendor confirms vulnerability
05/06/2014 Vendor releases patch
06/06/2014 Public disclosure of vulnerability

______________________________________________________________________

Disclaimer: This e-mail and any attachments are confidential.

It may contain privileged information and is intended for the named
addressee(s) only. It must not be distributed without Dionach Ltd consent.
If you are not the intended recipient, please notify the sender immediately and destroy this e-mail.

Any unauthorised copying, disclosure or distribution of the material in this e-mail is strictly forbidden. Unless expressly stated, opinions in this e-mail are those of the individual sender, and not of Dionach Ltd.

Dionach Ltd, Greenford House, London Road, Wheatley, Oxford OX33 1JH Company Registration No. 03908168, VAT No. GB750661242

______________________________________________________________________
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