Summary
parkour2 is a Django and DRF laboratory information management system for
next-generation sequencing. Its approval endpoint, ApproveViewSet, is
registered with AllowAny, so it executes for unauthenticated callers even
though the project’s global default is IsAuthenticated.
The endpoint gates approval behind a token check: it compares a token query
parameter against the token stored on the target request. The flaw is that a
freshly submitted request stores no token at all, and an attacker who simply
omits the query parameter supplies no token either. Both sides of the
comparison are then None, None == None is true, and the request is approved
with no secret and no session.
An unauthenticated attacker enumerates sequential request ids at
/api/approve/this/ and approves any request that has not yet been sent for
approval, moving its libraries and samples to the approved state without the
principal investigator ever signing off. Fixed in parkour2 26.11.26.
The vulnerable code
backend/request/views.py, condensed to the relevant path:
class ApproveViewSet(viewsets.ViewSet):
permission_classes = [AllowAny] # overrides the global IsAuthenticated
def this(self, request):
pk = request.query_params.get("pk")
token = request.query_params.get("token") # None when the param is absent
instance = list(Request.objects.filter(id=pk))[0]
if not all(status == 0 for status in instance.statuses):
raise ... # only blocks already-processed requests
if token == instance.token: # None == None is True
# approve: libraries and samples move to status 1,
# the token is cleared, the record is saved
...
Why the check passes
Three facts combine into an unauthenticated approval:
Request.tokenis aCharField(null=True)with no default. It staysNoneuntilsolicit_approvalassigns a 30 character random string. A request that has only been submitted, and not yet sent for approval, has aNonetoken.request.query_params.get("token")returnsNonewhen the parameter is absent, so an attacker who sends no token comparesNone == None, which is true. No secret is needed.- The only other guard,
all(status == 0 for status in instance.statuses), is vacuously true for a request with no records and true for a freshly submitted request whose records are all at status 0, so it does not block the pending requests this targets.
Requests that have genuinely been sent for approval hold a real 30 character
token, so None == <real token> is false and they stay protected. The exposure
is precisely the set of submitted-but-not-yet-solicited requests.
Proof of concept
Against a local instance running the pinned Django 5.2.19 and DRF 3.18.3 stack,
with ApproveViewSet under AllowAny and the global default set to
IsAuthenticated, an unauthenticated request:
GET /api/approve/this/?pk=<id>
with no token parameter returns 200 with approved: true for a pending
request whose stored token is None. A request with no records behaves the
same way. The control cases hold: a solicited request carrying a real token
returns 400 for a missing or wrong token, and a second attempt after approval
is blocked by the status guard, confirming the state really changed.
Impact
The vulnerability is network reachable, needs no authentication, and is trivial
to trigger by iterating request ids. Its effect is on integrity: an attacker
advances libraries and samples from submitted to approved without principal
investigator sign-off, and the stored approval record is written with the
attacker’s address and user agent. There is no direct confidentiality or
availability impact, and a staff member can reverse the status, which is why the
assigned score is Medium (CVSS 3.1 AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N, 5.3).
The governance control that an approval is meant to represent is defeated for
every request still awaiting its approval token.
The fix
The fix in backend/request/views.py rejects a missing or empty token before
the comparison and replaces the equality check with a constant-time one:
import hmac
if not token or not instance.token:
raise ValueError("Missing approval token.")
if hmac.compare_digest(str(token), str(instance.token)):
...
Requiring a non-null stored token means a request must actually have been sent
for approval before it can be approved, and hmac.compare_digest removes the
None == None short circuit. Merged in PR #396 and released in 26.11.26.
Disclosure
- 2026-11-22: reported privately to the maintainers.
- 2026-11-24: fix merged (PR #396), released in
26.11.26. - 2026-12-01: CVE-2026-141317 assigned.