References:
Network utilities process data read directly from a network connection, but execute vulnerable code (tcpdump
1, wget
2, etc.).
Traditional OS environment, “if a programmer wants to verify that his program is secure, he typically must first verify that the program satisfies very strong properties, such as memory safety.”
“However, recent work 3 4 5 6 has produced new operating systems that allow programmers to develop programs that execute untrusted code yet satisfy strong security requirements.”
“Moreover, programmers can develop such programs with much less effort than fully verifying the program for a traditional operating system.”
“The developers of such systems have manually modified applications to invoke security primitives so that the application satisfies strong security policies, even when the application contains untrusted code.”
Example: Capsicum 5 on FreeBSD 7.
tcpdump
: difficulty results from the conflicting demands of (i) using low-level primitives, (ii) ensuring that the program satisfies a strong, high-level security requirement, and (iii) preserving the core functionality of the original program.describes capweave
, a tool that
takes as input
automatically rewrites the program to use Capsicum system calls to enforce the policy. (Compartmentalizes the program and instruments it to invoke Capsicum primitives so that it satisfies the policy when executed on Capsicum).
Two key challenges that a programmer faces when manually rewriting a program for Capsicum.
wget
determines under what protocol the URL is addressed (line L1).wget
runs protocol-specific functions to
Security Vulnerability in wget
2:
wget
interacts to write data to any file on the host file system that can be written by the user who runs wget
.wget
processes a particular HTTP response from the server.
wgets
to download data from a different network address);wget
determines the path in its host file system to which it will write data directly from the information provided by the redict server.wget
to write data chosen by the attacker to a path in the file system chosen by the attacker2.To defense:
wget
must not demonstrate a vul. along the lines of the one described above”wget
so that it satisfies such a specification.”wget
and of the HTTP protocol”.wget
in terms of commonly-used, well-understood operating-system objects, such as file descriptors’:wget
executes read_http
, it should always be able to open arbitrary files and sockets. But wget
should execute write_data
with the ability to open files if and only if it has not received an HTTP-redirect response”.
If you could revise
the fundmental principles of
computer system design
to improve security...
... what would you change?