Assignment 3
Objective
The objective of this assignment is to provide you the opportunity to apply secure software
development concepts studied in class.
Task 1 (50 points)
Answer the following questions.
1. The following program is vulnerable to a buffer overflow (assuming the absence of automated
defenses like ASLR, etc.).
a. What is the name of the buffer that can be overflowed?
b. What line of code can overflow the vulnerable buffer?
c. Recall the vulnerable overflow from the previous two questions. We can change one line of
code and make the buffer overrun go away. Which one-line change will eliminate the
vulnerability?
d. Which of the attacks that we studied do you think the program is susceptible to?
e. If we changed printf("%s",buf) to printf(buf) then the program would be
vulnerable to what sort of attack?
2. Recall Heartbleed attack.
a. What type of exploitation of the Heartbleed bug permits?
b. Why is it that anti-virus scanners would not have found an exploitation of Heartbleed?
3. Consider the following code:
char *foo(char *buf) {
char *x = buf +s trlen(buf);
char *y = buf;
while (y != x) {
if (*y == 'r')
break;
y++;
}
return y;
}
void bar() {
char input[10] = "test123";
foo(input);
}
The definition of spatial safety models pointers as capabilities, which are triples (p,b,e) where
p is the pointer, b is the base of the memory region the pointer is allowed to access, and e is
the extent of that region. Assuming characters are 1 byte in size, what is a triple (p,b,e) for the
variable y when it is returned at the end of the code?
4. In a return-oriented program (ROP), what is the role of the stack pointer?
5. A colleague proposes using a heap allocator that randomizes the addresses of allocated objects.
What is the impact of this design on security and performance?
6. Recall that classic enforcement of CFI requires adding labels prior to branch targets, and adding
code prior to the branch that checks the label to see if it's the one that is expected. Now consider
the following program:
To ensure that the instrumented program runs correctly when not being attacked, which of the
following functions would have to be given the same label?
7. Suppose you design software for a bank and the bank's customers may remotely log into its site
using commodity PCs. Which threat model (network-only, snooping, co-located) makes the most
sense for you to consider, when designing the bank's site? Briefly explain.
8. Suppose that x and y in the following program are symbolic. When the symbolic executor
reaches the line that prints "Hi" what will the path condition be?
/* assume x and y are both symbolic */
void foo(int x, int y) {
if (x > 5)
if (y > 7) {
printf("here
");
} else {
if (x < 20)
printf("Hi
");
else
printf("Bye
");
}
}
9. Suppose that x in the following program is symbolic. When the symbolic executor reaches the
line that prints "now" what will the path condition be?
void bar(int x) {
int z;
if (x > 5)
z = 5;
else
z = 1;
if (z > 3)
printf("now
");
}
10. Which of the following styles of fuzzer is more likely to explore paths covering every line of
code in the following program?
• Black Box
• Grammar based
• White Box
Task 2 (50 points)
Research the design of the Google Fuchsia OS (please do more than just reading Wikipedia). The code is
available here: https://fuchsia.googlesource.com.
Describe the techniques (studied in class and those that were not discussed in class) that this new OS uses
for security. For this task write a 3-page report. Include your references.
Deliverable and Grading
Upload your written report to D2L “Homework3” folder. For task1, each question is worth 5 points.
请加QQ:99515681 邮箱:99515681@qq.com WX:codinghelp
-
Zymeworks Announces FDA Clearance of Investigational New Drug Application for ZW171, a novel 2+1 T-cVANCOUVER, British Columbia, June 17, 2024 (GLOBE NEWSWIRE) -- Zymeworks Inc. (Nasdaq: ZYME), a clinical-stage biotechnology company developing a di2024-06-17
-
Indonesia Stock Exchange Partners with Nasdaq to Upgrade Market InfrastructureTechnology partnership will further enhance overall resilience and integrity of the exchange, while supporting the rapid deployment of new products2024-06-17
-
Adalvo 的 Liraglutide 預充式注射筆成為歐盟首款獲得批准的仿製藥馬爾他聖瓜安, June 17, 2024 (GLOBE NEWSWIRE) -- Adalvo 宣布 Liraglutide 預充式注射筆成功取得 DCP 批准,成為歐盟首款獲得批准的仿製藥。 根據 IQVIA 的報2024-06-17
-
促进生育,助力三胎——“三胎免费生”联合公益行动正式启动为积极响应国家号召实施三胎生育政策,扩大妇幼服务健康供给,在云南省优生优育妇幼保健协会指导下,昆明广播电视台联合昆明安琪儿妇产医院,于6月13日在昆明广播2024-06-17
-
学党史传承红色精神 守党纪筑牢自律防线——平安养老险湖南分公司党支部开展主题党日活动七一前夕,平安养老险湖南分公司党支部全体成员走进“千年学府、百年师范”——湖南第一师范,开展了一次学史明理、学史增信、学史崇德、学史力行的主题党日活动。重2024-06-17