CVE-2024-20359 - Improper Control of Generation of Code ('Code Injection')

Severity

60%

Complexity

8%

Confidentiality

86%

A vulnerability in a legacy capability that allowed for the preloading of VPN clients and plug-ins and that has been available in Cisco Adaptive Security Appliance (ASA) Software and Cisco Firepower Threat Defense (FTD) Software could allow an authenticated, local attacker to execute arbitrary code with root-level privileges. Administrator-level privileges are required to exploit this vulnerability. This vulnerability is due to improper validation of a file when it is read from system flash memory. An attacker could exploit this vulnerability by copying a crafted file to the disk0: file system of an affected device. A successful exploit could allow the attacker to execute arbitrary code on the affected device after the next reload of the device, which could alter system behavior. Because the injected code could persist across device reboots, Cisco has raised the Security Impact Rating (SIR) of this advisory from Medium to High.

CVSS 3.1 Base Score 6. CVSS Attack Vector: local. CVSS Attack Complexity: low. CVSS Vector: (CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:N).

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

Cisco Firepower Threat Defense

First reported 3 weeks ago

2024-04-24 19:15:00

Last updated 3 weeks ago

2024-04-26 15:25:00

Affected Software

Cisco Firepower Threat Defense 6.2.3

6.2.3

Cisco Firepower Threat Defense (FTD) 6.2.3.1

6.2.3.1

Cisco Firepower Threat Defense (FTD) 6.4.0

6.4.0

Cisco Firepower Threat Defense 6.2.3.13

6.2.3.13

Cisco Firepower Threat Defense (FTD) 6.2.3.14

6.2.3.14

Cisco Firepower Threat Defense (FTD) 6.2.3.15

6.2.3.15

Cisco Firepower Threat Defense 6.2.3.12

6.2.3.12

Cisco Firepower Threat Defense 6.6.0

6.6.0

Cisco Firepower Threat Defense 6.2.3.2

6.2.3.2

Cisco Firepower Threat Defense 6.2.3.3

6.2.3.3

Cisco Firepower Threat Defense 6.2.3.4

6.2.3.4

Cisco Firepower Threat Defense 6.2.3.5

6.2.3.5

Cisco Firepower Threat Defense 6.2.3.6

6.2.3.6

Cisco Firepower Threat Defense 6.2.3.7

6.2.3.7

Cisco Firepower Threat Defense 6.2.3.10

6.2.3.10

Cisco Firepower Threat Defense 6.2.3.11

6.2.3.11

Cisco Firepower Threat Defense 6.2.3.9

6.2.3.9

Cisco Firepower Threat Defense (FTD) 6.2.3.16

6.2.3.16

Cisco Firepower Threat Defense (FTD) 6.4.0.1

6.4.0.1

Cisco Firepower Threat Defense 6.4.0.3

6.4.0.3

Cisco Firepower Threat Defense (FTD) 6.4.0.2

6.4.0.2

Cisco Firepower Threat Defense (FTD) 6.4.0.4

6.4.0.4

Cisco Firepower Threat Defense (FTD) 6.4.0.5

6.4.0.5

Cisco Firepower Threat Defense (FTD) 6.4.0.6

6.4.0.6

Cisco Firepower Threat Defense (FTD) 6.4.0.7

6.4.0.7

Cisco Firepower Threat Defense (FTD) 6.4.0.8

6.4.0.8

Cisco Firepower Threat Defense 6.4.0.9

6.4.0.9

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.