Security Flashcards
(42 cards)
Full form of JWT
JSON web tokens
What is a JWT ?
an open standard used to share security information between two parties — a client and a server.
What do JWTs contain ?
Each JWT contains encoded JSON objects, including a set of claims.
How does JWTs make sure their set of claims are not altered ?
JWTs are signed using a cryptographic algorithm to ensure that the claims cannot be altered after the token is issued.
What is a disadvantage of using a JWT ?
it relies on only one key
What are the repurcussions of JWT relying on only one key
JWT uses only one key, which if handled poorly by a developer/administrator, would lead to severe consequences that can compromise sensitive information.
What is an OAuth ?
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.
OAuth Full form ?
Open Authorization
What security protocol can you use to bypass the need for 3rd party applications to store user credentials ?
use OAuth
What kind of convenience does OAuth provide ?
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 does OAuth provide more control to it’s users ?
OAuth gives users control over which applications have access to their data, and allows them to revoke access at any time.
How does OAuth provide a 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.
What is the advantage of OAuth being an “open-standard” ?
widely used and supported by many applications and browsers
5 advantages of using OAuth
- 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.
4 cons of using OAuth
- 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.
use cases of JWT
- Single sign-on (SSO)
- API authentication
- User authentication and authorization
- Identity verification and sharing
- Mobile app authentication
5 use cases of OAuth
- Social media login:
- API authorization:
- Single sign-on (SSO)
- Mobile app authorization
- Internet of Things (IoT) authorization
What is a http only cookie ?
A HttpOnly Cookie is a tag added to a browser cookie that prevents client-side scripts from accessing data in that cookie.
What disadvantages would one face while using http only cookie ?
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.
Name 4 types of authentication methods
basic authentication, digest authentication, OAuth, and OpenID Connect.
Basic Auth vs Digest Auth
Basic authentication involves sending user credentials in plain text, while digest authentication uses a hashed message to authenticate users.
How do OAuth and OpenID connect work ?
OAuth and OpenID Connect use tokens to grant access to third-party applications or services.
What is CORS ?
Cross-origin resource sharing (CORS) is a browser mechanism which enables controlled access to resources located outside of a given domain.
Enlist the shortcomings in regards to CORS
- 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.