Skip to content
Tutorials Center
My learning

Topics

Lesson 17 of 31 ยท Web Application Security Concepts

Web Application Security Concepts

Learn the web security basics: how HTTP requests and sessions work, what the OWASP Top 10 covers, security headers, and how proxies like Burp and ZAP fit in.

Almost everything people use today is a web application, which makes the web the largest attack surface most organizations have. To assess or defend a web application you need to understand what really travels between browser and server. A site is not just what the page looks like: it is a conversation of requests and responses, and every part of that conversation can be read, changed or forged by the client.

This lesson covers the HTTP basics a security person needs, how sessions keep you logged in and what can go wrong, an overview of the OWASP Top 10, the security headers that harden a site, and what intercepting proxies such as Burp Suite and OWASP ZAP do. You can follow it without knowing a web framework. If HTTP is new to you, the HTML tutorial and JavaScript tutorial give the surrounding context.

Test only applications you own or have written permission to test. Web testing is the most commonly abused area of security work, and "I was only looking" is not a defense. See Law, Ethics and Authorization.

An HTTP request and response

A request has a method (GET reads, POST sends data, PUT and DELETE change things), a path, headers and optionally a body. A response has a status code (200 OK, 301 redirect, 403 forbidden, 404 not found, 500 server error), headers and a body. This is what a browser sends, shown as read-only text:

HTTP
GET /account/orders?page=2 HTTP/1.1
Host: shop.example.test
User-Agent: Mozilla/5.0
Cookie: session=7f3a9c1e
Accept: text/html

The security-relevant point is simple: everything in a request comes from the client and can be forged. The path, query string, headers, cookies, form fields and even hidden fields can be edited by anyone using a proxy or a script. A server must never trust a request just because "the form didn't have that option". That rule, "never trust client input", is behind most of the vulnerability classes below.

Sessions and cookies

HTTP itself has no memory, so applications add it. After login the server creates a session and gives the browser an identifier in a cookie. On every later request the browser sends the cookie back, and the server knows who you are. Whoever holds the session ID is you, as far as the server is concerned.

That makes session handling a high-value target, and cookie attributes are the first line of defense:

  • Secure: send only over HTTPS.
  • HttpOnly: hide the cookie from JavaScript, which limits what an injected script can steal.
  • SameSite=Lax or Strict: do not send the cookie on most cross-site requests, which blunts cross-site request forgery (CSRF).
  • A random, long, unguessable ID, a new ID after login (to prevent session fixation), a server-side expiry, and logout that really destroys the session.

The OWASP Top 10

The Open Worldwide Application Security Project (OWASP) publishes a regularly updated list of the most critical web risks, based on real data. The categories are broad families of problems, not single bugs. The names and order change between editions, but the themes are stable:

Access and identity

Broken access control Users reach data that is not theirs.
Authentication failures Weak logins and sessions.
Cryptographic failures Sensitive data not protected.
1 / 3

Broken access control is consistently at or near the top. A classic example is an insecure direct object reference: your orders are at /orders/1041, and changing the number shows someone else's order because the server only checked that you were logged in, not that order 1041 is yours. Injection is covered next in Injection and Input Validation: Defense.

Security headers

Servers can ask browsers to enforce extra protections through response headers. A security review looks for these:

  • Strict-Transport-Security (HSTS): always use HTTPS for this site.
  • Content-Security-Policy (CSP): limits where scripts, styles and frames may load from, which reduces the damage of XSS.
  • X-Content-Type-Options: nosniff: stops browsers guessing content types.
  • X-Frame-Options or CSP frame-ancestors: controls who may embed the page, preventing clickjacking.
  • Referrer-Policy: limits what URL information leaks to other sites.
  • Permissions-Policy: switches off browser features the site does not need.

Headers are defense in depth. They do not fix a vulnerable application, but they limit the blast radius when one slips through.

Proxies: Burp Suite and OWASP ZAP

An intercepting proxy sits between the browser and the server, so the tester can see every request and response, pause one, edit it and send it on. Burp Suite (commercial, with a free Community edition included in Kali) and OWASP ZAP (free and open source) are the standard tools. They typically offer:

  • an intercept view to inspect and modify traffic as it flows,
  • a history of all requests with search and filtering,
  • a repeater to resend one request with changes, which is how most manual testing proceeds,
  • spiders/crawlers and passive scanners that read traffic and report missing headers or leaking details without attacking anything,
  • active scanners that send test payloads, which must only run against authorized targets and can modify data.

Defenders use the same tools on their own staging systems, and so do developers when debugging. A proxy does not "hack" anything by itself. It makes the client side visible, which is exactly what you need to see why "the browser would never send that" is not a security control.

A stand-in: parse requests and flag missing headers

The real proxies are large desktop programs, so they cannot run on this page. The stand-in below does the part of their passive scanning that is easy to understand: it reads sample, invented HTTP responses as text and reports missing security headers and weak cookie flags. It does not connect to anything.

Python Passive header check on sample responses

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The first host passes the checks. The second misses all three headers, sets a cookie without any protective flags, and announces its exact server version, which helps attackers match it to known flaws. These are typical "low to medium" findings in a report.

What is real and what is the stand-in

HTTP, cookies, headers, the OWASP categories and the behavior of Burp and ZAP are real. The two sample responses are made up, and the Python checker mimics only the passive part of a scanner. Intercepting live traffic needs the real tools on a lab you control.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Why is it unsafe to rely on a hidden form field to enforce a price?

    Everything in a request comes from the client and can be forged, so enforcement must happen on the server.
  2. 2. What does the HttpOnly cookie flag do?

    HttpOnly prevents scripts from reading the cookie, limiting what XSS can steal. Secure and SameSite do the other two jobs.
  3. 3. A logged-in user changes /orders/1041 to /orders/1042 and sees another customer's order. Which OWASP category is this?

    The server checked who you are but not whether the order belongs to you.
  4. 4. Which tool function lets a tester resend one captured request after editing it?

    A repeater resends a single request with changes, which is the core of manual web testing.

Summary

  • A web application is a conversation of requests and responses, and everything the client sends can be forged.
  • Sessions identify users through cookies; protect them with Secure, HttpOnly, SameSite, random IDs and proper logout.
  • The OWASP Top 10 groups the most common risks: access control, authentication, cryptography, injection, design, configuration, components, integrity, logging and SSRF.
  • Security headers such as HSTS, CSP and nosniff add defense in depth.
  • Burp Suite and ZAP are intercepting proxies that make traffic visible and editable; use them only with authorization.

Next: Injection and Input Validation: Defense.