Type: security
Level: advanced
Labels: gssoc26, type:security, hardening
Description:
The app currently lacks content security policy and strict SVG validation, leaving it vulnerable to XSS attacks through user input in profiles.
Security Risks
- SVG Injection - Usernames/bios with special characters could break SVG structure
- No CSP Headers - Missing Content-Security-Policy allows inline scripts
- Insufficient Escaping - Some user data may not be fully sanitized
What's Needed
-
Add CSP Headers (profile.route.js)
-
Enhance escapeXml() Function
- Ensure ALL special XML chars are escaped: & < > " '
- Test with attack vectors like:
<script>, javascript:, on*=
- Input Validation
- Validate usernames against strict regex (already done)
- Validate platform handles (LeetCode, Codeforces, CodeChef)
- Reject input with suspicious patterns
- Security Tests
- Test with XSS payloads:
"><script>alert(1)</script>, etc.
- Verify CSP headers are set on all responses
- Check SVG renders safely with malicious input
Files to Modify
- src/routes/profile.route.js (add CSP middleware)
- src/renderers/svg.renderer.js (enhance escapeXml)
- src/services/github.service.js (validate data)
Kindly assign this issue to me under gssoc26!
Thankyou
Acceptance Criteria
✅ CSP headers present on all profile responses
✅ XSS payloads are escaped and render as text, not code
✅ Security audit passes (use OWASP guidelines)
✅ Unit tests verify injection attempts fail safely
Type: security
Level: advanced
Labels: gssoc26, type:security, hardening
Description:
The app currently lacks content security policy and strict SVG validation, leaving it vulnerable to XSS attacks through user input in profiles.
Security Risks
What's Needed
Add CSP Headers (profile.route.js)
Enhance escapeXml() Function
<script>,javascript:,on*="><script>alert(1)</script>, etc.Files to Modify
Kindly assign this issue to me under gssoc26!
Thankyou
Acceptance Criteria
✅ CSP headers present on all profile responses
✅ XSS payloads are escaped and render as text, not code
✅ Security audit passes (use OWASP guidelines)
✅ Unit tests verify injection attempts fail safely