Commit 8b028b8
Security: enforce CSRF token on gradebook evaluation add/edit forms
The gradebook evaluation add and edit forms (EvalForm/FormValidator) were
state-changing POST endpoints with no anti-CSRF token. FormValidator does
not inject a CSRF token on its own, so the forms accepted forged
cross-site submissions.
Add the standard Chamilo legacy idiom: validate Security::check_token('post')
before persisting (api_not_allowed on failure, clear_token on success) and
emit a fresh sec_token hidden field on the display path, mirroring the
pattern already used in exercise/tests_category.php and group/settings.php.
Refs GHSA-vjmr-7vxh-wpg2
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 996c4f1 commit 8b028b8
2 files changed
Lines changed: 17 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
34 | 38 | | |
35 | 39 | | |
36 | 40 | | |
| |||
166 | 170 | | |
167 | 171 | | |
168 | 172 | | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
169 | 177 | | |
170 | 178 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
39 | 43 | | |
40 | 44 | | |
41 | 45 | | |
| |||
106 | 110 | | |
107 | 111 | | |
108 | 112 | | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
109 | 118 | | |
110 | 119 | | |
0 commit comments