work in innerHTML?","acceptedAnswer":{"@type":"Answer","text":"Modern browsers do not execute script elements inserted via innerHTML for security reasons. Use event handlers like onerror or onload instead."}},{"@type":"Question","name":"What are common DOM XSS sinks?","acceptedAnswer":{"@type":"Answer","text":"Common sinks include innerHTML, outerHTML, document.write, eval, setTimeout, setInterval, and location properties."}},{"@type":"Question","name":"How can I bypass a filter that blocks 'alert'?","acceptedAnswer":{"@type":"Answer","text":"Use alternative functions like prompt, confirm, or use eval(atob('YWxlcnQoMSk=')) to decode Base64-encoded JavaScript."}},{"@type":"Question","name":"Can DOM XSS be exploited without user interaction?","acceptedAnswer":{"@type":"Answer","text":"Yes, if the vulnerable code executes on page load (e.g., from URL hash) or via autofocus events."}},{"@type":"Question","name":"What is the best defense against DOM XSS?","acceptedAnswer":{"@type":"Answer","text":"Avoid using innerHTML with user input. Use textContent or sanitize with DOMPurify. Also implement a strict CSP."}},{"@type":"Question","name":"Is DOM XSS still a problem in modern frameworks?","acceptedAnswer":{"@type":"Answer","text":"Yes, because developers can still use dangerous methods like innerHTML even in React or Angular."}},{"@type":"Question","name":"What tools can detect DOM XSS?","acceptedAnswer":{"@type":"Answer","text":"Burp Suite, OWASP ZAP, and browser developer tools can help. Static analysis tools like ESLint with security plugins also help."}},{"@type":"Question","name":"How do I exfiltrate data with DOM XSS?","acceptedAnswer":{"@type":"Answer","text":"Use fetch or XMLHttpRequest to send data to an attacker-controlled server. Example: "}},{"@type":"Question","name":"What is the role of CSP in preventing DOM XSS?","acceptedAnswer":{"@type":"Answer","text":"CSP can block inline event handlers and scripts, making it harder to execute XSS payloads even if the DOM is vulnerable."}},{"@type":"Question","name":"Can I use DOM XSS to steal CSRF tokens?","acceptedAnswer":{"@type":"Answer","text":"Yes, if the token is in the DOM (e.g., in a meta tag), you can read it with document.querySelector and exfiltrate it."}},{"@type":"Question","name":"What is the difference between innerHTML and textContent?","acceptedAnswer":{"@type":"Answer","text":"innerHTML parses and inserts HTML, while textContent sets the text content safely, escaping HTML special characters."}},{"@type":"Question","name":"Why do some DOM XSS payloads use tags?","acceptedAnswer":{"@type":"Answer","text":"Because img tags with onerror fire automatically when the image fails to load, providing a way to execute JavaScript without user interaction."}},{"@type":"Question","name":"What is the 'onerror' event handler?","acceptedAnswer":{"@type":"Answer","text":"onerror is triggered when an element (like img) encounters an error during loading. It can be used to execute JavaScript."}},{"@type":"Question","name":"What is the 'onload' event handler?","acceptedAnswer":{"@type":"Answer","text":"onload fires when an element finishes loading. For example, works if the body element is inserted."}},{"@type":"Question","name":"How can I bypass a filter that blocks 'onerror'?","acceptedAnswer":{"@type":"Answer","text":"Use alternative events like onfocus, onmouseover, or use SVG events like onload. Also try case variations or encoding."}},{"@type":"Question","name":"Does the browser's XSS auditor protect against DOM XSS?","acceptedAnswer":{"@type":"Answer","text":"No, the XSS Auditor (now removed) only protected against reflected XSS. DOM-based XSS is not mitigated by the auditor."}},{"@type":"Question","name":"What is the impact of DOM XSS?","acceptedAnswer":{"@type":"Answer","text":"An attacker can steal cookies, session tokens, perform actions on behalf of the user, deface the page, or redirect to malicious sites."}},{"@type":"Question","name":"Can DOM XSS occur in mobile apps?","acceptedAnswer":{"@type":"Answer","text":"Yes, if the app uses WebView and loads untrusted data into the DOM via JavaScript bridges."}},{"@type":"Question","name":"How do I practice DOM XSS safely?","acceptedAnswer":{"@type":"Answer","text":"Use purposely vulnerable platforms like SecByte CTF, OWASP WebGoat, or DVWA. Never test on live sites without permission."}},{"@type":"Question","name":"What is the flag from this challenge?","acceptedAnswer":{"@type":"Answer","text":"FLAG{D0M_XSS_1s_Tr1cky}"}},{"@type":"Question","name":"How long does it take to solve this CTF challenge?","acceptedAnswer":{"@type":"Answer","text":"Approximately 30-45 minutes for a beginner with some guidance."}},{"@type":"Question","name":"What are the prerequisites for this challenge?","acceptedAnswer":{"@type":"Answer","text":"Basic understanding of HTML, JavaScript, and using browser developer tools."}},{"@type":"Question","name":"Can I use Burp Suite for this challenge?","acceptedAnswer":{"@type":"Answer","text":"Yes, but it's not necessary. You can do everything in the browser DevTools."}},{"@type":"Question","name":"What is the 'SecByte CTF' platform?","acceptedAnswer":{"@type":"Answer","text":"A CTF (Capture The Flag) platform with challenges ranging from web security to cryptography. Available at https://learn.secbyte.org/ctf"}},{"@type":"Question","name":"How can I learn more about web security?","acceptedAnswer":{"@type":"Answer","text":"Check out the SecByte Learning Paths at https://learn.secbyte.org/learning-paths for structured courses and hands-on labs."}}]}
Loading

Loading module…