Security Flashcards

1
Q

Full form of JWT

A

JSON web tokens

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

What is a JWT ?

A

an open standard used to share security information between two parties — a client and a server.

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

What do JWTs contain ?

A

Each JWT contains encoded JSON objects, including a set of claims.

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

How does JWTs make sure their set of claims are not altered ?

A

JWTs are signed using a cryptographic algorithm to ensure that the claims cannot be altered after the token is issued.

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

What is a disadvantage of using a JWT ?

A

it relies on only one key

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

What are the repurcussions of JWT relying on only one key

A

JWT uses only one key, which if handled poorly by a developer/administrator, would lead to severe consequences that can compromise sensitive information.

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

What is an OAuth ?

A

OAuth is an open standard protocol that provides secure authorization for third-party applications to access user data without requiring the user to share their credentials (i.e., username and password) with the third-party application.

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

OAuth Full form ?

A

Open Authorization

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

What security protocol can you use to bypass the need for 3rd party applications to store user credentials ?

A

use OAuth

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

What kind of convenience does OAuth provide ?

A

OAuth eliminates the need for users to create separate accounts for each application they use, making it easier and more convenient to use multiple applications.

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

How does OAuth provide more control to it’s users ?

A

OAuth gives users control over which applications have access to their data, and allows them to revoke access at any time.

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

How does OAuth provide a better user experience ?

A

With OAuth, users can easily authorize third-party applications to access their data without having to manually enter their credentials each time.

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

What is the advantage of OAuth being an “open-standard” ?

A

widely used and supported by many applications and browsers

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

5 advantages of using OAuth

A
  • Security: OAuth provides a secure method of authorization that eliminates the need for third-party applications to store user credentials.
  • Convenience: OAuth eliminates the need for users to create separate accounts for each application they use, making it easier and more convenient to use multiple applications.
  • Control: OAuth gives users control over which applications have access to their data, and allows them to revoke access at any time.
  • Standardization: OAuth is an open standard, which means that it is widely used and supported across many different platforms and applications.
  • Better user experience: With OAuth, users can easily authorize third-party applications to access their data without having to manually enter their credentials each time.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

4 cons of using OAuth

A
  • Complexity: Implementing OAuth can be complex, especially for developers who are new to the protocol.
  • Security concerns: OAuth is susceptible to certain security vulnerabilities, such as session fixation attacks and cross-site request forgery (CSRF) attacks.
  • User trust: Some users may be reluctant to grant access to their data to third-party applications, even if they are using OAuth.
  • Limited functionality: OAuth may not be suitable for all applications, as it is primarily designed for authorizing access to user data rather than providing full API access.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

use cases of JWT

A
  • Single sign-on (SSO)
  • API authentication
  • User authentication and authorization
  • Identity verification and sharing
  • Mobile app authentication
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

5 use cases of OAuth

A
  • Social media login:
  • API authorization:
  • Single sign-on (SSO)
  • Mobile app authorization
  • Internet of Things (IoT) authorization
18
Q

What is a http only cookie ?

A

A HttpOnly Cookie is a tag added to a browser cookie that prevents client-side scripts from accessing data in that cookie.

19
Q

What disadvantages would one face while using http only cookie ?

A

The problem with secure cookies is that they can be cracked with enough time. For this reason they are never considered good for high security.

20
Q

Name 4 types of authentication methods

A

basic authentication, digest authentication, OAuth, and OpenID Connect.

21
Q

Basic Auth vs Digest Auth

A

Basic authentication involves sending user credentials in plain text, while digest authentication uses a hashed message to authenticate users.

22
Q

How do OAuth and OpenID connect work ?

A

OAuth and OpenID Connect use tokens to grant access to third-party applications or services.

23
Q

What is CORS ?

A

Cross-origin resource sharing (CORS) is a browser mechanism which enables controlled access to resources located outside of a given domain.

24
Q

Enlist the shortcomings in regards to CORS

A
  • Complex setup: Setting up and configuring CORS can be a complex and time-consuming process, particularly for larger applications with multiple domains or subdomains.
  • Vulnerable to attacks: CORS can be vulnerable to certain types of attacks, such as cross-site request forgery (CSRF) attacks, where an attacker can trick a user into executing malicious requests on behalf of the user.
  • Limited browser support: While most modern web browsers support CORS, some older browsers or mobile devices may not support it or may have limited support.
  • Limited control: CORS provides limited control over the requests that can be made from a web page to a remote server. This can be a problem for applications that need fine-grained control over the requests made, such as applications that rely on complex caching or authentication schemes.
  • Debugging issues: Debugging CORS-related issues can be difficult, as errors are often reported in the browser console without providing clear guidance on how to resolve the issue.
  • Additional network traffic: CORS can introduce additional network traffic, as preflight requests are sent to the server to determine whether the actual request is allowed.
25
Q

What is CSP ?

A

In the context of software security, CSP stands for “Content Security Policy”. It is a mechanism that allows website owners to control which resources can be loaded by their web pages.

26
Q

How does CSP work ?

A
  • CSP works by allowing website owners to define a policy that specifies which types of content can be loaded by their web pages.
  • This policy is communicated to the browser using an HTTP header, and the browser enforces the policy by blocking any content that violates it.
27
Q

What kind of attacks can CSP prevent ?

A

CSP is designed to mitigate the risk of various types of attacks, such as cross-site scripting (XSS) and code injection.

28
Q

What are the repurcussions of not properly setting up CSP ?

A

it requires careful configuration and testing to ensure that it does not inadvertently block legitimate content or create other security issues.

29
Q

How can you implement CSP ?

A

With CSP, you can limit which data sources are allowed by a web application, by defining the appropriate CSP directive in the HTTP response header.

30
Q

What is CSRF ?

A

Cross-Site Request Forgery (CSRF) is an attack that forces an end user to execute unwanted actions on a web application in which they’re currently authenticated.

31
Q

How does CSRF work ?

A

With a little help of social engineering (such as sending a link via email or chat), an attacker may trick the users of a web application into executing actions of the attacker’s choosing.

32
Q

What happens if the CSRF victim is a normal user ?

A

If the victim is a normal user, a successful CSRF attack can force the user to perform state changing requests like transferring funds, changing their email address, and so forth.

33
Q

What happens if the CSRF victim is an admin user ?

A

If the victim is an administrative account, CSRF can compromise the entire web application.

34
Q

How can you prevent CSRF attacks ?

A

To prevent CSRF attacks,
- you can use CSRF tokens that are generated on the server and included in the form. These tokens ensure that the request comes from a trusted source and not from an attacker’s website.
- Other mitigation techniques include SameSite cookies, Referrer Policy headers, and verifying the origin of the request.

35
Q

What is MITM ?

A

A man-in-the-middle (MiTM) attack is a type of cyber attack in which the attacker secretly intercepts and relays messages between two parties who believe they are communicating directly with each other.

36
Q

How does MITM work ?

A

In a Man-in-the-Middle (MitM) attack,
- an attacker intercepts communication between two parties to eavesdrop, manipulate or inject malicious code.
- The attacker may also impersonate one of the parties to steal data or credentials.This is usually achieved by compromising a router, DNS server or by phishing.
- Once the attacker has access to the communication, they can manipulate it without the users knowing.

37
Q

Enlist 5 ways via which you can prevent MITM attacks

A

Here are a few ways to prevent MITM attacks:

  • Use secure communication protocols like TLS/SSL.
  • Deploy mutual authentication and secure key exchange mechanisms.
  • Implement strong access control mechanisms to limit an attacker’s ability to infiltrate thenetwork.
  • Use encryption to protect sensitive data from interception.
  • Regularly monitor network traffic for suspicious activity.
38
Q

Name 4 types of MITM attacks

A

IP spoofing, DNS spoofing, SSL hijacking, and session hijacking.

39
Q

What is OWASP top 10 ?

A

The OWASP Top 10 is a standard awareness document for developers and web application security. It represents a broad consensus about the most critical security risks to web applications.

40
Q

Enlist OWASP top 10

A

Here are the top 10 security risks:

  • Injection: Occurs when untrusted data is sent to an interpreter as part of a command or query, which allows the attacker to execute malicious code or access sensitive data.
  • Broken Authentication and Session Management: When the authentication and session management mechanisms are improperly implemented, attackers can compromise user credentials and impersonate users.
  • Cross-Site Scripting (XSS): Attackers inject malicious code into a web page that is viewed by other users. This allows the attacker to steal user data, modify content, or execute arbitrary code.
  • Broken Access Control: When the application does not properly enforce access controls, attackers can access sensitive data and functionality.
  • Security Misconfiguration: When security controls are not properly configured, attackers can exploit these vulnerabilities.
  • Insecure Cryptographic Storage: When sensitive data is not properly encrypted, attackers can easily access and steal it.
  • Insufficient Transport Layer Protection: When web traffic is not encrypted, attackers can intercept the data and steal sensitive information.
  • Insecure Communications: When communication channels are not properly secured, attackers can exploit vulnerabilities and steal sensitive data.
  • Improper Error Handling: Improper error handling allows attackers to obtain sensitive information, such as database schema, server software, or user passwords.
  • Insecure APIs: APIs that are not properly secured can be exploited by attackers to gain unauthorized access to systems or data.
41
Q

Enlist 10 web security best practices

A
  • Use strong authentication mechanisms, such as multi-factor authentication, to prevent unauthorized access to sensitive data.
  • Regularly apply software patches and updates to fix known security vulnerabilities and improve overall system security.
  • Use secure communication protocols, such as HTTPS, to encrypt data in transit and prevent man-in-the-middle attacks.
  • Implement access controls and least privilege principles to ensure that only authorized users have access to sensitive data and resources.
  • Regularly perform security audits and penetration testing to identify and remediate potential security weaknesses.
  • Use a web application firewall to protect against known attacks and to monitor traffic for suspicious behavior.
  • Follow secure coding practices, such as input validation and output encoding, to prevent common web application vulnerabilities like cross-site scripting and SQL injection.
  • Implement strong password policies and encourage users to use unique and complex passwords to prevent credential stuffing attacks.
  • Regularly backup critical data to protect against data loss and implement a disaster recovery plan to quickly restore services in case of an attack or outage.
  • Provide security awareness training to all employees to ensure that they understand the importance of security and their role in protecting sensitive data and systems.
42
Q

How does OAuth provide more control to it’s users ?

A