# HTML Response Fixtures for XSS Testing
# These are sample HTML responses used for testing XSS detection

# ============== Reflected XSS Fixtures ==============

## Reflected in HTML Body
<html>
<head><title>Search Results</title></head>
<body>
    <h1>Results for: TEST_PAYLOAD</h1>
    <p>No results found for "TEST_PAYLOAD"</p>
</body>
</html>

## Reflected in HTML Attribute
<html>
<body>
    <form>
        <input type="text" value="TEST_PAYLOAD" />
        <input name="query" placeholder="TEST_PAYLOAD" />
    </form>
</body>
</html>

## Reflected in JavaScript
<html>
<body>
    <script>
        var query = "TEST_PAYLOAD";
        displayResults(query);
    </script>
</body>
</html>

## Reflected in Style/CSS
<html>
<head>
    <style>
        .TEST_PAYLOAD {
            color: red;
        }
    </style>
</head>
<body></body>
</html>

# ============== Stored XSS Fixtures ==============

## Comment System
<html>
<body>
    <div class="comments">
        <div class="comment">
            <p>TEST_PAYLOAD</p>
            <small>Posted by: user1</small>
        </div>
    </div>
</body>
</html>

## User Profile
<html>
<body>
    <div class="profile">
        <h2>TEST_PAYLOAD</h2>
        <p>Bio: This is my bio</p>
    </div>
</body>
</html>

# ============== DOM XSS Fixtures ==============

## Hash-based
<html>
<body>
    <div id="output"></div>
    <script>
        var hash = location.hash;
        document.getElementById('output').innerHTML = hash;
    </script>
</body>
</html>

## URL Parameter
<html>
<body>
    <div id="message"></div>
    <script>
        var params = new URLSearchParams(location.search);
        document.getElementById('message').textContent = params.get('msg');
    </script>
</body>
</html>

## Source to Sink
<html>
<body>
    <div id="app"></div>
    <script>
        var userInput = location.hash.substring(1);
        document.getElementById('app').innerHTML = userInput;
    </script>
</body>
</html>

# ============== Filtered Responses ==============

## HTML Entity Encoded
<html>
<body>
    <p>You searched for: &lt;script&gt;alert(1)&lt;/script&gt;</p>
</body>
</html>

## URL Encoded
<html>
<body>
    <p>Query: %3Cscript%3Ealert(1)%3C/script%3E</p>
</body>
</html>

## Tag Stripped
<html>
<body>
    <p>Content: alert(1)</p>
</body>
</html>

## Lowercased
<html>
<body>
    <p>&lt;script&gt;alert(1)&lt;/script&gt;</p>
</body>
</html>

# ============== Mutation XSS Fixtures ==============

## Nested Form
<html>
<body>
    <form id="form1">
        <input name="user" value="TEST_PAYLOAD">
    </form>
    <form id="form2">
        <input name="pass" type="password">
    </form>
</body>
</html>

## Noscript Tag
<html>
<body>
    <noscript>
        Please enable JavaScript. Your input: TEST_PAYLOAD
    </noscript>
</body>
</html>

## Template Tag
<html>
<body>
    <template>
        <div>TEST_PAYLOAD</div>
    </template>
</body>
</html>

# ============== Framework-Specific Fixtures ==============

## AngularJS
<html ng-app>
<head>
    <script src="angular.min.js"></script>
</head>
<body>
    <div ng-bind="TEST_PAYLOAD"></div>
</body>
</html>

## React
<html>
<body>
    <div id="root"></div>
    <script>
        ReactDOM.render(
            React.createElement('div', {dangerouslySetInnerHTML: {__html: 'TEST_PAYLOAD'}}),
            document.getElementById('root')
        );
    </script>
</body>
</html>

## Vue.js
<html>
<body>
    <div id="app">
        <div v-html="'TEST_PAYLOAD'"></div>
    </div>
    <script src="vue.js"></script>
</body>
</html>

# ============== CSP Headers Fixtures ==============

## Weak CSP
Content-Security-Policy: default-src 'self'; script-src *

## Strict CSP
Content-Security-Policy: default-src 'self'; script-src 'self' 'nonce-abc123'

## Unsafe Inline
Content-Security-Policy: default-src 'self'; script-src 'unsafe-inline'

## Unsafe Eval
Content-Security-Policy: default-src 'self'; script-src 'unsafe-eval'
