Skip to content

Conversation

@Maffooch
Copy link
Contributor

Implement notes management for the RiskAcceptanceViewSet, allowing users to retrieve and add notes associated with risk acceptance entries. This enhancement includes GET and POST actions for managing notes effectively.

@Maffooch Maffooch requested a review from mtesauro as a code owner January 27, 2026 00:53
@github-actions github-actions bot added the apiv2 label Jan 27, 2026
@dryrunsecurity
Copy link

DryRun Security

This pull request introduces a race condition in RiskAcceptanceViewSet: the notes action uses a check-then-act pattern to enforce a single-note-per-type rule without using transactions or locks, so concurrent requests can both pass the check and create duplicate 'single' type notes, violating the intended business restriction.

Race Condition in dojo/api_v2/views.py
Vulnerability Race Condition
Description The notes action in RiskAcceptanceViewSet implements a check-then-act pattern to enforce that only one note of a specific 'single' type can be added to a risk acceptance. However, this check is performed without database transactions or locking. Concurrent requests can both pass the initial check before either has created the new note, leading to multiple notes of the same 'single' type being associated with the risk acceptance, bypassing the intended business logic restriction.

if notes and note_type and note_type.is_single:
return Response("Only one instance of this note_type allowed on a risk acceptance.", status=status.HTTP_400_BAD_REQUEST)
author = request.user


All finding details can be found in the DryRun Security Dashboard.

@Maffooch Maffooch added this to the 2.55.0 milestone Jan 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants