Skip to content

Commit 59bb6d6

Browse files
feanilclaude
andcommitted
fix: require Django staff to call set_course_mode_price endpoint
The set_course_mode_price view had no authorization check beyond @login_required, meaning any authenticated user could POST to it and rewrite the honor-mode price for any course — a privilege escalation vulnerability. Ideally this endpoint would be removed: it has no known callers in the UI (no templates or JS reference it), no tests, and targets the legacy 'honor' mode. However, it is publicly routed and external consumers may depend on it, so removal requires going through the DEPR process before we can act. In the meantime, this commit closes the security hole regardless of how active the endpoint is. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 375249d commit 59bb6d6

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

lms/djangoapps/instructor/views/instructor_dashboard.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,11 @@ def set_course_mode_price(request, course_id):
435435
"""
436436
set the new course price and add new entry in the CourseModesArchive Table
437437
"""
438+
if not request.user.is_staff:
439+
return JsonResponse(
440+
{'message': _("You do not have permission to perform this action.")},
441+
status=403
442+
)
438443
try:
439444
course_price = int(request.POST['course_price'])
440445
except ValueError:

0 commit comments

Comments
 (0)