GO KALI FREE
IntermediateWeb Security

What Is XSS? Cross-Site Scripting Examples & How to Prevent XSS Attacks

Learn what XSS is, its types, and how to prevent XSS with a worked DVWA example, context-aware defenses, testing tips, and a cheat sheet.

#what is xss#how to prevent xss#xss attack#xss types#stored xss#reflected xss#dom xss#cross-site scripting

When a Website Turns Against Its Visitors

A forum comment, search field, profile, or support ticket becomes dangerous when an application treats user-controlled data as executable markup. In an authorized lab, <script>alert(1)</script> is a harmless proof that the browser interpreted data as code. In a real XSS attack, the script runs within the vulnerable site's origin and can interact with accessible page content, browser storage, and authenticated application functions.

Impact of XSS

XSS can enable session abuse, credential phishing, keystroke capture, unauthorized account actions, data exposure, redirects, defacement, or malware delivery. Stored XSS may affect every user who opens a compromised page. HttpOnly cookies can prevent direct cookie reads, but injected code may still submit authenticated requests or steal data displayed in the page.

All payloads in this guide use alert(1) and are intended only for isolated labs or applications you are authorized to test.

What Is XSS?

Cross-site scripting (XSS) is a web vulnerability in which untrusted data becomes executable browser content on a trusted site. The browser then runs that content in the site's origin, allowing it to read accessible page data, alter the interface, or make authenticated requests as the victim.

The weakness normally appears at a boundary where data becomes HTML, an attribute, JavaScript, CSS, or a URL. It is called "cross-site" for historical reasons, but an exploit does not need to involve two websites. In the OWASP Top 10 2021, XSS is included under A03: Injection rather than listed as the standalone A7 category used in 2017.

Why XSS Still Matters in 2027

XSS is one of the oldest web vulnerabilities, yet it still shows up in real applications every year. Modern frameworks escape output by default, but applications still combine user data with HTML in custom components, server-rendered pages, markdown renderers, admin dashboards, and single-page applications that read data from the URL or browser storage. Every one of those paths is a potential sink. Bug bounty programs still pay for stored XSS because a single saved payload can reach every user who opens the affected page, including administrators. The fix has not changed in years — encode output for its context — but the number of places where a developer must apply it keeps growing as applications add more ways to render user data.

XSS Attack Vectors

Common Injection Points

Potential entry points include:

  • Search parameters, form fields, comments, usernames, and profile data
  • HTTP headers displayed in analytics, logs, or administration panels
  • File names, image metadata, support tickets, and imported records
  • JSON or API values later rendered as HTML
  • WYSIWYG editors and other rich-content features
  • URL queries, fragments, postMessage data, and browser storage
  • For DOM-based XSS, trace data from a source such as location.hash to a dangerous sink such as innerHTML, outerHTML, insertAdjacentHTML, document.write, or eval.

    const value = decodeURIComponent(location.hash.slice(1));
    document.querySelector('#greeting').innerHTML = value;
    

    The safer version treats the value as text:

    const value = decodeURIComponent(location.hash.slice(1));
    document.querySelector('#greeting').textContent = value;
    

    A value being stored or reflected does not automatically make it executable. Exploitation depends on the final rendering context and how the browser parses it.

    How to Prevent XSS Attacks

    The central rule for how to prevent XSS is to keep untrusted data separate from executable code. Apply the following OWASP-style prevention rules at the final output location.

  • Never insert untrusted data except in allowed locations. Avoid placing it in tag names, attribute names, HTML comments, event handlers, raw script blocks, or other executable contexts. Prefer safe APIs such as textContent.
  • HTML-encode data in HTML text. Convert characters such as &, <, >, ", and ' into entities before rendering plain text between tags. Template auto-escaping normally handles this when it remains enabled.
  • Attribute-encode data in quoted HTML attributes. Use a dedicated attribute encoder and always quote the attribute. Do not place untrusted data in event attributes such as onclick or in attributes whose values become executable.
  • JavaScript-encode data in JavaScript contexts. Avoid generating JavaScript from user input. If a value must enter a quoted data string, use a JavaScript encoder or a trusted JSON serializer. Never concatenate it into executable expressions.
  • CSS-encode data in CSS contexts. Prefer fixed classes and allowlisted style choices. If dynamic CSS is unavoidable, use a CSS encoder and tightly constrain expected values. HTML encoding is not sufficient for a CSS parser.
  • URL-encode URL components. Validate the protocol and destination first, then encode individual query or path components. URL encoding does not make a javascript: URL safe. If the completed URL enters an HTML attribute, attribute-encode it as well.
  • Sanitize rich HTML. When users are intentionally allowed to submit formatting, use an allowlist sanitizer such as DOMPurify, OWASP Java HTML Sanitizer, or Bleach in existing Python systems while accounting for Bleach's deprecation status. Keep the sanitizer updated and do not append untrusted markup after sanitization.
  • Supporting Layers

  • Validate types, lengths, ranges, and business formats on the server, but never treat validation as a replacement for output encoding.
  • Preserve framework auto-escaping and review every raw-HTML escape hatch.
  • Mark session cookies HttpOnly, Secure, and with an appropriate SameSite value.
  • Use CSP, Trusted Types, code review, dependency updates, and regression tests as additional controls.
  • Treat a WAF as temporary risk reduction and monitoring, not as the primary fix.
  • Teach users to report suspicious links and messages, and use phishing detection where appropriate. User caution cannot repair vulnerable rendering code.
  • Worked Example: Finding and Fixing Reflected and Stored XSS on a DVWA Lab

    Use only an isolated, locally hosted DVWA installation that you own. Set DVWA Security to Low, understanding that this mode deliberately removes defenses. Every input, response, and result below is illustrative; labels can differ between DVWA releases.

    Reflected XSS

    Open XSS (Reflected) and submit this in its search-style name field.

    Illustrative reflected input:

    <script>alert(1)</script>
    

    If an alert appears immediately after submission, the input reached an executable HTML context. A vulnerable implementation may resemble the following.

    Illustrative vulnerable server pattern:

    echo '<p>Results for: ' . ($_GET['name'] ?? '') . '</p>';
    

    Illustrative vulnerable response:

    <p>Results for: <script>alert(1)</script></p>
    

    The response embeds the value as markup, so the browser creates and executes a script element.

    Stored XSS

    Open XSS (Stored), enter a harmless name, and place <script>alert(1)</script> in the comment or message field.

    Illustrative expected result: the record is saved, and the alert appears whenever an affected user opens the comments page. Retesting with a separate authorized browser profile demonstrates that execution is tied to the stored record rather than only to the submitting request.

    Fixing Both Flaws

    Encode plain-text values when they are rendered, including values retrieved from the database. Add a restrictive CSP as a backup for a missed sink.

    Illustrative fixed PHP excerpt:

    <?php
    $nonce = base64_encode(random_bytes(16));
    
    header(
        "Content-Security-Policy: default-src 'self'; script-src 'nonce-" .
        $nonce .
        "' 'strict-dynamic'; object-src 'none'; base-uri 'none'"
    );
    
    function h(string $value): string {
        return htmlspecialchars(
            $value,
            ENT_QUOTES | ENT_SUBSTITUTE,
            'UTF-8'
        );
    }
    
    $name = $_GET['name'] ?? '';
    echo '<p>Results for: ' . h(is_string($name) ? $name : '') . '</p>';
    
    echo '<p>' . nl2br(h($commentFromDatabase)) . '</p>';
    ?>
    <script nonce="<?= h($nonce) ?>" src="/assets/app.js"></script>
    

    $commentFromDatabase represents the value read from storage. Calling htmlspecialchars when rendering converts markup-significant characters into entities. Applying nl2br afterward preserves line breaks without making the original comment executable.

    Illustrative post-fix result: the page displays <script>alert(1)</script> as text, and no alert opens. The CSP also blocks unauthorized inline script execution, but it does not replace the encoding fix. Use a different encoder if the same value is later rendered in an attribute, URL, CSS, or JavaScript context.

    The Three Types of XSS, Compared

    TypeDeliveryPersistenceWhere the Fix Lives
    Reflected XSSInput is included in the immediate server response, often through a crafted query or form requestNormally limited to that requestServer template, response builder, and the final output context
    Stored XSSInput is saved in a database, comment, profile, ticket, or log and rendered laterPersists until removed or changedEvery view that renders the stored value, plus safe rich-content sanitization where required
    DOM-based XSSClient-side code moves attacker-controlled data from a browser source into an unsafe sinkDepends on the source; it can be transient or storedClient-side data flow and DOM API usage

    These labels describe different dimensions. A stored value can eventually trigger through a DOM sink, while a reflected response can contain client-side code that performs the unsafe rendering.

    Blind XSS is usually stored XSS that executes in a different interface, such as an administration or support dashboard. The submitter cannot directly see the result. Test this only with explicit permission and a controlled lab or authorized reviewer session.

    Context-Aware Output Encoding

    Choose an encoder for the parser that will receive the value.

    Render ContextPreferred Defense
    HTML text between tagsFramework auto-escaping, HTML encoding, or textContent
    Quoted HTML attributeAttribute encoder, fixed attribute name, and quotes
    JavaScript dataAvoid inline generation; otherwise use trusted JSON serialization or a JavaScript encoder
    CSS valueAvoid dynamic CSS or use a CSS encoder with strict value allowlists
    URL componentValidate the scheme and destination, then encode the individual component
    Rich HTMLSanitize with a maintained allowlist sanitizer

    The following examples encode a value for HTML text, not every possible context.

    Python

    import html
    
    safe = html.escape(user_input, quote=True)
    

    PHP

    $safe = htmlspecialchars(
        $userInput,
        ENT_QUOTES | ENT_SUBSTITUTE,
        'UTF-8'
    );
    

    Node.js

    const he = require('he');
    
    const safe = he.encode(userInput);
    

    Java

    import org.owasp.encoder.Encode;
    
    String safe = Encode.forHtml(userInput);
    

    The OWASP Java Encoder also provides context-specific methods such as forHtmlAttribute, forJavaScriptBlock, and forCssString.

    Why the Wrong Encoding Fails

    Each browser parser assigns different meaning to quotes, backslashes, percent signs, and entity references. HTML encoding a value inside JavaScript may still produce valid executable JavaScript after HTML parsing. URL encoding does not reject a dangerous protocol, and JavaScript escaping does not make a value safe as HTML. Encode once, at the final sink, for the exact context.

    For intentionally permitted HTML, sanitize before insertion:

    container.innerHTML = DOMPurify.sanitize(untrustedHtml);
    

    Do not modify or concatenate untrusted markup after sanitization.

    Content Security Policy That Actually Stops XSS

    A nonce-based CSP authorizes specific script elements rather than every script from a broad host allowlist.

    Content-Security-Policy: default-src 'self'; script-src 'nonce-BASE64_NONCE' 'strict-dynamic'; object-src 'none'; base-uri 'none'; require-trusted-types-for 'script'; trusted-types app
    

    The server must generate a cryptographically unpredictable nonce for every response and place the same value on each approved script:

    <script nonce="BASE64_NONCE" src="/assets/app.js"></script>
    

    Never use the placeholder or a static nonce in production. In supporting browsers, 'strict-dynamic' allows a nonce-authorized root script to load its trusted dependencies. object-src 'none' disables plugin content, while base-uri 'none' prevents an injected base element from changing relative URL resolution.

    Trusted Types, where supported, can require approved policies before values reach sinks such as innerHTML. A policy must sanitize or safely construct content; a pass-through policy defeats the purpose.

    Test a policy with Content-Security-Policy-Report-Only before enforcement, review violations, and remove unnecessary inline code. CSP is defense in depth, not a substitute for output encoding or HTML sanitization.

    Framework Protections: React, Angular, Vue

    FrameworkSafe DefaultDangerous HolesSafer Approach
    ReactValues rendered through JSX expressions are escapeddangerouslySetInnerHTML, direct innerHTML, and unsafe third-party DOM codeRender normal JSX text or assign textContent; sanitize genuinely required HTML
    AngularInterpolation escapes values, and Angular sanitizes several property bindingsNative innerHTML, unsafe [innerHTML] use, and bypassSecurityTrustHtml or related trust bypassesPrefer interpolation or [textContent]; narrowly review every trusted-value bypass
    VueMustache expressions and normal bindings are escapedv-html, direct DOM manipulation, and compiling untrusted templatesUse mustache syntax or v-text; sanitize approved rich HTML before v-html

    Framework protection applies only while data stays inside safe rendering paths. Server-rendered bootstrap HTML, plugins, markdown renderers, and custom directives require separate review. Never compile user input as a component or template.

    Testing for XSS

    Manual Workflow

  • Confirm written authorization and identify allowed hosts, accounts, and request rates.
  • Map every input and use a unique text marker to learn where it is reflected or stored.
  • Inspect both the raw response and the live DOM to determine the rendering context.
  • In an isolated lab, use the smallest matching proof, such as <script>alert(1)</script> or <img src=x onerror=alert(1)>.
  • Check the browser console for CSP, syntax, sandbox, and Trusted Types messages.
  • For stored data, revisit the affected view with another authorized role or browser profile.
  • After fixing the sink, repeat the exact request and add a regression test.
  • An alert proves browser code execution, but reflection alone does not. Conversely, CSP may block execution while an underlying injection flaw still exists.

    Automated Tools

    ToolAppropriate Use
    Burp SuiteUse Proxy and Repeater for manual context analysis. Burp Scanner in Professional can actively test authorized targets.
    XSStrikeAnalyzes reflected parameters and their contexts and generates focused XSS tests.
    OWASP ZAPCrawls applications, passively reports issues, and can actively scan an authorized test environment.
    WapitiPerforms black-box crawling and module-based vulnerability testing, including XSS checks.

    Read the evidence rather than accepting a tool label. Reproduce the exact request, locate the reflection, inspect its context, and confirm whether controlled execution is possible. Scanner output that only finds an encoded reflection is commonly a false positive.

    XSS vs CSRF vs SQL Injection

    IssueWhat Is Injected or ForgedWhere It RunsPrimary Fix
    XSSBrowser-executable markup or script contentVictim's browser in the vulnerable originContext-aware encoding, sanitization, safe DOM APIs, and CSP
    CSRFA forged state-changing request; code injection is not requiredRequest is sent by the victim's browser and processed by the serverCSRF tokens, SameSite cookies, Origin checks, and reauthentication
    SQL injectionSQL syntax mixed into a database queryDatabase serverParameterized queries, safe ORM APIs, and least privilege

    A CSRF token does not fix XSS, and prepared SQL statements do not protect an HTML sink. XSS may also expose or use CSRF tokens available to the compromised page, making XSS prevention essential.

    XSS Cheat Sheet

    Use these proofs only in your own lab or an explicitly authorized test environment.

    Laboratory Payloads

    Context Being TestedProof-of-Concept
    HTML element content<script>alert(1)</script>
    HTML parser and event handler<img src=x onerror=alert(1)>
    SVG event handling<svg onload=alert(1)>
    Quoted attribute breakout"><img src=x onerror=alert(1)>
    Link URL requiring a click<a href="javascript:alert(1)">test</a>
    Data embedded inside a script element</script><script>alert(1)</script>

    These are diagnostic probes, not universal payloads. A result depends on the exact parser context, browser controls, and application transformations.

    Prevention Quick Reference

    SituationUse
    Displaying a username or comment as textAuto-escaping or HTML encoding
    Updating page text in JavaScripttextContent
    Building a query parameterURL API or component encoding, followed by attribute encoding if rendered
    Allowing formatted commentsMaintained allowlist sanitizer
    Creating scripts dynamicallyAvoid user-controlled code; use nonce-based CSP
    Protecting session cookiesHttpOnly, Secure, and appropriate SameSite settings
    Returning JSONContent-Type: application/json and X-Content-Type-Options: nosniff

    Troubleshooting XSS Problems

    ProblemWhat to Check
    Payload shows as textEncoding may be working correctly. Inspect the response and DOM before trying anything else.
    Alert never firesConfirm the payload matches the context, its event can occur, and CSP, Trusted Types, or a sandbox is not blocking it.
    CSP blocks your own scriptEnsure the server generated a fresh nonce and that the exact same nonce appears in the header and approved script element.
    Stored payload is not triggeringVerify the record was saved, approved, and displayed in the view used by the intended authorized role.
    WAF blocks the testDo not evade it on a production system. Coordinate an allowlisted scanner address or reproduce the issue in staging.
    Encoding bypass remains possibleLook for the wrong encoder, multiple decoding steps, mutation after encoding, or a different final render context.
    DOM sink is not foundSearch scripts for dangerous DOM APIs and use DevTools DOM breakpoints or debugger tracing to follow the value.
    Scanner reports a false positiveReproduce the request and distinguish harmless reflection from markup creation or executable browser behavior.

    Common Mistakes

  • Relying on a denylist. Blocking the word script misses other elements, attributes, encodings, and DOM-based paths.
  • Using one encoder everywhere. HTML, attributes, URLs, JavaScript, and CSS have different parsing rules.
  • Encoding input before storage. Early encoding can cause double encoding and remains wrong when the value is reused in another context.
  • Changing sanitized HTML afterward. DOM mutations or string concatenation can invalidate the sanitizer's result.
  • Assuming a framework makes every API safe. Raw-HTML features and third-party components bypass normal escaping.
  • Deploying a weak CSP. Static nonces, broad wildcards, and unnecessary 'unsafe-inline' permissions undermine enforcement.
  • Treating cookies, a WAF, or a clean scanner result as a complete fix. These controls reduce selected risks but do not make an unsafe sink safe.
  • Best Practices

  • Inventory untrusted sources, transformations, storage locations, and final browser sinks.
  • Prefer safe APIs and apply context-specific encoding at the last possible rendering boundary.
  • Sanitize only when rich HTML is a genuine product requirement, and keep the sanitizer updated.
  • Deploy nonce-based CSP, Trusted Types where supported, and hardened session cookie settings.
  • Validate business formats, preserve framework auto-escaping, and serve APIs with correct MIME types.
  • Combine code review, automated tests, manual testing, dependency maintenance, monitoring, and user reporting channels.
  • Defense Checklist

  • [ ] Encode every untrusted value for its final context
  • [ ] Sanitize intentionally allowed rich HTML
  • [ ] Preserve framework auto-escaping
  • [ ] Avoid eval, document.write, and unnecessary innerHTML
  • [ ] Deploy and monitor a nonce-based CSP
  • [ ] Set HttpOnly, Secure, and appropriate SameSite cookie flags
  • [ ] Validate server-side types, formats, ranges, and lengths
  • [ ] Review DOM sources, sinks, and third-party components
  • [ ] Test reflected, stored, blind, and DOM-based paths
  • [ ] Add regression tests and perform regular security reviews
  • Is XSS Testing Legal?

    Test only applications you own or systems for which you have explicit written permission. Authorization should identify the domains, accounts, techniques, schedule, and data-handling rules. A public website or bug bounty listing is not blanket permission beyond its published scope.

    Do not test random websites, send crafted links to other users, or attempt to bypass production defenses without authorization. DVWA and other intentionally vulnerable local labs are safer places to practice.

    Knowledge Check

  • Why must output encoding be selected according to the final rendering context?
  • What two checks are required before placing user-controlled data in a URL?
  • Which XSS type normally persists in a database, comment, profile, or support ticket?
  • Why must a CSP nonce be unpredictable and generated separately for each response?
  • Which React feature bypasses normal JSX escaping and requires special review?
  • What does an HttpOnly cookie prevent, and what XSS risks remain?
  • Why is a reflected value not automatically proof of an exploitable XSS vulnerability?
  • When is it legal to run XSS tests against an application?
  • Answers: 1. Each HTML, attribute, JavaScript, CSS, and URL parser interprets characters differently, so the wrong encoder can leave executable syntax. 2. Validate the protocol and destination, then encode the individual URL component and attribute-encode the completed URL if it enters HTML. 3. Stored XSS. 4. A reused or predictable nonce could authorize injected script elements instead of only scripts approved for that response. 5. dangerouslySetInnerHTML. 6. HttpOnly prevents JavaScript from reading the cookie directly, but XSS can still read page data, alter the interface, or submit authenticated requests. 7. The value must reach an executable browser context; an encoded or text-only reflection may be harmless. 8. Only when you own the application or have explicit authorization covering the target and testing activity.

    Keep Learning

  • CSRF Explained
  • SQL Injection Basics
  • OWASP Top 10 Explained
  • Web Security Fundamentals
  • SSRF Explained
  • Burp Suite
  • OWASP ZAP
  • XSSer
  • Wapiti
  • Summary

    XSS turns a trusted website into a delivery mechanism for attacker-controlled code, and the browser cannot tell the attacker's script from the site's own. The three types — reflected, stored, and DOM-based — differ in delivery and persistence, but they share one root cause: untrusted data rendered as executable content. Prevent it by encoding output for its exact context, sanitizing only genuinely required rich HTML, letting frameworks escape by default, and adding a nonce-based CSP as defense in depth. Test every input in an authorized lab, fix the sink rather than the symptom, and retest after every change.

    Frequently Asked Questions

    What is Cross-Site Scripting (XSS)?

    XSS is a vulnerability where attackers inject malicious JavaScript into web pages viewed by other users. The script executes in the victim's browser with the same privileges as the legitimate site, enabling session hijacking, data theft, and account compromise.

    What are the three types of XSS attacks?

    Reflected XSS returns the script in the immediate response (e.g., search pages). Stored XSS permanently saves the script on the server (e.g., comments, forums). DOM-based XSS manipulates the client-side JavaScript environment without server interaction.

    How do I prevent XSS in my web applications?

    Use context-aware output encoding for all user data, implement Content Security Policy (CSP) headers, leverage framework built-in protections (React, Angular), and set HttpOnly flags on cookies. Never rely solely on input validation.

    What is a Content Security Policy and how does it prevent XSS?

    CSP is an HTTP header that restricts which scripts can execute on your page. By whitelisting trusted script sources and blocking inline scripts, CSP makes XSS exploitation significantly harder. A basic policy like script-src 'self' only allows scripts from your own domain.

    Is XSS still relevant in modern web frameworks?

    Yes. While frameworks like React and Angular provide automatic escaping, developers can bypass these protections using methods like innerHTML, v-html, and dangerouslySetInnerHTML. DOM-based XSS remains common even in modern single-page applications.

    What is the impact of a successful XSS attack?

    Attackers can steal session cookies to impersonate users, capture keystrokes including passwords, redirect users to phishing pages, deface websites, perform actions on behalf of the victim, and distribute malware. Stored XSS affects every user who views the compromised page.

    How do I test for XSS vulnerabilities?

    Submit test payloads like <script>alert(1)</script> and <img src=x onerror=alert(1)> into input fields, then check if they appear unescaped in the page source. Use automated scanners like Burp Suite or OWASP ZAP for comprehensive testing across different contexts.

    What is DOM-based XSS and how is it different?

    DOM-based XSS occurs entirely in client-side JavaScript when the page reads attacker-controlled data (like URL fragments) and writes it into the DOM unsafely. Unlike reflected or stored XSS, the payload never reaches the server, making server-side filtering ineffective.

    Can HttpOnly cookies completely prevent XSS damage?

    HttpOnly cookies prevent JavaScript from accessing session tokens via document.cookie, which blocks session theft through XSS. However, XSS can still perform actions within the authenticated session, steal page content, or redirect users. Use HttpOnly as one layer alongside CSP and output encoding.

    What XSS prevention method works for JSON APIs?

    Set the Content-Type: application/json header on API responses and use application/json for requests. The browser will not render JSON as HTML. Also use context-aware encoding, validate input types, and implement CSP on pages that consume the API data.

    How do I prevent XSS attacks in React?

    Render untrusted values through normal JSX expressions, which React escapes by default. Avoid dangerouslySetInnerHTML and direct innerHTML assignments. If approved rich HTML is required, sanitize it with a maintained library such as DOMPurify and add a restrictive CSP as defense in depth.

    Stored XSS vs reflected XSS — which is worse?

    Stored XSS often has a broader impact because one saved payload can reach many users without each victim opening a specially crafted link. Reflected XSS can still be severe when it targets privileged users or convincing workflows. Actual severity depends on reach, execution context, and available application functions.

    XSS vs CSRF — what is the difference?

    XSS makes attacker-controlled content execute in a trusted page, while CSRF tricks a victim's browser into sending an unwanted authenticated request. Prevent XSS with context-aware encoding and sanitization. Prevent CSRF with anti-CSRF tokens, SameSite cookies, Origin checks, and reauthentication for sensitive actions.

    Can XSS steal my password?

    Yes. Code running in a compromised page may capture keystrokes, read accessible form fields, or display a convincing fake login form. HttpOnly protects cookies from direct JavaScript access but does not protect passwords entered into the page. Fix the unsafe rendering path and use CSP as an additional control.

    Is it legal to test for XSS?

    It is legal when you test your own application or have explicit authorization from its owner. Written permission should define the targets, methods, schedule, and data rules. Do not test unrelated websites or exceed a bug bounty program's published scope. Practice in isolated labs such as DVWA.

    Continue Learning

    Web Security · Intermediate

    What Is CSRF? Cross-Site Request Forgery Examples & How to Prevent CSRF Attacks

    What is CSRF? Learn how cross-site request forgery tricks your browser into unwanted actions, see real examples and a DVWA worked test, and follow 7 steps to prevent CSRF attacks with tokens, SameSite cookies and framework protection.

    Web Security · Intermediate

    What Is SQL Injection? Types, Examples & How to Prevent SQL Injection Attacks

    What is SQL injection? See real SQL injection examples, a worked DVWA lab test, and how to prevent SQL injection with parameterized queries.

    Web Security · Intermediate

    API Hacking Guide: How to Test APIs for Security Flaws (BOLA, JWT & GraphQL)

    Learn API hacking step by step: discover endpoints, test authentication and authorization, find BOLA flaws with a worked crAPI example, test JWTs and GraphQL, and report findings — with tools, a cheat sheet and a checklist.

    Web Security · Intermediate

    What Is IDOR? Insecure Direct Object Reference Examples & How to Prevent IDOR Attacks

    What is IDOR? See real insecure direct object reference examples, a worked lab test with Burp Suite, and how to prevent IDOR with server-side checks.

    Related Security Tools

    Web Application

    XSStrike

    XSStrike is an advanced Cross-Site Scripting (XSS) detection suite. It features intelligent payload generation, context analysis, a powerful fuzzing engine, and built-in WAF detection and bypass capabilities.

    Web Application

    XSSer

    XSSer (Cross Site Scripting Exploiter) is an automatic framework to detect, exploit, and report XSS vulnerabilities in web applications. It contains features to bypass several filters and various options for automated payload generation.

    Web Security

    Security Headers Checker

    Check HTTP security headers (CSP, HSTS, X-Frame-Options, X-XSS-Protection, Referrer-Policy, and more) with security scoring.

    Written by GO KALI FREE Team