πŸ“– Step 7: Testing & Quality#463 / 498

XSS

Cross-Site Scripting (XSS)

πŸ“–One-line summary

An attack where malicious scripts are injected into a page and run in other users' browsers.

✨Example

// XSS

βœ“ κ³΅κ²©μžκ°€ νŽ˜μ΄μ§€μ— μ•…μ„± 슀크립트λ₯Ό 심어 λ‹€λ₯Έ μ‚¬μš©μžμ˜ λΈŒλΌμš°μ €μ—μ„œ μ‹€ν–‰λ˜κ²Œ ν•˜λŠ” 곡격

Tests: 1 passed

⚑Vibe coding prompt examples

>_

We render user comments with dangerouslySetInnerHTML. Make it safe with DOMPurify.

>_

Configure react-markdown to prevent XSS when rendering Markdown posts (allowed tags, link checks).

>_

Explain how to set a Content-Security-Policy header in Next.js to limit XSS damage.

Try these prompts in your AI coding assistant!