CVE-2007-3892 - Improper Control of Generation of Code ('Code Injection')

Severity

75%

Complexity

99%

Confidentiality

106%

Secunia advisory: http://secunia.com/advisories/23469/ Contains patch information.

Microsoft Internet Explorer 5.01 through 7 allows remote attackers to spoof the URL address bar and other "trust UI" components via unspecified vectors, a different issue than CVE-2007-1091 and CVE-2007-3826.

Secunia advisory: http://secunia.com/advisories/23469/ Contains patch information.

CVSS 2.0 Base Score 7.5. CVSS Attack Vector: network. CVSS Attack Complexity: low. CVSS Vector: (AV:N/AC:L/Au:N/C:P/I:P/A:P).

Demo Examples

Improper Control of Generation of Code ('Code Injection')

CWE-94

This example attempts to write user messages to a message file and allow users to view them.


               
}
echo "Message Saved!<p>\n";
include($MessageFile);

While the programmer intends for the MessageFile to only include data, an attacker can provide a message such as:


               
message=%3C?php%20system(%22/bin/ls%20-l%22);?%3E

which will decode to the following:


               
<?php system("/bin/ls -l");?>

The programmer thought they were just including the contents of a regular data file, but PHP parsed it and executed the code. Now, this code is executed any time people view messages.

Notice that XSS (CWE-79) is also possible in this situation.

Improper Control of Generation of Code ('Code Injection')

CWE-94

edit-config.pl: This CGI script is used to modify settings in a configuration file.


               
}
# code to add a field/key to a file goes here
# code to set key to a particular file goes here
# code to delete key from a particular file goes here
eval($code);# this is super-efficient code, especially if you have to invoke# any one of dozens of different functions!
handleConfigAction($configfile, param('action'));
print "No action specified!\n";

The script intends to take the 'action' parameter and invoke one of a variety of functions based on the value of that parameter - config_file_add_key(), config_file_set_key(), or config_file_delete_key(). It could set up a conditional to invoke each function separately, but eval() is a powerful way of doing the same thing in fewer lines of code, especially when a large number of functions or variables are involved. Unfortunately, in this case, the attacker can provide other values in the action parameter, such as: add_key(",","); system("/bin/ls"); This would produce the following string in handleConfigAction(): config_file_add_key(",","); system("/bin/ls"); Any arbitrary Perl code could be added after the attacker has "closed off" the construction of the original function call, in order to prevent parsing errors from causing the malicious eval() to fail before the attacker's payload is activated. This particular manipulation would fail after the system() call, because the "_key(\$fname, \$key, \$val)" portion of the string would cause an error, but this is irrelevant to the attack because the payload has already been activated.

Overview

Type

Microsoft

First reported 17 years ago

2007-10-09 22:17:00

Last updated 6 years ago

2018-10-15 21:31:00

Affected Software

Microsoft Internet Explorer 5.01 (Windows 2000 Beta 3, build 5.00.2031)

5.00.2516.1900

Microsoft Internet Explorer 5 (Windows 98 Second Edition)

5.00.2614.3500

Microsoft Internet Explorer 5.01 (Windows 2000 RC1, build 5.00.2072)

5.00.2919.800

Microsoft Internet Explorer 5.01 (Windows 2000 RC2, build 5.00.2128)

5.00.2919.3800

Microsoft Internet Explorer 5.01 (Office 2000 SR-1)

5.00.2919.6307

Microsoft Internet Explorer 5.01 (Windows 2000, build 5.00.2195)

5.00.2920.0000

Microsoft Internet Explorer 5.01 SP1 (Windows 2000 SP1)

5.00.3103.1000

Microsoft Internet Explorer 5.01 SP1 (Windows 95/98 and Windows NT 4.0)

5.00.3105.0106

Microsoft Internet Explorer 5.01 SP2 (Windows 95/98 and Windows NT 4.0)

5.00.3314.2101

Microsoft Internet Explorer 5.01 SP2 (Windows 2000 SP2)

5.00.3315.1000

Microsoft Internet Explorer 5.01 SP3 (Windows 2000 SP3 only)

5.00.3502.1000

Microsoft Internet Explorer 5.01 SP4 (Windows 2000 SP4 only)

5.00.3700.1000

Microsoft Internet Explorer 6 Public Preview (Beta)

6.00.2462.0000

Microsoft Internet Explorer 6 Public Preview (Beta) Refresh

6.00.2479.0006

Microsoft Internet Explorer 6 (Windows XP)

6.00.2600.0000

Microsoft Internet Explorer 6 Service Pack 1 (Windows XP SP1)

6.00.2800.1106

Microsoft Internet Explorer 6 for Windows XP SP2

6.00.2900.2180

Microsoft Internet Explorer 6 for Windows Server 2003 RC1

6.00.3663.0000

Microsoft Internet Explorer 6 for Windows Server 2003 RC2

6.00.3718.0000

Microsoft Internet Explorer 6 for Windows Server 2003 (released)

6.00.3790.0000

Microsoft Internet Explorer 6 for Windows Server 2003 SP1 and Windows XP x64

6.00.3790.1830

Microsoft Internet Explorer 6 SP2 for Windows Server 2003 SP1 and Windows XP x64

6.00.3790.3959

Microsoft Internet Explorer 7.0

7.0

Microsoft ie 7.0_beta1

7.0

Microsoft ie 7.0_beta2

7.0

Microsoft ie 7.0_beta3

7.0

Microsoft Internet Explorer 7 for Windows XP and Windows Server 2003

7.00.5730.1100

Microsoft Internet Explorer 7 for Windows Vista

7.00.6000.16386

Microsoft Internet Explorer 7 for Windows XP and Server 2003 SP2 x64

7.00.6000.16441

Stay updated

ExploitPedia is constantly evolving. Sign up to receive a notification when we release additional functionality.

Get in touch

If you'd like to report a bug or have any suggestions for improvements then please do get in touch with us using this form. We will get back to you as soon as we can.