Securing An ASP.NET Web Application/API Flashcards

1
Q

What are buffer overflows?

A

When the amount of data in the buffer exceeds its storage capacity. That extra data overflows into adjacent memory locations and corrupts or overwrites the data in those locations.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How would you prevent buffer overflows?

A

Input validation.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is an **XSS (Cross-Site Scripting) **attack?

A

When malicious script is injected into a trusted website.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How can you prevent **XSS (Cross-Site Scripting) **attacks?

A
  • ValidateInput attribute
  • HtmlEncoder
  • AntiXssEncode class**
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are SQL Injection Attacks?

A

When an attackercan execute malicious SQL statements

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How can you prevent SQL Injection Attacks?

A
  • Input validation
  • Query parameterisation
  • Reduced privileges user
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is CORS?

A

Cross-Origin Resource sharing that allows restricted resources on one domain to be requested from another

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How do we enable CORS on ASP.NET?

A

In startup.cs in ConfigureServices.

services.AddCors() can beused to add a policy and specify what you can accept.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What elements can we specify when adding a CORS policy?

A
  • Origin (ie all or websites)
  • Header (ie application/x-www-form-urlencoded , multipart/form-data , or text/plain)
  • Method (get, post etc…)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly