[FINAL REVIEW] Implement security hardening for OAuth callback, CSRF enforcement, and DB error handling#149
[FINAL REVIEW] Implement security hardening for OAuth callback, CSRF enforcement, and DB error handling#149Copilot wants to merge 10 commits into
Conversation
|
@copilot |
…POST forms Agent-Logs-Url: https://github.com/marpisco/ClassLink/sessions/915c369e-d638-4384-89f9-6bf45604b511 Co-authored-by: marpisco <162377105+marpisco@users.noreply.github.com>
Agent-Logs-Url: https://github.com/marpisco/ClassLink/sessions/915c369e-d638-4384-89f9-6bf45604b511 Co-authored-by: marpisco <162377105+marpisco@users.noreply.github.com>
Agent-Logs-Url: https://github.com/marpisco/ClassLink/sessions/915c369e-d638-4384-89f9-6bf45604b511 Co-authored-by: marpisco <162377105+marpisco@users.noreply.github.com>
…h matching Agent-Logs-Url: https://github.com/marpisco/ClassLink/sessions/915c369e-d638-4384-89f9-6bf45604b511 Co-authored-by: marpisco <162377105+marpisco@users.noreply.github.com>
Agent-Logs-Url: https://github.com/marpisco/ClassLink/sessions/915c369e-d638-4384-89f9-6bf45604b511 Co-authored-by: marpisco <162377105+marpisco@users.noreply.github.com>
… audit ids Agent-Logs-Url: https://github.com/marpisco/ClassLink/sessions/915c369e-d638-4384-89f9-6bf45604b511 Co-authored-by: marpisco <162377105+marpisco@users.noreply.github.com>
…ction Agent-Logs-Url: https://github.com/marpisco/ClassLink/sessions/915c369e-d638-4384-89f9-6bf45604b511 Co-authored-by: marpisco <162377105+marpisco@users.noreply.github.com>
Implementei os pontos pedidos: validação de |
|
As per new feature that was implemented (Importação Massiva de Reservas por CSV #152), "Post-merge follow-ups (not blocking, but recommended): Add CSRF protection to remaining materiais.php actions (criar, criar_completo, update, apagar) — currently unprotected Remember to implement all of this later on. |
…ty-backend - Resolved conflict in admin/relatorios.php: kept both CSRF validation (ours) and pending TOTP/setup flow guards (main) - Auto-merged: admin/index.php, login/index.php, reservar/index.php, reservar/manage.php — all security additions from both sides preserved
…atements, XSS fixes, transactions - materiais.php: Convert apagar action from GET to POST with CSRF token; add explicit CSRF token fields to criar_completo and update forms - reservaemmassa.php: Add transaction wrapper (begin/commit/rollback) to CSV import and mass reservation loops for atomicity; add explicit CSRF token to mass reservation form; use separate insertErrorCount to avoid rollback on validation-only errors - reservar/manage.php: Replace all $db->query() with real_escape_string() (6 occurrences) with prepared statements per coding rules; apply htmlspecialchars() to post_reservation_content output to prevent stored XSS from admin-created CKEditor content
|
📝 Manual Update Required? It looks like you've modified core logic. Please check if the user manual needs a refresh! @marpisco |
This pass implements the security fixes identified in the previous review across auth, session, CSRF, and backend request handling surfaces.
Scope
Implemented changes
statevalidation is now enforced$_GET['state']against$_SESSION['oauth2state']before exchanging the authorization code.Out of scope / unchanged by request
Outcome