Assignment 7, due Apr 2
Part of
the homework for 22C:169, Spring 2010
|
Always, on every assignment, please write your name legibly as it appears on your University ID and on the class list! All assignments will be due at the start of class on the day indicated (usually a Friday), and unless there is what insurance companies call "an act of God" - something outside your control; the only exceptions to this rule will be by advance arrangement.
/* wrapper for shell script. The setuid bit can be set on the executable of the wrapper file */ #include <unistd.h> int main(int argc, char* argv[]) { execve( "script", argv, envp ); }
In their solutions to the exam, many students proposed the following alternative wrapper:
/* wrapper for shell script. The setuid bit can be set on the executable of the wrapper file */ #include <string.h> #include <stdlib.h> #define LEN 4096 int main(int argc, char* argv[]) { char command[LEN]; int i; strncat( command, "script", LEN ); for (i = 1; i < argc; i++) { strncat( command, " ", LEN ); strncat( command, argv[i], LEN ); } system( command ); }
In the remainder of this problem, ignore the problem of LEN. Yes, this constant is a problem, but the problem can be solved by the simple expedient of computing the length of all the strings to be concatenated and then dynamically allocating the command buffer to be that big before starting to concatenate everything.
Note that parameter validation code could be added to either of these, and most of this code would be the same.
a) Does one of these pose a potential problem that the other does not? Explain the problem, and give an example. (0.5 points)
b) What kind of extra parameter validation code would you write to detect and prevent the problem described above? (0.5 points)
Note that publication is a powerful tool for establishing that a document existed at a particular date. Publishing the ballot box and publishing the codebook make it very difficult for an attacker after the date of publication to attempt to claim that a different version of the document is authentic.
a) How can the government use a cryptographically secure hash function to prove that it has not changed the codebook since the start of the election? (0.5 points)
b) Is publication on a web site as strong a defense as publication on paper? Why or why not? What is it about paper or the web that makes one of these stronger? (0.5 points)
a) Imagine that you successfully steal a copy of the codebook from the election authority. Is there any attack you could carry out using the codebook if it contained keys that you could not carry out if you did not have the keys? (0.5 points)
b) Does publishing the codebook and ballot box contents threaten the voter's right to a secret ballot? (0.5 points)
c) If you were a RIES voter and I offered to pay you to vote for a particular candidate, how could you prove to me that you had carried out your side of the bargain? (0.5 points)
a) Suppose someone figured out how to invert the one-way function that maps a server's private ID to its public ID. What could a malicious user do with this? Explain how! (0.5 points)
b) Suppose someone figured out how to invert the one-way function used to compute the check field on capabilities. What could a malicious user do with this? Explain how! (0.5 points)
A Question: How does Amoeba's view of process migration differ from this? (0.5 points)