-
Notifications
You must be signed in to change notification settings - Fork 75
[Bug]: Add missing authentication to /award and /invite endpoints #878
Description
The Bug
The /award and /invite POST endpoints in tahrir/views/badge.py are missing the @oidc.require_login decorator. Both endpoints perform write operations to the database (awarding badges and creating invitations) but do not verify the user is authenticated first.
Impact
-
/award(line 158): Callsg.tahrirdb.add_assertion()to award a badge to a user. Without authentication,g.oidc_user.personisNone, which gets passed tobadge.authorized(None). This is a security concern as the endpoint performs a database write. -
/invite(line 184): Callsg.tahrirdb.add_invitation()to create a badge invitation. Without authentication,g.oidc_user.personisNone, andagent.emailon line 202 raises anAttributeError.
Every other write endpoint in the views layer uses @oidc.require_login:
admin()inviews/admin.py— has@oidc.require_loginaward_from_csv()inviews/admin.py— has@oidc.require_loginadd_tag()inviews/admin.py— has@oidc.require_loginaward()inviews/badge.py— MISSINGinvite()inviews/badge.py— MISSING