Security fixes: SQLi, XSS, CSRF, plaintext passwords, missing auth - #1
Open
javokhir-sec wants to merge 2 commits into
Open
Security fixes: SQLi, XSS, CSRF, plaintext passwords, missing auth#1javokhir-sec wants to merge 2 commits into
javokhir-sec wants to merge 2 commits into
Conversation
- CRITICAL: Fix SQL injection in admin/report_data.php (auth bypass + raw query) - CRITICAL: Replace plaintext password storage with password_hash/password_verify - HIGH: Fix SQL injection in employee/employee_reports.php (prepared statements) - MEDIUM: Fix reflected XSS in employee/employee_reports.php (htmlspecialchars) - MEDIUM: Fix reflected XSS in admin/view_bills.php (htmlspecialchars) - MEDIUM: Add missing auth check to admin/dashboard_admin.php - MEDIUM: Add CSRF token verification for employee deletion - MEDIUM: Add CSRF token verification for payment updates - MEDIUM: Remove password exposure from HTML onclick handlers Co-Authored-By: Claude <noreply@anthropic.com>
Dusterian
force-pushed
the
main
branch
28 times, most recently
from
July 4, 2026 06:35
d5c9b1c to
796079b
Compare
Dusterian
force-pushed
the
main
branch
30 times, most recently
from
July 9, 2026 02:29
61764ba to
420192b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Security Vulnerability Fixes
This PR addresses 9 security vulnerabilities found in the Public-Utility-Management-System.
Critical (2)
admin/report_data.php- Unauthenticated SQLi via$_GET['year']parameterHigh (1)
employee/employee_reports.php- SQLi via$_GET['from']and$_GET['to']parametersMedium (6)
employee/employee_reports.php- Unsanitized output of from/to parametersadmin/view_bills.php- Unsanitized output of tab parameteradmin/dashboard_admin.php- No session role checkadmin/manage_employees.php- No CSRF token on employee deletionemployee/employee_update_payment.php- No CSRF token verification on payment updatesadmin/manage_customers.phpandadmin/manage_employees.php- Passwords exposed in HTML onclick handlersFiles Changed
admin/report_data.php- Added auth check + prepared statementindex.php- password_verify() for all user typesadmin/manage_customers.php- password_hash() on create, removed password from HTMLadmin/manage_employees.php- password_hash() on create, CSRF on delete, removed password from HTMLemployee/employee_reports.php- Prepared statement for SQLi + htmlspecialchars for XSSadmin/view_bills.php- htmlspecialchars on tab parameteradmin/dashboard_admin.php- Added role checkemployee/employee_update_payment.php- Added CSRF token verificationNote: Existing passwords in the database will need to be re-hashed with
password_hash()before the login changes take effect (see advisory for migration script).