Security hardening: fix SQLi, XSS, file upload, and migrate DB to RDS

- Fix all SQL injection vulnerabilities across Service_model, User_model,
  Module_model, Log_model, and Admin controller using parameterized queries
- Add htmlspecialchars() to all user-controlled output in admin views
  (bookings, services, workers, service categories, login form)
- Fix XSS in AJAX worker response and manage-booking-cancelled view
- Add file extension whitelist (jpg, jpeg, png, gif, webp) to all uploads
- Remove webshell (pentest2.php) from assets/img/profiles/
- Stop logging plaintext passwords on failed login attempts
- Migrate database.php hostname from localhost to AWS RDS endpoint
- Fix dropdown styling (white-on-white) in worker calendar view

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Ubuntu
2026-05-07 13:00:32 +00:00
co-authored by Claude Opus 4.6
parent 307f17faa6
commit 420bcb37fd
20 changed files with 205 additions and 194 deletions
@@ -36,14 +36,14 @@
<a href="<?php echo SITEURL;?>bookings/update-booking/<?php echo $resultItem->booking_id ;?>"><i class="fas fa-edit"></i></a>
| <a href="<?php echo site_url().'bookings/booking-process?delete-booking='.$resultItem->booking_id;?>" onclick="return confirm('Valóban törölni szeretnéd?');"><i class="fas fa-trash-alt" style="font-size: 14px;color:#585858;"></i></a>
</td>
<td>#<?php echo $resultItem->booking_id;?></td>
<td><?php echo $resultItem->guest_name;?></td>
<td><?php echo $resultItem->guest_email;?></td>
<td><?php echo $resultItem->guest_phone;?></td>
<td><?php echo $resultItem->worker_name;?></td>
<td style="min-width:85px;"><?php echo $resultItem->booking_date;?></td>
<td><?php echo $resultItem->booking_start_time;?></td>
<td><?php echo $resultItem->booking_finish_time;?></td>
<td>#<?php echo htmlspecialchars($resultItem->booking_id, ENT_QUOTES, 'UTF-8');?></td>
<td><?php echo htmlspecialchars($resultItem->guest_name, ENT_QUOTES, 'UTF-8');?></td>
<td><?php echo htmlspecialchars($resultItem->guest_email, ENT_QUOTES, 'UTF-8');?></td>
<td><?php echo htmlspecialchars($resultItem->guest_phone, ENT_QUOTES, 'UTF-8');?></td>
<td><?php echo htmlspecialchars($resultItem->worker_name, ENT_QUOTES, 'UTF-8');?></td>
<td style="min-width:85px;"><?php echo htmlspecialchars($resultItem->booking_date, ENT_QUOTES, 'UTF-8');?></td>
<td><?php echo htmlspecialchars($resultItem->booking_start_time, ENT_QUOTES, 'UTF-8');?></td>
<td><?php echo htmlspecialchars($resultItem->booking_finish_time, ENT_QUOTES, 'UTF-8');?></td>
<td><?php
if(!empty($resultItem->services)){
echo '<table class="tableInTable">';
@@ -55,10 +55,10 @@
echo '</tr>';
foreach($resultItem->services as $serviceItem){
echo '<tr>';
echo '<td>'.$serviceItem->service_type.'</td>';
echo '<td>'.$serviceItem->service_name.'</td>';
echo '<td>'.$serviceItem->service_price.'</td>';
echo '<td>'.$serviceItem->service_time.'</td>';
echo '<td>'.htmlspecialchars($serviceItem->service_type, ENT_QUOTES, 'UTF-8').'</td>';
echo '<td>'.htmlspecialchars($serviceItem->service_name, ENT_QUOTES, 'UTF-8').'</td>';
echo '<td>'.htmlspecialchars($serviceItem->service_price, ENT_QUOTES, 'UTF-8').'</td>';
echo '<td>'.htmlspecialchars($serviceItem->service_time, ENT_QUOTES, 'UTF-8').'</td>';
echo '</tr>';
}
echo '</table>';