An instructor can reassign the ownership of their own course to any account through the course edit endpoint of The Hackers Labs Academy
Description
Improperly Controlled Modification of Dynamically-Determined Object Attributes (CWE-915) in CourseWriteSerializer (backend/apps/classroom/serializers.py) of The Hackers Labs Academy. A user who holds the instructor role and owns a course can reassign that course to any other account with a single request.
The serializer lists instructor in Meta.fields, while Meta.read_only_fields holds only id and slug. The field is therefore writable, and CourseUpdateView accepts PATCH /api/classroom/courses/<id>/edit/ through that serializer.
IsAdminOrOwnerInstructor authorises who may issue the request, the owning instructor or an admin, and it runs before the update is applied. What it does not do is restrict which attributes of the object an authorised request may then change. The authorisation covers the actor and not the fields.
The Course.instructor foreign key carries no limit_choices_to, so the value may be any user id, including an account that does not hold the instructor role. The receiving account takes no part in the change and is not asked.
Once the value has changed, IsAdminOrOwnerInstructor resolves ownership from the new value on the next request, so the original owner is refused edit access to the course.
Vulnerability type (CWE)
- CWE-915: Improperly Controlled Modification of Dynamically-Determined Object Attributes
Affected versions
Affected from commit fa3cf76e of 19 July 2026, the first commit of the repository, which already carries instructor in Meta.fields with read_only_fields limited to id and slug, and fixed in commit 7166a28b of 23 July 2026. Default status: unaffected.
The project publishes no versioned releases and the repository carries no git tags, so an affected revision can only be identified by commit. The flaw is therefore recorded as a commit range rather than a version range.
Checked by parsing CourseWriteSerializer out of backend/apps/classroom/serializers.py at every commit in the repository and deciding from the syntax tree whether instructor is writable and unguarded. It is writable and unguarded in the ten commits from fa3cf76e to 52e19779, and guarded from 7166a28b onward, including at the current head.
Score (CVSS 4.0)
Medium (5.3)
CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N
The attack vector is Network because the change is made through the application's HTTP API. The attack complexity is Low and the attack requirements are None, since nothing has to coincide and the request succeeds whenever it is issued. The privileges required are Low because the requester has to be authenticated, hold the instructor role and own the course. The user interaction is None because the account the course is assigned to takes no part. Confidentiality on the vulnerable system is None: nothing is exposed that the owner could not already read. Integrity on the vulnerable system is Low because the ownership attribute of the course is set to a value the requester is not authorised to set, and that write reaches an account other than the requester's own. Availability is None. The subsequent system metrics are None, since no impact outside the application is demonstrated.
The requester starts from a course over which they already hold legitimate edit rights, so taking over a course belonging to a third party is not demonstrated. What is demonstrated is the unauthorised reassignment of a resource the requester already controlled, and the loss of their own access to it.
Solution
Update to commit 7166a28b or later.
Where that commit cannot be applied, adding instructor to Meta.read_only_fields removes the writable field. That also removes the path by which an admin can reassign a course through this endpoint, so it is a narrower fix than the one released.
Patch
Commit 7166a28b1b0c2c3755563d1e7099a8a4760d1b8b.
A validate_instructor method is added to CourseWriteSerializer. It reads the role of the requesting user from the serializer context, returns the value unchanged for a user holding the admin role, and otherwise compares the submitted value against the current instructor of the instance, raising a validation error when the two differ. A request that does not change the field continues to pass.
Credits
- Lois del Río Somoza - finder
- Xoán M. Otero Jorge - analyst
- Mario Alvarez - analyst
- Secur0 CNA - coordinator
- Manuel Martínez Casasola - remediation developer Discovery source: External
Official record: CVE-2026-141362