关于fgets()和popen()用法
mals_router_network_adapt.c, line 2908 (Command Injection)Fortify Priority: Critical Folder Critical
Kingdom: Input Validation and Representation
Abstract: The function mals_rt_enable_IP_passthrough() in mals_router_network_adapt.c calls
popen() on line 2908 to execute a command built from untrusted data. This allows an
attacker to inject malicious commands.
Source: mals_router_network_adapt.c:2853 fgets()
2851 {
2852 /*reading buffer return by popen*/
2853 if(fgets(data, sizeof(data), in)!=NULL)
2854 {
2855 data = '\0' ;
Sink: mals_router_network_adapt.c:2908 popen()
2906 /* check if ippastbl already exists */
2907 snprintf(data, sizeof(data), "grep ippastbl %s", RT_ROUTE_TABLE_PATH);
2908 if ((in = popen(data, "r")))
2909 {
2910 if (fgets(data, sizeof(data), in) == NULL)
页:
[1]