Skip to content

Security fixes: SQLi, XSS, CSRF, plaintext passwords, missing auth - #1

Open
javokhir-sec wants to merge 2 commits into
Dusterian:mainfrom
javokhir-sec:fix/security-vulnerabilities-july-2026
Open

Security fixes: SQLi, XSS, CSRF, plaintext passwords, missing auth#1
javokhir-sec wants to merge 2 commits into
Dusterian:mainfrom
javokhir-sec:fix/security-vulnerabilities-july-2026

Conversation

@javokhir-sec

Copy link
Copy Markdown

Security Vulnerability Fixes

This PR addresses 9 security vulnerabilities found in the Public-Utility-Management-System.

Critical (2)

  • SQL Injection in admin/report_data.php - Unauthenticated SQLi via $_GET['year'] parameter
  • Plaintext Passwords - All passwords stored and compared in cleartext across admin, employee, and customer accounts

High (1)

  • SQL Injection in employee/employee_reports.php - SQLi via $_GET['from'] and $_GET['to'] parameters

Medium (6)

  • Reflected XSS in employee/employee_reports.php - Unsanitized output of from/to parameters
  • Reflected XSS in admin/view_bills.php - Unsanitized output of tab parameter
  • Missing Authorization in admin/dashboard_admin.php - No session role check
  • CSRF in admin/manage_employees.php - No CSRF token on employee deletion
  • CSRF in employee/employee_update_payment.php - No CSRF token verification on payment updates
  • Information Disclosure in admin/manage_customers.php and admin/manage_employees.php - Passwords exposed in HTML onclick handlers

Files Changed

  • admin/report_data.php - Added auth check + prepared statement
  • index.php - password_verify() for all user types
  • admin/manage_customers.php - password_hash() on create, removed password from HTML
  • admin/manage_employees.php - password_hash() on create, CSRF on delete, removed password from HTML
  • employee/employee_reports.php - Prepared statement for SQLi + htmlspecialchars for XSS
  • admin/view_bills.php - htmlspecialchars on tab parameter
  • admin/dashboard_admin.php - Added role check
  • employee/employee_update_payment.php - Added CSRF token verification

Note: 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).

Dusterian and others added 2 commits June 30, 2026 08:48
- 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
Dusterian force-pushed the main branch 28 times, most recently from d5c9b1c to 796079b Compare July 4, 2026 06:35
@Dusterian
Dusterian force-pushed the main branch 30 times, most recently from 61764ba to 420192b Compare July 9, 2026 02:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants