1. Home
  2. Explore
  3. Computer Science
  4. Web Application Security Basics

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Web Application Security Basics

  • 39Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Web Application Building Blocks
  • spaceFlip card
  • KI knew it
  • DI didn't know it
  • ←Previous card
  • →Next card

What are the three fundamental building blocks of web applications?

Tap to flipClick to flipspace

HTML, CSS, and JavaScript.

Or swipe the card

39 cards

  1. What are the three fundamental building blocks of web applications?

    HTML, CSS, and JavaScript.

  2. What is a User Agent in the context of the web? Give examples.

    A User Agent is any application that acts on the user's behalf, typically a browser like Firefox or Chrome.

  3. What is HTML and what are its main components?

    HTML stands for Hypertext Markup Language. Its main components are elements (tags), attributes, and string literals.

  4. What is the purpose of CSS in a web application?

    CSS defines how HTML elements are rendered, including colors, sizes, fonts, and transitions.

  5. What is the role of JavaScript in web applications?

    JavaScript adds dynamic behavior and can interact with the web page via the Document Object Model (DOM).

  6. What is the Document Object Model (DOM) and how does JavaScript use it?

    The DOM is a programming interface that allows JavaScript to interact with the HTML document. JavaScript can read, update, and modify elements via the DOM.

  7. What does HTTP stand for and what is its purpose?

    Hypertext Transfer Protocol. It is the language used for communication in the World Wide Web between user agents and web servers.

  8. Describe the structure of an HTTP GET request.

    It includes a verb (GET), the URL, the protocol version, and a set of request headers.

  9. What are HTTP request headers used for? Give two examples.

    They send additional information to the web server. Examples: User-Agent (browser info) and Referer (previous page URL).

  10. What is the Referer header and what information does it reveal?

    The Referer header tells the web server which site or origin the user came from when clicking a link.

  11. Describe the structure of an HTTP response.

    It includes the protocol version, a status code (e.g., 200 OK), response headers (e.g., Content-Type, Set-Cookie), and the response body.

  12. What does the HTTP status code 200 mean?

    200 OK means the request was successful and the server is sending the requested content.

  13. What is the Content-Type response header used for?

    It tells the browser how to interpret the response body, e.g., text/html, application/javascript, or image/png.

  14. What does it mean that HTTP is stateless?

    HTTP has no built-in memory; each request is independent. State must be maintained through mechanisms like cookies.

  15. What is the Same Origin Policy (SOP)?

    A security concept that restricts code loaded from one origin from interacting with resources from another origin.

  16. What three parts define an origin?

    The scheme (protocol), hostname, and port.

  17. Are and the same origin?

    No, they are different origins because the scheme (protocol) differs (https vs http).

  18. Are example.org and example.org:8080 the same origin?

    No, they are different origins because the port numbers differ (default 443 vs 8080).

  19. Why is the Same Origin Policy important for security?

    It prevents malicious code on one site from accessing sensitive data on another site (e.g., reading emails from Gmail in an iframe).

  20. What error occurs when trying to access a cross-origin iframe via JavaScript?

    An uncut DOM exception: 'Access denied' or 'Permission denied to access the body of this cross-origin object'.

  21. What is X-Frame-Options and how does it relate to SOP?

    An HTTP response header that prevents a page from being embedded in an iframe on another site. It is a mitigation for clickjacking.

  22. What is clickjacking and how does X-Frame-Options prevent it?

    Clickjacking tricks users into clicking something hidden behind another element (e.g., layered iframes). X-Frame-Options prevents the page from being framed, stopping the attack.

  23. What is a cookie and why is it used in web applications?

    A small piece of data stored by the browser that is sent to the same domain on subsequent requests. It is used to maintain state (e.g., authentication) because HTTP is stateless.

  24. How does a server set a cookie in the browser?

    The server includes a Set-Cookie header in the HTTP response, which instructs the browser to store the cookie for that domain.

  25. When is a cookie automatically sent by the browser to the server?

    Whenever the browser makes a request to the same domain (origin) that originally set the cookie.

  26. Why are cookies security-sensitive?

    If an attacker steals a cookie, they can impersonate the user's session (e.g., access their account).

  27. What is the HttpOnly flag on a cookie?

    It makes the cookie inaccessible to JavaScript (document.cookie). The cookie is only sent via HTTP(S) requests.

  28. What is the Secure flag on a cookie?

    It ensures the cookie is only sent over HTTPS (encrypted) connections, not over unencrypted HTTP.

  29. What is the SameSite flag on a cookie?

    It controls whether the cookie is sent in cross-site requests (e.g., when following a link from another site). Values: Strict, Lax, None.

  30. How do cookies enable sessions in stateless HTTP?

    The server sets a session ID cookie on the first request. The browser sends it on subsequent requests, allowing the server to recognize the user.

  31. What is the Strict-Transport-Security (HSTS) header?

    An HTTP response header that instructs the browser to always use HTTPS for future requests to that domain, even if the user enters HTTP.

  32. Why should all web traffic be encrypted (HTTPS) even for internal applications?

    To prevent eavesdropping, tampering, and man-in-the-middle attacks. Encryption protects data in transit.

  33. What is Let's Encrypt and why is it useful?

    A free, automated certificate authority that provides TLS certificates, making HTTPS accessible at no cost.

  34. What is the purpose of the X-Frame-Options header?

    To prevent a web page from being displayed in an iframe on another site, mitigating clickjacking attacks.

  35. What is the difference between Same Site and Same Origin?

    Same Site considers the top-level domain plus one (e.g., blog.example.com and example.com are same site). Same Origin requires exact match of scheme, hostname, and port.

  36. Name three tools used for inspecting HTTP traffic in web applications.

    Fiddler, Burp Suite (Burp), and OWASP ZAP (Zed Attack Proxy).

  37. What is Fiddler and how is it used?

    Fiddler is a free HTTP debugging proxy for Windows. It captures all HTTP/HTTPS traffic and shows request and response details in a user-friendly interface.

  38. How can you inspect HTTP traffic using browser developer tools?

    By right-clicking on the page and selecting 'Inspect Element', then going to the 'Network' tab. All HTTP requests and responses are listed.

  39. What is the purpose of using a web proxy tool like Burp or ZAP?

    To intercept, inspect, and modify HTTP requests and responses between the browser and server, enabling security testing.

Card 1 of 39
Card 1 of 39

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent