Skip to main content
XsiSec.com
HomeReposBlogProjectsPortfolio
© 2026 XsiSec.com
Security rules |security.txt
Updated 2026-08-15 · v1.0.0+2026-08-14.82f92cb · 82f92cb
← Back to overview
Security article

Reflected XSS into HTML context with nothing encoded

Reflected XSS discovered in a search field where user input is rendered unencoded in the HTML response. Injecting a simple <script>alert("hello")</script> confirmed script execution due to missing output encoding and CSP.

2025-10-241 tag
Tags

🎯 Objective

Validate a reflected XSS where user input is reflected into an HTML context with no encoding; exploit by executing a simple alert().

🧭 Scope / Setup

  • Tooling: Browser (address/search bar), optional Burp for recording
  • Target: Search field that echoes input into HTML
  • Precondition: Lab environment (authorized)

🔎 Approach

  1. Paste the payload directly into the search bar and submit.
  2. Observe the page for alert() execution or inspect response source.

🧪 Test Payload (used)

  • <script>alert("hello ")</script>

✅ Outcome

xss_reflected_1

  • If the alert runs, the reflected XSS is confirmed.
  • If payload appears unescaped in the HTML but doesn't execute, note context and retry with context-appropriate vectors.

🛡️ Mitigations

  • Proper output encoding for HTML context.
  • Use secure templating that auto-escapes.
  • CSP script-src as defense-in-depth.
  • Don’t rely solely on WAFs.

📝 Notes

  • Lab has no CSP/CORS and backend does not escape input — direct script tags should execute.
  • Repeat tests in multiple browsers if needed; keep trials minimal and controlled.
  • Always test only in authorized labs.
Navigate

In this post

  1. 01🎯 Objective
  2. 02🧭 Scope / Setup
  3. 03🔎 Approach
  4. 04🧪 Test Payload (used)
  5. 05✅ Outcome
  6. 06🛡️ Mitigations
  7. 07📝 Notes
Search
Explore

Popular tags

Browse all 30 tags

Comments

0 comments

No comments yet — be the first to comment.