[Bug]: 2nd level approval: approver not recorded on "Proceed", and reviewers can release their own held decisions

Open
#16,538 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
django, python
Domain
backend, security

Research direction

Start with reviewers/views.py (decision_review), reviewers/forms.py (HeldDecisionReviewForm.clean), and reviewers/utils.py for the held-decision queue; trace how released actions record their actor and how pending rejections retain attribution. Add coverage for both self-release prevention and recording the resolving user on each resolution path. Done means the approver is auditable and a reviewer cannot silently release their own held decision.

Written by the indexing model from the issue text.

Description

Is there an existing issue for this?
  • I have searched the existing issues
What happened?

Two problems with 2nd level approval (held decisions, reviewers.decision_review):

  1. The user who resolves a held decision is not recorded in all cases. When the original decision has a reviewer_user, choosing "Proceed with action" records nothing that identifies the approver. All resulting activity is attributed to the original reviewer.
  2. Nothing prevents the reviewer who created a held decision from releasing it themselves, as long as they have ADDONS_HIGH_IMPACT_APPROVE.

Together, these mean that for reviewer-initiated holds it is impossible to tell from AMO data who approved the action, or whether a second person reviewed it at all.

1. Approver attribution, by resolution path
2nd level choice What is created Approver recorded?
Approve content instead New ContentDecision (AMO_APPROVE) with reviewer_user=request.user, override_of=<held decision> Yes
Cancel and enqueue in Reviewer Tools New ContentDecision (AMO_REQUEUE) with reviewer_user=request.user, plus a "Flagged for human review" activity log by the approver Yes
Proceed with action, held decision has no reviewer_user (Cinder/TaskUs-initiated) No new decision. execute_action(release_hold=True) logs with no explicit user, so ActivityLogManager.create falls back to core.get_user() (the approver) Yes, indirectly
Proceed with action, held decision has a reviewer_user (reviewer- or automation-initiated) No new decision. ContentAction.log_action passes user=self.decision.reviewer_user, so every resulting activity log is attributed to the original reviewer No

The last row also affects downstream data:

  • ContentActionRejectVersionDelayed.process_action sets VersionReviewerFlags.pending_rejection_by = self.decision.reviewer_user on release, so the later automatic rejection is also attributed to the original reviewer.
  • The add-on's review history page shows the released action (e.g. "Rejection scheduled") as performed by the original reviewer, at the time of the 2nd level release.

No other record of the approver exists: no override decision, no activity log entry by the approver, no field on ContentDecision. A check of activity logs on affected add-ons around the release time found only entries by the original reviewer or the task user.

2. No self-approval guard
  • decision_review (reviewers/views.py) only requires ADDONS_HIGH_IMPACT_APPROVE.
  • HeldDecisionReviewForm.clean (reviewers/forms.py) only checks the decision is still held (ContentDecision.objects.awaiting_action()).
  • The held decisions queue (reviewers/utils.py) lists all awaiting_action() decisions, including the viewer's own.

None of these compare request.user with decision.reviewer_user.

Steps to reproduce
  1. As a reviewer with ADDONS_HIGH_IMPACT_APPROVE, take an action on a high-profile promoted add-on that gets held (e.g. reject versions).
  2. As the same user, open the held decisions queue (/reviewers/queue/held_decisions) and choose "Proceed with action" on that decision.
    • Expected: blocked, or at least recorded as a self-approval.
    • Actual: allowed.
  3. Repeat step 2 as a different 2nd level approver.
    • Expected: the approver is recorded somewhere (activity log, decision field).
    • Actual: the review history and activity log show only the original reviewer. Nothing identifies who approved.
What did you expect to happen?
Expected behavior
  • Every 2nd level resolution records the user who made it, including "Proceed with action". Options: an activity log entry by request.user when a hold is released, and/or an approver field on ContentDecision (e.g. released_by).
  • A reviewer cannot release a held decision they created (request.user != decision.reviewer_user), or such releases are explicitly flagged if self-release is intentionally allowed.
Impact
  • No audit trail for who approved high-impact actions on promoted add-ons.
  • The 2nd level "second pair of eyes" control can be bypassed by the original reviewer without any trace.
  • Reporting on 2nd level approval cannot attribute most "Proceed" outcomes.

┆Issue is synchronized with this Jira Task

Dominant language
Makefile
Stars
135
Forks
52
Avg merge
6d 18h
Merged PRs (30d)
7

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

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 mozilla/addons

All issues in mozilla/addons

Similar issues

More Backend & API Design issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.