You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A stored XSS vulnerability was discovered in the Category module of FastAPI-Admin. Malicious JavaScript code injected into a form field (e.g. Category Name) is stored in the backend and rendered without proper sanitization. When an admin or any user visits the category list or detail view, the script executes in their browser context.
3.insert <svg onload=alert(document.cookie)> in name field, click save, then browser popup cookie.
Mitigation & Recommendation:
### To prevent stored XSS and reduce the attack surface: 1. Input Sanitization:
• Sanitize all user-supplied input before storage using libraries like bleach in Python to strip/escape dangerous HTML/JavaScript content. 2. Output Encoding:
• Ensure all dynamic content is properly HTML-encoded before rendering into templates or views.
• Apply context-aware encoding (e.g., HTML, JS, URL) based on where the data is rendered. 3. Set HttpOnly on Cookies:
Activity