Cloud-CV / Cloud-CV/EvalAI

Security: Replace inline superuser check with permission-based access control in bulk email endpoint

Open
#4,858 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
2k
Forks
984
Avg merge
2h 54m
Merged PRs (30d)
14

Description

The **notify_users_about_challenge** endpoint currently relies on inline **request.user.is_superuser** checks for authorization.

This approach is fragile and risks accidental misuse if the view is reused or middleware behavior changes.

Proposed solution:

Use DRF permission classes (e.g. IsAdminUser or a custom permission)

Add endpoint-specific throttling

Add audit logging for bulk email triggers

If this approach is acceptable, I’d be happy to open a PR.

Contributor guide

Open the contributing guide

Research direction

Start at the notify_users_about_challenge endpoint and inspect its current request.user.is_superuser authorization. Review the applicable DRF permission, throttling, and audit-logging patterns, then verify that authorization is permission-based, bulk triggers are throttled, and triggering is audited.

Written by the indexing model from the issue text.

Assessment

Tech stack
django, python
Domain
authorization, backend-api-design, security
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.