Run exploit and abuse-case testing on the Willow RBAC authorization flows in openedx-authz and openedx-platform

Open
#631 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
python

Research direction

Start by reviewing the listed AuthZ endpoints and Instructor Dashboard API v2 routes, then inspect the existing authorization tests in openedx-authz and openedx-platform. Build the sandbox dataset with the authz-sandbox-seeder command and add enrolled learners, grade data, and per-course flag settings. Record each prioritized request, response, and verdict; completion means the prioritized scenarios are covered and confirmed vulnerabilities have private reports and regression tests.

Written by the indexing model from the issue text.

Description

Description

The RBAC Willow phases moved authorization decisions to openedx-authz and added enforcement in openedx-platform, most notably in the Instructor Dashboard API v2, with a legacy compatibility path controlled by the authz.enable_course_authoring flag. These changes decide who can see learner data, change grades, manage enrollments and grant roles, so any bypass or privilege escalation has a high impact. Existing unit tests verify the intended behavior, but there has been no dedicated pass that actively tries to break the authorization model.

This task runs a structured security test of the current state, as authorized testing on a local or sandbox environment, to find and document authorization bypasses before they reach production.

Current Behavior
  • Tests cover intended permission behavior, but there is no adversarial test plan for the AuthZ API or for the Instructor Dashboard enforcement.
  • Past findings (for example, users being able to remove their own admin roles, fixed in fce0fb4) show that this class of issue can exist and is easy to miss.
  • The boundary between the legacy role system and AuthZ (flag enabled or disabled per course) has not been attacked deliberately.
Expected Behavior

A documented set of exploit attempts has been executed against the current state, with a verdict for each one (blocked or vulnerable), and every confirmed vulnerability is reported privately and tracked for remediation.

Acceptance Criteria
  • A test plan lists the attack scenarios, target endpoints and expected outcomes, and is reviewed before execution.
  • Testing runs only on a local or sandbox environment with synthetic data, never on production.
  • The test environment is built with the dataset described in Test Dataset, with users covering each profile: platform admin, org admin, course-level roles, and a user without roles.
  • Priority openedx-authz endpoints are attacked (see below), with a verdict for each scenario.
  • Priority Instructor Dashboard endpoints in openedx-platform are attacked (see below), with a verdict for each scenario.
  • Privilege escalation is tested: a user granting themselves a higher role, assigning roles in scopes they do not administer, and removing or demoting their own role or the last admin.
  • Scope handling is tested: org-wide and platform-wide glob scopes, malformed or ambiguous scope strings, and access across orgs and courses.
  • Object-level access (IDOR) is tested: reading or modifying data of users, learners, orgs or courses that the caller should not reach.
  • Unauthenticated and low-privilege access is tested on every priority endpoint.
  • Flag and legacy fallback is tested: a user with a legacy role but no AuthZ permission (and the reverse), with the flag enabled and disabled for the course.
  • Bypass of the frontend is tested: direct API calls with alternate HTTP methods, and with parameters the frontends never send.
  • Input handling is tested: invalid, oversized and malformed identifiers and parameters.
  • Each attempt is recorded with the request, the observed response and the verdict (blocked or vulnerable).
  • Confirmed vulnerabilities are reported through the project's security process (not in public comments), with severity and a remediation issue.
  • Regression tests are added for every confirmed vulnerability and for each high-risk scenario that was blocked.
  • Optional endpoints are tested only after all priority ones are complete, and are clearly marked as optional in the results.
Priority endpoints: openedx-authz

These endpoints change or expose role assignments and permissions, so a bypass here has the highest impact.

  • PUT /api/authz/v1/roles/users/ and DELETE /api/authz/v1/roles/users/ (assign and remove roles)
  • GET /api/authz/v1/roles/users/ (users by role)
  • POST /api/authz/v1/permissions/validate/me (permission validation, which the frontends trust)
  • GET /api/authz/v1/assignments/ (visible assignments, including filtering by scope and org)
  • GET /api/authz/v1/users/ and GET /api/authz/v1/users/<username>/assignments/ (team members and their assignments)
Priority endpoints: openedx-platform (Instructor Dashboard API v2)

Base path /api/instructor/v2/courses/<course_id>/. These endpoints manage the course team, change grades and learner state, or expose learner data.

  • team, team/roles and team/<email_or_username> (read, add and remove course team members and roles)
  • enrollments/modify and beta_testers/modify (change learner enrollment)
  • <problem>/grading/scores (score override), <problem>/grading/scores/rescore, <problem>/grading/attempts/reset and <problem>/grading/state (destructive grading actions)
  • learners/<email_or_username> (learner details)
  • grading-config and problems/<location>
  • GET / (course metadata, which exposes the permissions the user holds in the dashboard)
  • enrollments (learner list)
Optional endpoints

Lower expected risk or a smaller exposed surface. Test them only if the priority scenarios are complete.

openedx-authz

  • GET /api/authz/v1/roles/
  • GET /api/authz/v1/scopes/
  • GET /api/authz/v1/orgs/
  • POST /api/authz/v1/users/validate/
  • The course authoring waffle flag states endpoint
  • Loading a malicious or conflicting authorization schema or role extension (including priority conflicts)

openedx-platform (Instructor Dashboard API v2)

  • instructor_tasks, tasks/<task_id> and report downloads and generation
  • change_due_date, unit extensions and graded subsections endpoints
Test Dataset

The seed_sandbox_data management command from authz-sandbox-seeder can be used to build the environment, with some limitations to cover.

What it provides:

  • It creates organizations, courses, users and AuthZ role assignments from a JSON fixture, and is idempotent (--reset and --reset-only allow clean re-runs).
  • Its bundled sandbox_seed_data_bulk.json fixture (now the default) includes users with no roles, one role and several roles, and a mix of course-level and org or platform glob scopes. This is enough to test cross-org and cross-course access and glob scope matching.
  • It accepts a custom fixture through --data-file, so specific attack profiles can be added (for example, a user with a role in only one course, or users with a role in one org and none in another).

What it does not cover and must be added:

  • Learners: it does not enroll users in courses, and several Instructor Dashboard scenarios (learner details, grading actions, enrollment changes) need enrolled learners, course content and grade data.

  • Feature flag: it does not enable authz.enable_course_authoring, which must be set explicitly per course for each scenario, including a course with the flag disabled to test the legacy fallback.

  • Decide whether to extend the seeder (learner enrollment and grades) or to add a separate script for the data it does not create.

Out of Scope
  • Denial of service and load testing (covered by the performance testing issue).
  • Policy cache loading and reload behavior.
  • Content libraries and Studio course authoring endpoints, unless a specific test is justified and added explicitly.
  • Infrastructure, network and dependency vulnerability scanning.
  • Frontend (MFE) vulnerabilities, other than bypassing the frontend to reach the APIs directly.
  • Testing against production or shared environments.
Dependencies
  • Related to the Willow RBAC phases tracked for openedx-authz and openedx-platform.
Dominant language
Python
Stars
0
Forks
10
Avg merge
5d 11h
Merged PRs (30d)
25

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from openedx/openedx-authz

All issues in openedx/openedx-authz

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.