🚨 Security Issue: Arbitrary URL Loading in iframe
Severity: CRITICAL
File: src/components/ui/ProjectCard.jsx
Problem
The iframe directly uses project.demoUrl without validation:
<iframe src={project.demoUrl || `/live/${project.slug}/index.html`} />
Attack Vectors
- Phishing: Malicious
demoUrl loads fake login pages
- XSS via data: URIs:
data:text/html,<script>alert(1)</script>
- Internal Network Scanning:
http://localhost:8080/admin
Fix Required
const ALLOWED = ["github.io", "vercel.app", "netlify.app"];
function isSafe(url) {
try {
const u = new URL(url);
return ALLOWED.some(d => u.hostname.endsWith(d));
} catch { return false; }
}
Labels: bug, ssoc26
🚨 Security Issue: Arbitrary URL Loading in iframe
Severity: CRITICAL
File: src/components/ui/ProjectCard.jsx
Problem
The iframe directly uses
project.demoUrlwithout validation:Attack Vectors
demoUrlloads fake login pagesdata:text/html,<script>alert(1)</script>http://localhost:8080/adminFix Required
Labels: bug, ssoc26