CVE-2006-6504 - Improper Control of Generation of Code ('Code Injection')

Severity

93%

Complexity

86%

Confidentiality

165%

Mozilla Firefox 2.x before 2.0.0.1, 1.5.x before 1.5.0.9, and SeaMonkey before 1.0.7 allows remote attackers to execute arbitrary code by appending an SVG comment DOM node to another type of document, which triggers memory corruption.

Mozilla Firefox 2.x before 2.0.0.1, 1.5.x before 1.5.0.9, and SeaMonkey before 1.0.7 allows remote attackers to execute arbitrary code by appending an SVG comment DOM node to another type of document, which triggers memory corruption.

CVSS 2.0 Base Score 9.3. CVSS Attack Vector: network. CVSS Attack Complexity: medium. CVSS Vector: (AV:N/AC:M/Au:N/C:C/I:C/A:C).

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

First reported 18 years ago

2006-12-20 01:28:00

Last updated 6 years ago

2018-10-17 21:48:00

Affected Software

Mozilla Firefox

Mozilla SeaMonkey

Canonical Ubuntu Linux 5.10

5.10

Canonical Ubuntu Linux 6.06 LTS (Long-Term Support)

6.06

Canonical Ubuntu Linux 6.10

6.10

References

20061202-01-P

Broken Link

FEDORA-2006-1491

Broken Link

FEDORA-2007-004

Broken Link

HPSBUX02153

Broken Link

RHSA-2006:0758

Third Party Advisory

RHSA-2006:0759

Third Party Advisory

RHSA-2006:0760

Third Party Advisory

23282

Third Party Advisory

23422

Third Party Advisory

23433

Third Party Advisory

23439

Third Party Advisory

23440

Third Party Advisory

23468

Third Party Advisory

23514

Third Party Advisory

23545

Third Party Advisory

23589

Third Party Advisory

23601

Third Party Advisory

23614

Third Party Advisory

23618

Third Party Advisory

23672

Third Party Advisory

23692

Third Party Advisory

GLSA-200701-02

Third Party Advisory

1017417

Third Party Advisory, VDB Entry

1017418

Third Party Advisory, VDB Entry

GLSA-200701-04

Third Party Advisory

VU#928956

Third Party Advisory, US Government Resource

MDKSA-2007:010

Third Party Advisory

http://www.mozilla.org/security/announce/2006/mfsa2006-73.html

Vendor Advisory

SUSE-SA:2006:080

Broken Link

SUSE-SA:2007:006

Broken Link

20061220 ZDI-06-051: Mozilla Firefox SVG Processing Remote Code Execution Vulnerability

20061222 rPSA-2006-0234-1 firefox

20070102 rPSA-2006-0234-2 firefox thunderbird

21668

Third Party Advisory, VDB Entry

USN-398-1

Third Party Advisory

USN-398-2

Third Party Advisory

TA06-354A

Third Party Advisory, US Government Resource

ADV-2006-5068

Third Party Advisory

ADV-2008-0083

Third Party Advisory

http://www.zerodayinitiative.com/advisories/ZDI-06-051.html

Third Party Advisory, VDB Entry

https://issues.rpath.com/browse/RPL-883

Broken Link

oval:org.mitre.oval:def:11077

Third Party Advisory

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.