Unlimited inflation of points, level and leaderboard position in The Hackers Labs Academy through repeatable awards for reversible actions
Description
Improper Enforcement of a Single, Unique Action (CWE-837) in the leaderboard award paths of The Hackers Labs Academy. Any authenticated user can raise their own points, level and leaderboard position without limit, by repeating an action they are able to reverse themselves.
Points are awarded on the transition of a reversible action, and no negative or compensating event exists for the reversal, so reversing an action does not take back the point it granted.
LikeToggleView (backend/apps/community/views.py) creates a LeaderboardPoint of action LIKE_RECEIVED, worth 2 points, for the author of a post when a like is created. On the next call it deletes the Like row and leaves the point in place, so the author keeps it, and the next like creates another. A like, unlike and like again sequence adds 2 points per cycle. The view carries no check that the liker is not the author of the post, so the sequence runs against the user's own post, and its only permission class is IsAuthenticated, with no membership needed.
MarkLessonCompleteView (backend/apps/classroom/views.py) creates a LeaderboardPoint of action LESSON_COMPLETED, worth 20 points, under a guard on progress.completed. Its DELETE method sets completed back to False without removing the point, so the guard passes again on the next POST. A complete, uncomplete and complete again sequence adds 20 points per cycle. This path requires an active membership as well as authentication.
LeaderboardPoint.save recalculates user.points as the sum of every point row belonging to the user and persists it on the user. The level property of the user model derives from user.points against ten fixed thresholds, and build_ranking (backend/apps/leaderboards/views.py) orders the top 50 by that same sum. An inflated total therefore carries into the level and into the weekly, monthly and global rankings.
Vulnerability type (CWE)
- CWE-837: Improper Enforcement of a Single, Unique Action
Affected versions
Affected from commit fa3cf76e of 19 July 2026, the first commit of the repository, and fixed in commit 52e19779 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 both views out of the repository at every commit and deciding from the syntax tree whether the award site calls create rather than get_or_create and whether the reversal path removes a LeaderboardPoint. The award is non-idempotent and the reversal withdraws nothing across the nine commits from fa3cf76e to a2ea025a, and both properties hold from 52e19779 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 cycle is driven through the application's HTTP API. The attack complexity is Low and the attack requirements are None, since nothing has to coincide and each cycle succeeds whenever it is issued. The privileges required are Low because an authenticated account is needed: the like path needs nothing beyond authentication, while the lesson path also needs an active membership. The user interaction is None because no other user takes part. Confidentiality on the vulnerable system is None: nothing is read that the account could not already read. Integrity on the vulnerable system is Low because the points, level and ranking are written to values the account did not earn, persistently and without any bound, and the ranking is shared with every other user of the application. Availability is None. The subsequent system metrics are None, since no impact outside the application is demonstrated.
Nothing in the application gates access on points or on level, so the corrupted state is the gamification state itself and no entitlement, content or permission follows from it. That is what keeps the integrity impact at Low.
Solution
Update to commit 52e19779 or later.
Patch
Commit 52e19779274678b95945517dc11b73dfc4436257.
Both award sites call get_or_create instead of create, so a repeated award for the same user, action and reference returns the existing row rather than adding another. A UniqueConstraint on user, action and reference_id is added to LeaderboardPoint.Meta, with the matching migration, so the same guarantee holds at the database level.
Each reversal path now removes the matching point row and then recalculates the total. A new LeaderboardPoint.recalculate static method is extracted from save for that purpose, because a queryset delete() does not call save() and the cached user.points would otherwise keep the withdrawn points.
LikeToggleView awards a point only when post.author_id differs from request.user.id, so liking one's own post no longer scores.
Credits
- Jorge Rey @reddev - 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-141372
Related records
- CVE-2026-141362 - a course edit endpoint in the same application authorising the actor without restricting the fields the request may write