The second issue concerns the vulnerability of gaining root
access to the system. Normally firewall and traffic control
services require root privilege. By letting users manipulate iptables and tc control via a web interface, this means we
grant system access right to user Apache. To prevent the
Apache user from accessing unwanted services, we create a
wrapper program to allow Apache to run just the necessary
commands. In BaCon, Apache only needs to execute iptables
commands, tc commands, and cron commands. So we create
three wrapper programs, namely ipt.c, tc.c, and cron.c, shown
in Figure 4. The wrapper programs will execute only if run as
Apache user ID and the arguments have a proper format. User
inputs are filtered for string literal escape characters such as
‘..’, ‘/’, or ‘;’ to avoid unexpected code injection attacks. For
additional security, all web forms in BaCon implement the
HTTP POST instead of HTTP GET method and avoid sending
hidden-type inputs.