mirror of
https://github.com/Freezy-Studios/BlazeSMP.git
synced 2025-08-15 12:18:21 +02:00
|
||
---|---|---|
.. | ||
dashboard.html | ||
dashboard.js | ||
index.html | ||
login.js | ||
README.md | ||
styles.css |
Security Demonstration Website
⚠️ WARNING: This website contains intentional security vulnerabilities for educational purposes only. DO NOT use any of these patterns in production applications!
Overview
This demonstration website shows common security vulnerabilities that can compromise login credentials and user data. It's designed to educate developers about what NOT to do when building web applications.
How to Use
- Open
index.html
in a web browser - Use the demo credentials:
admin
/password123
- Explore the dashboard to see various vulnerabilities in action
- Open browser developer tools (F12) to see console logs exposing sensitive data
Security Vulnerabilities Demonstrated
1. Plain Text Password Storage
- Location:
login.js
and localStorage - Issue: Passwords stored in plain text in localStorage and JavaScript variables
- Real-world impact: Anyone with access to the device can see passwords
2. Client-Side Authentication
- Location:
login.js
- Issue: Authentication logic runs entirely in the browser
- Real-world impact: Can be easily bypassed by modifying JavaScript
3. XSS (Cross-Site Scripting) Vulnerabilities
- Location:
dashboard.js
- command execution function - Issue: User input directly inserted into HTML using innerHTML
- Demo: Try entering
<script>alert('XSS')</script>
in the command field - Real-world impact: Attackers can execute malicious scripts
4. SQL Injection Simulation
- Location:
dashboard.js
- user search function - Issue: User input directly concatenated into SQL query
- Demo: Try searching for
' OR 1=1 --
- Real-world impact: Database compromise, data theft
5. Information Disclosure
- Location: Throughout the application
- Issues:
- Credentials exposed in console logs
- Session data visible in browser
- Error messages reveal system information
- Debug functions exposed globally
6. No Brute Force Protection
- Location:
login.js
- Issue: No rate limiting or account lockout
- Real-world impact: Attackers can try unlimited password combinations
7. Insecure Data Transmission
- Location: URL parameters in dashboard redirect
- Issue: Credentials passed in URL parameters
- Real-world impact: Passwords visible in browser history, server logs
8. CSRF (Cross-Site Request Forgery) Vulnerability
- Location:
dashboard.js
- admin functions - Issue: No CSRF tokens or verification
- Real-world impact: Malicious sites can perform actions on behalf of users
9. Eval() Injection
- Location:
dashboard.js
- command execution - Issue: Using eval() with user input
- Demo: Try command
eval:alert('Code injection')
- Real-world impact: Arbitrary code execution
10. Exposed Debug Functions
- Location:
dashboard.js
- global window functions - Issue: Administrative functions accessible via browser console
- Demo: Try
window.adminFunctions.deleteAllUsers()
in console
Educational Points
What Developers Should Do Instead:
-
Password Security:
- Hash passwords with strong algorithms (bcrypt, Argon2)
- Never store plain text passwords
- Use secure session management
-
Authentication:
- Implement server-side authentication
- Use secure session tokens
- Implement proper logout procedures
-
Input Validation:
- Sanitize all user inputs
- Use parameterized queries
- Implement proper output encoding
-
Access Controls:
- Implement rate limiting
- Use CSRF tokens
- Require proper authorization for admin functions
-
Data Protection:
- Use HTTPS for all communications
- Implement proper error handling
- Don't expose sensitive data in logs or console
Testing the Vulnerabilities
XSS Testing:
- Go to the dashboard
- In the "Execute Command" field, enter:
<img src=x onerror=alert('XSS')>
- Click Execute to see the XSS in action
SQL Injection Testing:
- In the "User Search" field, enter:
admin'; DROP TABLE users; --
- See how the vulnerable query construction is exposed
Authentication Bypass:
- Open browser console (F12)
- Type:
window.bypassLogin()
and press Enter - See how client-side authentication can be bypassed
Session Data Exposure:
- Open browser console
- Type:
localStorage
to see stored credentials - Type:
window.currentSessionData
to see exposed session information
Files Structure
index.html
- Login page with vulnerable authenticationdashboard.html
- Admin dashboard with multiple vulnerabilitiesstyles.css
- Styling for the demonstrationlogin.js
- Vulnerable login logicdashboard.js
- Vulnerable dashboard functionalityREADME.md
- This documentation
Disclaimer
This code is provided for educational purposes only. The vulnerabilities demonstrated here are intentional and should never be implemented in production applications. Always follow security best practices when developing real applications.