|
| 1 | +# Security Policy |
| 2 | + |
| 3 | +## Supported Versions |
| 4 | + |
| 5 | +We release patches for security vulnerabilities. Which versions are eligible for receiving such patches depends on the CVSS v3.0 Rating: |
| 6 | + |
| 7 | +| Version | Supported | |
| 8 | +| ------- | ------------------ | |
| 9 | +| 1.0.x | :white_check_mark: | |
| 10 | +| < 1.0 | :x: | |
| 11 | + |
| 12 | +## Reporting a Vulnerability |
| 13 | + |
| 14 | +We take the security of PHP MVC Framework seriously. If you believe you have found a security vulnerability, please report it to us as described below. |
| 15 | + |
| 16 | +### Please do the following: |
| 17 | + |
| 18 | +**DO NOT** create a public GitHub issue for security vulnerabilities. |
| 19 | + |
| 20 | +Instead, please report security vulnerabilities by emailing: |
| 21 | + |
| 22 | +📧 **elightsysl@gmail.com** |
| 23 | + |
| 24 | +### What to include in your report: |
| 25 | + |
| 26 | +- Type of issue (e.g. SQL injection, XSS, authentication bypass, etc.) |
| 27 | +- Full paths of source file(s) related to the manifestation of the issue |
| 28 | +- The location of the affected source code (tag/branch/commit or direct URL) |
| 29 | +- Any special configuration required to reproduce the issue |
| 30 | +- Step-by-step instructions to reproduce the issue |
| 31 | +- Proof-of-concept or exploit code (if possible) |
| 32 | +- Impact of the issue, including how an attacker might exploit it |
| 33 | + |
| 34 | +### What to expect: |
| 35 | + |
| 36 | +- **Acknowledgment**: We will acknowledge receipt of your vulnerability report within 48 hours. |
| 37 | +- **Communication**: We will send you regular updates about our progress. |
| 38 | +- **Disclosure**: Once the vulnerability is fixed, we will publicly disclose it (giving you credit if desired). |
| 39 | + |
| 40 | +## Security Best Practices for Users |
| 41 | + |
| 42 | +When deploying this application in production: |
| 43 | + |
| 44 | +1. **Configuration Security** |
| 45 | + - Never commit `app/config/config.php` with real credentials |
| 46 | + - Use strong, unique database passwords |
| 47 | + - Generate a new `__UNIQID__` value using `md5(uniqid(rand(), true))` |
| 48 | + |
| 49 | +2. **File Permissions** |
| 50 | + - Set proper file permissions (755 for directories, 644 for files) |
| 51 | + - Restrict write access to sensitive directories |
| 52 | + - Keep `storage/logs/` and `storage/cache/` writable but not web-accessible |
| 53 | + |
| 54 | +3. **Database Security** |
| 55 | + - Use separate database users with minimal privileges |
| 56 | + - Enable MySQL's `strict mode` |
| 57 | + - Regularly backup your database |
| 58 | + |
| 59 | +4. **Web Server Configuration** |
| 60 | + - Use HTTPS (SSL/TLS) in production |
| 61 | + - Configure proper security headers |
| 62 | + - Disable directory listing |
| 63 | + - Keep PHP and MySQL up to date |
| 64 | + |
| 65 | +5. **Application Security** |
| 66 | + - Change default admin credentials immediately |
| 67 | + - Regularly update dependencies |
| 68 | + - Monitor error logs for suspicious activity |
| 69 | + - Implement rate limiting for login attempts |
| 70 | + |
| 71 | +6. **Session Security** |
| 72 | + - Use secure session cookies (`session.cookie_secure = 1`) |
| 73 | + - Enable HttpOnly cookies (`session.cookie_httponly = 1`) |
| 74 | + - Set appropriate session timeout values |
| 75 | + |
| 76 | +## Known Security Considerations |
| 77 | + |
| 78 | +### Current Implementation |
| 79 | + |
| 80 | +- **Password Hashing**: Uses PHP's `password_hash()` with bcrypt |
| 81 | +- **SQL Injection Prevention**: Uses PDO prepared statements |
| 82 | +- **CSRF Protection**: Token-based validation in forms |
| 83 | +- **XSS Prevention**: Output escaping in views |
| 84 | +- **Session Management**: Secure session handling with regeneration |
| 85 | + |
| 86 | +### Areas for Enhancement (Production) |
| 87 | + |
| 88 | +- Implement rate limiting for authentication |
| 89 | +- Add two-factor authentication (2FA) |
| 90 | +- Implement security headers (CSP, HSTS, etc.) |
| 91 | +- Add input validation library |
| 92 | +- Implement comprehensive logging and monitoring |
| 93 | +- Add brute force protection |
| 94 | + |
| 95 | +## Security Updates |
| 96 | + |
| 97 | +We will notify users of security updates through: |
| 98 | + |
| 99 | +- GitHub Security Advisories |
| 100 | +- Release notes |
| 101 | +- Email (for critical vulnerabilities) |
| 102 | + |
| 103 | +## Third-Party Dependencies |
| 104 | + |
| 105 | +This project uses several third-party libraries: |
| 106 | + |
| 107 | +- jQuery 3.5.1 |
| 108 | +- Bootstrap 4.5.2 |
| 109 | +- DataTables 1.10.24 |
| 110 | + |
| 111 | +Please ensure you keep these dependencies updated to their latest secure versions. |
| 112 | + |
| 113 | +## Scope |
| 114 | + |
| 115 | +This security policy applies to: |
| 116 | + |
| 117 | +- The core MVC framework |
| 118 | +- Bundled controllers, models, and views |
| 119 | +- Database abstraction layer |
| 120 | +- Authentication system |
| 121 | + |
| 122 | +It does not apply to: |
| 123 | + |
| 124 | +- Custom modifications or extensions |
| 125 | +- Third-party plugins not included in this repository |
| 126 | +- Server configuration (Apache/Nginx/PHP) |
| 127 | + |
| 128 | +## Comments on This Policy |
| 129 | + |
| 130 | +If you have suggestions on how this process could be improved, please submit a pull request or open an issue. |
| 131 | + |
| 132 | +--- |
| 133 | + |
| 134 | +**Thank you for helping keep PHP MVC Framework and its users safe!** 🔒 |
0 commit comments