Web security Flashcards

1
Q

Describe how cross-site scripting works

A

There are two main types of cross-site scripting attacks: Stored (or persistent) XSS, which is when malicious script is injected directly into the vulnerable application, and reflected XSS, which involves ‘reflecting’ malicious script into a link on a page, which will activate the attack once the link has been clicked.

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

Describe one countermeasure for XSS attacks

A

Escape untrusted data based on output context

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

How does a cross-site request forgery attack work

A

CSRF is an attack that tricks the victim into submitting a malicious request. It inherits the identity and privileges of the victim to perform an undesired function on the victim’s behalf. For most sites, browser requests automatically include any credentials associated with the site, such as the user’s session cookie, IP address, Windows domain credentials, and so forth. Therefore, if the user is currently authenticated to the site, the site will have no way to distinguish between the forged request sent by the victim and a legitimate request sent by the victim.

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

How does SQL injection work

A

SQL injection usually occurs when you ask a user for input, like their username/userid, and instead of a name/id, the user gives you an SQL statement that you will unknowingly run on your database.

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

How can you prevent CSRF attacks?

A

Use CSRF tokens to prevent.

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

How can you prevent SQL injections?

A

Use parameterized queries or an object-relational mapping.

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

What is Broken Authentication and Session Management?

A

Authentication and session management includes all aspects of handling user authentication and managing active sessions. Authentication is a critical aspect of this process, but even solid authentication mechanisms can be undermined by flawed credential management functions, including password change, forgot my password, remember my password, account update, and other related functions. Because “walk by” attacks are likely for many web applications, all account management functions should require reauthentication even if the user has a valid session id.

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

How can you mitigate Broken Authentication and Session Management?

A

Avoid default credentials, use secure password hashing, good password policies, protect against account- and password brute-forcing, use two factor authentication (2FA) if possible.

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

What is XML External Entity?

A

An XML External Entity attack is a type of attack against an application that parses XML input. This attack occurs when XML input containing a reference to an external entity is processed by a weakly configured XML parser. This attack may lead to the disclosure of confidential data, denial of service, server side request forgery, port scanning from the perspective of the machine where the parser is located, and other system impacts.

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

How can you prevent an XML External Entity exploit?

A

Disable XML external entity and DTD processing and upgrade XML parsers. Validate all user inputs.

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

How can you prevent sensitive data exposure?

A

Encrypt data at rest and in transit. Only trusted services can decrypt.

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

What is Broken acces control?

A

Access control, sometimes called authorization, is how a web application grants access to content and functions to some users and not others. These checks are performed after authentication, and govern what ‘authorized’ users are allowed to do. Access control sounds like a simple problem but is insidiously difficult to implement correctly. A web application’s access control model is closely tied to the content and functions that the site provides. In addition, the users may fall into a number of groups or roles with different abilities or privileges.

Developers frequently underestimate the difficulty of implementing a reliable access control mechanism. Many of these schemes were not deliberately designed, but have simply evolved along with the web site. In these cases, access control rules are inserted in various locations all over the code. As the site nears deployment, the ad hoc collection of rules becomes so unwieldy that it is almost impossible to understand.

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

How can you prevent Broken access control?

A

Test your code and application

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

What is Security misconfigurations?

A

Manual or ad-hoc system configurations commonly create security vulnerabilities

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

How can you prevent security misconfigurations?

A

System hardening and automation, disable unnecessary features and talkative error messages, check configs.

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

What is insecure deserialization ?

A

Insecure Deserialization, also known as Untrusted Deserialization, is a serious category of Application Security issues potentially affecting most modern systems.
Insecure handling of hostile serialized objects can lead to remote code execution, injections and other attacks.

17
Q

How can you prevent insecure deserialization?

A

Don’t deserialize user provided objects. If you have to, sign and check signature before processing, do type checking.

18
Q

How can you prevent against Using components with known vulnerabilities?

A

Track vulnerabilities in software you use and which versions are running

19
Q

What is Insufficient logging and monitoring?

A

Long response times allows attackers to maintain persistence, pivot to more systems, tamper, extract or destroy data.

20
Q

How can you prevent insufficient loggin and monitoring?

A

Establish effective monitoring and alerting for all critical operations.

21
Q

What are the three other exploits that are not on the top ten OWASP list?

A

Cross-site request forgery
Click-jacking - Hide another page below what the user sees. Align elements to make user interact with the embedded page.
Open redirects - Redirect browser to a site based on data in the URL. Useful for phishing attacks. example.com/redirect?url=evil.com