Skip to content
Access control Disclosed report Intermediate

weblate.org: a removed customer owner regains ownership with one GET to /fosdem/donate/, even after token rotation, and can lock out the other owners

Removing an owner from a customer account on weblate.org deletes the owner row but leaves the creator's user_id on the customer record. The creator can then re-add themselves as an owner by visiting a donation page, regaining full control including the rotated service token and the ability to remove other owners.

sujitjaunjal Follow

Originally disclosed on HackerOne

Medium 6.8 View original
  • Fixed in 9 days
  • Disclosed after 39 days

Asset: https://github.com/WeblateOrg/website, the code behind the weblate.org customer portal.

Summary

Removing an owner from a customer account on weblate.org deletes the row from Customer.owners, but it leaves Customer.user_id, the id of the user who created the customer, unchanged. fosdem_donation() and get_customer() look the customer up by that id and add the requester back as an owner:

Python
customer = Customer.objects.get_or_create(
    origin=PAYMENTS_ORIGIN,
    user_id=request.user.id,
    defaults={"email": request.user.email},
)[0]
customer.owners.add(request.user)

So whoever created a customer account can always get back in. In my test the remaining owner did everything the portal offers to revoke access: they removed the creator and pressed "Refresh token" so the old activation token stopped working. The creator then opened /en/fosdem/donate/?amount=30 once and was an owner again. That request sends no invitation, needs no consent, sends no e-mail and writes no log entry. Back as an owner, the creator saw the new token on /en/user/ and removed the owner who had removed them.

Reproduced on WeblateOrg/website main @ 7d0a3f762 (2026-10-16), on a local instance only.

Why this is a security boundary and not intended behaviour

  • b726a3ffd makes owners explicit peers with full control and adds audited removal. The owners box on the account page says owners control "billing, services, secrets, and other owners. Only add people you trust."
  • 550fe33a0 ("fix(security): require consent for customer owners") means a new owner has to accept an invitation first.
  • The project's own test test_owner_can_remove_original_owner (tests.py:1688) removes exactly the user this bug lets back in. Its fixture stores user_id=owner.pk, which is what production stores.

The user_id path skips both controls.

The defect

  • views.py customer_owner() L1234-1246: removal calls owners.remove(owner) and logs an interaction. user_id is not touched.
  • views.py fosdem_donation() L1673-1693: neither @login_required nor POST-only. For any logged-in user it runs the re-add shown above, whatever the user owns at the time.
  • views.py get_customer() L186-205: when the requester owns no customer, which is the state removal leaves them in, it falls through to the same re-add. It is called from DonateView, subscription_new, AddDiscoveryView and DiscoveryRegistrationView, so the normal donate, subscribe and discovery flows re-add the user as well. The regression tests cover the donate form too.

Every self-service customer is created through get_customer() with user_id set to the buyer, so this affects every self-service customer.

Steps to reproduce

Two weblate.org accounts: alex creates the customer, and bianca is the second owner.

  1. alex buys a subscription or makes a donation. The customer is stored with user_id = alex.
  2. alex invites bianca on the owners form, and bianca accepts the e-mailed invitation.
  3. bianca removes alex. alex now gets 404 on /en/customer/<id>/, and the token is gone from alex's /en/user/.
  4. bianca presses "Refresh token" on the service. The old token now gets 404 from /api/support/.
  5. alex opens https://weblate.org/en/fosdem/donate/?amount=30. It redirects to a payment page, and nothing has to be paid.
  6. alex gets 200 on /en/customer/<id>/ again, and /en/user/ shows the new token.
  7. alex removes bianca, and bianca now gets 404.

The run against a local server, from attachment 01:

# 3. bianca removes alex
bianca POST /en/customer/1/owners/             302 -> /en/user/ owner=1&remove=1
alex   GET  /en/customer/1/                    404 <- alex no longer has access
       activation token on alex's /en/user/: none
# 3b. bianca completes the revocation: rotates the activation token alex had seen
bianca POST /en/subscription/token/1/          302 -> /en/user/ Refresh token
       token before pz33sE... after XcGhSA...
anon   POST /api/support/                      404 with the old token <- revoked
# 4. alex is re-added by one GET (no CSRF token, no invitation)
alex   GET  /en/fosdem/donate/?amount=30       302 -> /en/payment/302a6208-.../
alex   GET  /en/customer/1/                    200 <- owner again
       activation token on alex's /en/user/: XcGhSA...  <- the rotated token
       e-mails sent by step 4: 0
# 5. alex removes bianca
alex   POST /en/customer/1/owners/             302 -> /en/user/ owner=2&remove=1
bianca GET  /en/customer/1/                    404 <- bianca locked out

The customer's interaction log afterwards (attachment 02) has bianca removing alex and then alex removing bianca, with nothing in between. Anyone reading the CRM sees a non-owner removing an owner.

The same checks as Django tests (attachment 06, results in 03):

test main @ 7d0a3f762 with fix
removed owner opens /fosdem/donate/, must stay removed FAIL ok
removed owner submits the donate form, must stay removed FAIL ok
removed owner must not be able to remove the remaining owner FAIL ok

Remediation

  1. Minimal fix (attachment 05): when the removed owner's id matches user_id, set user_id to -1. With this applied the three tests pass and the HTTP run stops at step 5 (attachment 04).
  2. Better: in get_customer() and fosdem_donation(), find the customer only through Customer.objects.for_owner(request.user), and create a new customer otherwise. Remove the same user_id fallback from can_download_payment_invoice().
  3. Customers whose creator was removed before the fix still have a stale user_id. A data migration that sets user_id = -1 wherever that user is no longer an owner fixes them.

Attachments

Everything is in weblate-website-removed-owner-reattach-evidence.zip:

  • 01: the HTTP reproduction on unmodified main
  • 02: the customer's interaction log after 01
  • 03: regression test results on main and with the fix
  • 04: the HTTP reproduction with the fix applied
  • 05: the minimal fix as a diff
  • 06: the regression tests, ready to drop into weblate_web/
  • source/: code excerpts with line numbers, the project's original-owner removal test, and the b726a3ffd commit message
  • poc/: the scripts and lab settings used for 01 and 04. mint_sessions.py stands in for the SAML login.

Disclosure

I found this with AI-assisted source review. I reproduced it myself on a local instance and wrote this report. Nothing was tested against weblate.org.

Impact

Removing someone is how a customer takes away their access. The person this bug brings back is the one most likely to be removed: whoever set up the account. That is usually an employee who bought the subscription and later left, or an agency that bought it for a client and handed it over.

The obvious objection is that a former owner already saw everything. The reproduction answers that: bianca took every revocation step the portal offers, removal and token rotation, and alex still came back with the new token. Back as an owner, alex can:

  • regain full owner rights with one GET. The remaining owners are not told, and the CRM log has no entry for it.
  • get the service activation token even after it has been rotated (shown). They can also rotate it themselves, which disconnects the customer's own Weblate instance from its support subscription: step 3b shows that a rotated-out token gets 404 from /api/support/.
  • read and change the customer's billing details (company name, address, VAT ID, billing e-mail) on /en/customer/<id>/, turn off recurring payments so subscriptions lapse, and download agreements and invoices.
  • remove every remaining owner (shown). The paying customer then has no access to their own account until Weblate staff restore it.

Severity: C:H and I:H, because the attacker has full owner rights over billing data, service tokens and the owner list. I scored AC:H instead of AC:L because the attacker has to be the account's creator and has to have been removed. That gives 6.8, Medium.

The original report as published on HackerOne, by sujitjaunjal. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 9 min read.

Context

The target is the code behind the weblate.org customer portal, the repository https://github.com/WeblateOrg/website. Owners are peers: the owners box on the account page states that owners control "billing, services, secrets, and other owners. Only add people you trust."

The feature at the centre of the report is owner removal. A customer account has a set of owners stored in Customer.owners, and any owner can remove another. Removal is meant to be the point at which access ends: the removed user should lose the customer page, the activation token, and any ability to act on the account.

The report shows that removal does not end access for one particular user: the person who created the customer. That user can re-add themselves with a single GET to a donation endpoint, with no CSRF token, even after the remaining owner has rotated the activation token.

Setup

The researcher used two weblate.org accounts on a local instance: alex creates the customer, bianca is the second owner. The reproduction was run against WeblateOrg/website main at commit 7d0a3f762 (2026-10-16), on a local instance only. Nothing was tested against weblate.org.

The evidence bundle is weblate-website-removed-owner-reattach-evidence.zip, containing:

  • 01: the HTTP reproduction on unmodified main
  • 02: the customer's interaction log after 01
  • 03: regression test results on main and with the fix
  • 04: the HTTP reproduction with the fix applied
  • 05: the minimal fix as a diff
  • 06: the regression tests, ready to drop into weblate_web/
  • source/: code excerpts with line numbers, the project's original-owner removal test, and the b726a3ffd commit message
  • poc/: the scripts and lab settings used for 01 and 04; mint_sessions.py stands in for the SAML login

The finding came from AI-assisted source review, and the researcher reproduced it personally on the local instance.

Finding it

The defect is visible in the code. Removing an owner deletes the row from Customer.owners, but it leaves Customer.user_id, the id of the user who created the customer, unchanged. Two code paths look the customer up by that id and add the requester back as an owner:

Python
customer = Customer.objects.get_or_create(
    origin=PAYMENTS_ORIGIN,
    user_id=request.user.id,
    defaults={"email": request.user.email},
)[0]
customer.owners.add(request.user)

So whoever created a customer account can always get back in. The researcher's test had the remaining owner do everything the portal offers to revoke access: remove the creator, then press "Refresh token" so the old activation token stopped working. The creator then opened /en/fosdem/donate/?amount=30 once and was an owner again. That request sends no invitation, needs no consent, sends no e-mail and writes no log entry. Back as an owner, the creator saw the new token on /en/user/ and removed the owner who had removed them.

The researcher argues this is a security boundary and not intended behaviour, citing three pieces of project history:

  • b726a3ffd makes owners explicit peers with full control and adds audited removal. The owners box on the account page says owners control "billing, services, secrets, and other owners. Only add people you trust."
  • 550fe33a0 ("fix(security): require consent for customer owners") means a new owner has to accept an invitation first.
  • The project's own test test_owner_can_remove_original_owner (tests.py:1688) removes exactly the user this bug lets back in. Its fixture stores user_id=owner.pk, which is what production stores.

The user_id path skips both controls: the consent requirement for new owners and the audited removal.

Exploitation

The defect has three parts, as the report lays them out:

  • views.py customer_owner() L1234-1246: removal calls owners.remove(owner) and logs an interaction. user_id is not touched.
  • views.py fosdem_donation() L1673-1693: neither @login_required nor POST-only. For any logged-in user it runs the re-add shown above, whatever the user owns at the time.
  • views.py get_customer() L186-205: when the requester owns no customer, which is the state removal leaves them in, it falls through to the same re-add. It is called from DonateView, subscription_new, AddDiscoveryView and DiscoveryRegistrationView, so the normal donate, subscribe and discovery flows re-add the user as well. The regression tests cover the donate form too.

Every self-service customer is created through get_customer() with user_id set to the buyer, so this affects every self-service customer.

Step 1: alex creates the customer

alex buys a subscription or makes a donation. The customer is stored with user_id = alex.

Step 2: bianca becomes a second owner

alex invites bianca on the owners form, and bianca accepts the e-mailed invitation. This is the consent flow introduced by 550fe33a0.

Step 3: bianca removes alex

bianca removes alex. alex now gets 404 on /en/customer/<id>/, and the token is gone from alex's /en/user/.

In the HTTP run against the local server:

HTTP
# 3. bianca removes alex
bianca POST /en/customer/1/owners/             302 -> /en/user/ owner=1&remove=1
alex   GET  /en/customer/1/                    404 <- alex no longer has access
       activation token on alex's /en/user/: none

The POST to /en/customer/1/owners/ with owner=1&remove=1 returns a 302 to /en/user/. alex's subsequent GET of the customer page returns 404, and alex's user page shows no activation token. At this point the removal looks complete.

Step 3b: bianca rotates the activation token

bianca completes the revocation by rotating the activation token alex had seen:

HTTP
# 3b. bianca completes the revocation: rotates the activation token alex had seen
bianca POST /en/subscription/token/1/          302 -> /en/user/ Refresh token
       token before pz33sE... after XcGhSA...

The POST to /en/subscription/token/1/ returns a 302 to /en/user/. The token changes from pz33sE... to XcGhSA.... The old token is then checked against the support API:

HTTP
anon   POST /api/support/                      404 with the old token <- revoked

The old token now gets 404 from /api/support/, confirming the rotation took effect.

Step 4: alex re-adds themselves with one GET

alex opens https://weblate.org/en/fosdem/donate/?amount=30. It redirects to a payment page, and nothing has to be paid.

HTTP
# 4. alex is re-added by one GET (no CSRF token, no invitation)
alex   GET  /en/fosdem/donate/?amount=30       302 -> /en/payment/302a6208-.../
alex   GET  /en/customer/1/                    200 <- owner again
       activation token on alex's /en/user/: XcGhSA...  <- the rotated token
       e-mails sent by step 4: 0

The GET to /en/fosdem/donate/?amount=30 returns a 302 to a payment page. No CSRF token is needed, no invitation is sent, and no payment is required. alex's next GET of /en/customer/1/ returns 200: alex is an owner again. alex's /en/user/ page shows the rotated token XcGhSA..., the one bianca had just issued. Zero e-mails were sent by step 4.

Step 5: alex removes bianca

HTTP
# 5. alex removes bianca
alex   POST /en/customer/1/owners/             302 -> /en/user/ owner=2&remove=1
bianca GET  /en/customer/1/                    404 <- bianca locked out

alex posts to /en/customer/1/owners/ with owner=2&remove=1, gets a 302 to /en/user/, and bianca's GET of the customer page returns 404. The owner who removed alex is now locked out.

The customer's interaction log afterwards (attachment 02) has bianca removing alex and then alex removing bianca, with nothing in between. Anyone reading the CRM sees a non-owner removing an owner: the re-add in step 4 left no entry.

Regression tests

The same checks were written as Django tests (attachment 06, results in 03):

test main @ 7d0a3f762 with fix
removed owner opens /fosdem/donate/, must stay removed FAIL ok
removed owner submits the donate form, must stay removed FAIL ok
removed owner must not be able to remove the remaining owner FAIL ok

On unmodified main all three fail; the table shows ok with the fix.

Root cause

Removal deletes the Customer.owners row but leaves Customer.user_id pointing at the creator. Both fosdem_donation() and get_customer() use that id as a lookup key and then call customer.owners.add(request.user). The creator is therefore re-added whenever they touch any flow that goes through those functions.

The existing defences do not cover this path:

  • The consent requirement from 550fe33a0 applies to invitations, not to the user_id re-add.
  • The audited removal from b726a3ffd logs the removal, but the re-add writes no log entry, so the audit trail shows a non-owner removing an owner.
  • Token rotation revokes the old token, but the re-added owner is shown the new token on /en/user/, so rotation does not help.

fosdem_donation() is neither @login_required nor POST-only, so a plain GET is enough to trigger the re-add. get_customer() falls through to the same re-add when the requester owns no customer, which is exactly the state removal leaves them in, and it is called from DonateView, subscription_new, AddDiscoveryView and DiscoveryRegistrationView.

Impact

Removing someone is how a customer takes away their access. The person this bug brings back is the one most likely to be removed: whoever set up the account. That is usually an employee who bought the subscription and later left, or an agency that bought it for a client and handed it over.

The obvious objection is that a former owner already saw everything. The reproduction answers that: bianca took every revocation step the portal offers, removal and token rotation, and alex still came back with the new token. Back as an owner, alex can:

  • regain full owner rights with one GET. The remaining owners are not told, and the CRM log has no entry for it.
  • get the service activation token even after it has been rotated (shown). They can also rotate it themselves, which disconnects the customer's own Weblate instance from its support subscription: step 3b shows that a rotated-out token gets 404 from /api/support/.
  • read and change the customer's billing details (company name, address, VAT ID, billing e-mail) on /en/customer/<id>/, turn off recurring payments so subscriptions lapse, and download agreements and invoices.
  • remove every remaining owner (shown). The paying customer then has no access to their own account until Weblate staff restore it.

The researcher scored C:H and I:H, because the attacker has full owner rights over billing data, service tokens and the owner list. AC:H instead of AC:L was chosen because the attacker has to be the account's creator and has to have been removed. That gives 6.8, Medium.

Fix

The report proposes three remediation steps.

  1. Minimal fix (attachment 05): when the removed owner's id matches user_id, set user_id to -1. With this applied the three tests pass and the HTTP run stops at step 5 (attachment 04).
  2. Better: in get_customer() and fosdem_donation(), find the customer only through Customer.objects.for_owner(request.user), and create a new customer otherwise. Remove the same user_id fallback from can_download_payment_invoice().
  3. Customers whose creator was removed before the fix still have a stale user_id. A data migration that sets user_id = -1 wherever that user is no longer an owner fixes them.

Variants to test

  • Look for any model where a "creator" or "owner" foreign key survives removal of the corresponding membership row, and where a lookup by that key is followed by an add or grant. A positive result is a removed user regaining access through a normal flow without an invitation or consent step.
  • Check GET endpoints that mutate membership or billing state. A positive result is a state change from a plain GET with no CSRF token, visible in the account state afterwards.
  • Check whether re-adds write an audit entry. A positive result is a membership change that appears in the account state but not in the interaction log.
  • Check whether token rotation invalidates access for users who can re-enter through a fallback path. A positive result is a rotated-out token being shown to, or usable by, a user who should no longer have access.
  • Check other callers of the same lookup helper (DonateView, subscription_new, AddDiscoveryView, DiscoveryRegistrationView in this codebase) for the same fallback. A positive result is any of those flows re-adding a removed user.
  • Check invoice and agreement download paths for the same user_id fallback. A positive result is a removed user downloading documents after removal.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 19 min read.

What happened, in plain words

Weblate runs a website where people who pay for the service manage their account. That website is called the customer portal. It is built from code kept in a public repository, https://github.com/WeblateOrg/website, and the report is about that code, not about the live weblate.org site.

A customer account can have several owners. An owner is a person with full control over the account: they can see and change billing details, manage the service, see secret values such as the activation token, and add or remove other owners. The account page itself tells owners that they control "billing, services, secrets, and other owners. Only add people you trust."

Because owners can remove each other, removal is supposed to be the moment access ends. Once you are removed, you should lose the customer page, you should lose the activation token, and you should not be able to do anything to the account any more.

The report shows that removal does not work that way for one special person: the person who originally created the customer account. That person can put themselves back as an owner by opening a single ordinary web address in their browser, even after the remaining owner has done everything the portal offers to cut them off, including replacing the activation token.

To understand why, you need one idea from web programming. The portal keeps its data in a database, which is like a set of linked spreadsheets. One spreadsheet holds the list of owners of each customer. Another column on the customer record holds the id (a unique number) of the user who created that customer. When someone is removed, their row is deleted from the owners list, but the "created by" number is left alone. Some parts of the code look a customer up by that "created by" number and then quietly add the person back to the owners list. That is the whole bug.

The product and the feature

Weblate is a translation platform. Customers pay for a subscription, and the portal is where they manage it.

  • creating a customer account and managing its owners;
  • storing billing details (company name, address, VAT ID, billing e-mail);
  • issuing and rotating the service activation token;
  • handling donations and subscriptions.

An activation token is a long random string that acts like a key. The customer's own Weblate installation presents it to the support service to prove it belongs to a paying subscription. If the token is replaced ("rotated"), the old one stops working, which is exactly what you want when someone who should no longer have access might still know the old one.

A token in general is a secret string that stands in for a password. A cookie is a small piece of data your browser stores for a site and sends back with requests to that site, and it is usually how a site remembers that you are logged in. A CSRF token is a different thing: a special value a well-built site puts inside forms so that the server can tell a genuine form submission from a request that some other website tricked your browser into making. If an action can be triggered by a plain link or a typed address, with no CSRF token, that is a weakness, because a link can be sent to someone or embedded anywhere.

An API is a way for one program to talk to another over the web, using ordinary web addresses and requests. The support API here lives at /api/support/ and checks activation tokens.

A GET is the kind of web request your browser makes when you simply open a page or click a link. A POST is the kind when you submit a form. A well-designed site uses POST for anything that changes data, because a GET can be triggered just by opening a link.

An HTTP status code is the three-digit number a server sends back. 200 means "here is the page, all fine". 302 means "the page has moved, go here instead" (a redirect). 404 means "not found", which is what a site returns when the requested page does not exist or is not available to you.

The vulnerability class

The report is filed under Improper Access Control. Access control means the rules about who is allowed to do what. Improper access control means those rules exist on paper but some path through the code skips them. Here the rule is "a removed owner must not be able to act on the account", and the skipped path is the "created by" lookup described above.

Setting up the test

The researcher used two accounts on a copy of the portal running on their own computer (a local instance, meaning the software was installed locally rather than on the real weblate.org servers). One account, called alex, creates the customer. The other, called bianca, is invited as a second owner.

The code tested was the main branch of WeblateOrg/website at commit 7d0a3f762, dated 2026-10-16. A commit is a saved snapshot of a code repository, identified by a short code like that. Nothing was tested against the real weblate.org.

The evidence was collected in a zip file, weblate-website-removed-owner-reattach-evidence.zip, containing:

  • 01: the HTTP reproduction on unmodified main
  • 02: the customer's interaction log after 01
  • 03: regression test results on main and with the fix
  • 04: the HTTP reproduction with the fix applied
  • 05: the minimal fix as a diff
  • 06: the regression tests, ready to drop into weblate_web/
  • source/: code excerpts with line numbers, the project's original-owner removal test, and the b726a3ffd commit message
  • poc/: the scripts and lab settings used for 01 and 04; mint_sessions.py stands in for the SAML login

A diff is a file showing exactly which lines of code change. Regression tests are automated checks that confirm a bug stays fixed. SAML is a standard way for a site to let you log in through a separate identity provider; mint_sessions.py is a helper script that creates logged-in sessions so the researcher does not have to click through a real login each time.

The finding came from reviewing the source code with AI assistance, and the researcher then reproduced it personally on the local instance.

Finding it

The bug is visible by reading the code. Removing an owner deletes the row from Customer.owners, but it leaves Customer.user_id, the id of the user who created the customer, unchanged. Two code paths look the customer up by that id and add the requester back as an owner:

Python
customer = Customer.objects.get_or_create(
    origin=PAYMENTS_ORIGIN,
    user_id=request.user.id,
    defaults={"email": request.user.email},
)[0]
customer.owners.add(request.user)

Line by line:

  • Customer.objects.get_or_create( starts a database lookup: find the customer record matching the conditions below, and if there is none, create one.
  • origin=PAYMENTS_ORIGIN, says the record must belong to the payments area of the site.
  • user_id=request.user.id, is the key condition: the customer whose "created by" number equals the id of the user making the current request. request.user is the logged-in user, and .id is their unique number.
  • defaults={"email": request.user.email}, says what to fill in if a new record has to be created: the requester's e-mail address.
  • )[0] takes the first (and only) result.
  • customer.owners.add(request.user) then adds the requester to the owners list of that customer.

So whoever created a customer account can always get back in. In the test, the remaining owner did everything the portal offers to revoke access: they removed the creator, then pressed "Refresh token" so the old activation token stopped working. The creator then opened /en/fosdem/donate/?amount=30 once and was an owner again. That request sends no invitation, needs no consent, sends no e-mail and writes no log entry. Back as an owner, the creator saw the new token on /en/user/ and removed the owner who had removed them.

The researcher argues this is a security boundary and not intended behaviour, citing three pieces of project history:

  • b726a3ffd makes owners explicit peers with full control and adds audited removal. The owners box on the account page says owners control "billing, services, secrets, and other owners. Only add people you trust."
  • 550fe33a0 ("fix(security): require consent for customer owners") means a new owner has to accept an invitation first.
  • The project's own test test_owner_can_remove_original_owner (tests.py:1688) removes exactly the user this bug lets back in. Its fixture stores user_id=owner.pk, which is what production stores.

In plain terms: the project deliberately made owners equal partners with real power, deliberately made removal recorded in a log, and deliberately required a new owner to accept an invitation. The project even has a test for removing the original owner. The user_id path skips both controls: the consent requirement for new owners and the audited removal.

Exploitation

The defect has three parts, as the report lays them out:

  • views.py customer_owner() L1234-1246: removal calls owners.remove(owner) and logs an interaction. user_id is not touched.
  • views.py fosdem_donation() L1673-1693: neither @login_required nor POST-only. For any logged-in user it runs the re-add shown above, whatever the user owns at the time.
  • views.py get_customer() L186-205: when the requester owns no customer, which is the state removal leaves them in, it falls through to the same re-add. It is called from DonateView, subscription_new, AddDiscoveryView and DiscoveryRegistrationView, so the normal donate, subscribe and discovery flows re-add the user as well. The regression tests cover the donate form too.

A few words on that. views.py is the file that handles incoming web requests. @login_required is a marker that tells the framework to refuse the request unless the user is logged in; without it, the code runs for anyone. "POST-only" means the action should only be accepted when a form is submitted, not when a page is simply opened. get_customer() is a helper function used by several pages, and "falls through" means that when its normal lookup finds nothing, it continues to the re-add code instead of stopping.

Every self-service customer is created through get_customer() with user_id set to the buyer, so this affects every self-service customer.

Step 1: alex creates the customer

alex buys a subscription or makes a donation. The customer is stored with user_id = alex.

Why this matters: the "created by" number is now alex's id, and removal does not clear it.

Step 2: bianca becomes a second owner

alex invites bianca on the owners form, and bianca accepts the e-mailed invitation. This is the consent flow introduced by 550fe33a0.

Why this matters: it shows the project intends a new owner to agree before gaining power. The user_id re-add skips that consent requirement.

Step 3: bianca removes alex

bianca removes alex. alex now gets 404 on /en/customer/<id>/, and the token is gone from alex's /en/user/.

In the HTTP run against the local server:

HTTP
# 3. bianca removes alex
bianca POST /en/customer/1/owners/             302 -> /en/user/ owner=1&remove=1
alex   GET  /en/customer/1/                    404 <- alex no longer has access
       activation token on alex's /en/user/: none

Line by line:

  • The first line is a comment saying this is step 3, bianca removing alex.
  • bianca POST /en/customer/1/owners/ means bianca submits a form to the owners page of customer number 1. The form data is owner=1&remove=1: remove the owner whose id is 1 (alex).
  • 302 -> /en/user/ is the server's answer: a redirect to the user page, which is where the portal sends you after a successful change.
  • alex GET /en/customer/1/ means alex simply opens the customer page.
  • 404 <- alex no longer has access is the server's answer: not found, because alex is no longer an owner.
  • activation token on alex's /en/user/: none records that alex's own user page no longer shows any activation token.

At this point the removal looks complete. This step was taken to establish the normal, expected behaviour before showing the bug.

Step 3b: bianca rotates the activation token

bianca completes the revocation by rotating the activation token alex had seen:

HTTP
# 3b. bianca completes the revocation: rotates the activation token alex had seen
bianca POST /en/subscription/token/1/          302 -> /en/user/ Refresh token
       token before pz33sE... after XcGhSA...

Line by line:

  • The comment says this is the extra step bianca takes to finish cutting alex off.
  • bianca POST /en/subscription/token/1/ means bianca submits the "Refresh token" action for subscription number 1.
  • 302 -> /en/user/ is the redirect back to the user page after the change.
  • token before pz33sE... after XcGhSA... records that the token value changed from one string to another. The dots mean the value is shortened in the log.

The old token is then checked against the support API:

HTTP
anon   POST /api/support/                      404 with the old token <- revoked

Line by line:

  • anon means the request is made without being logged in, as an anonymous client would.
  • POST /api/support/ is a request to the support API.
  • 404 with the old token means the server answered "not found" when the old token was presented.
  • <- revoked is the researcher's note: the old token no longer works, so the rotation took effect.

Why this step was taken: to prove that the remaining owner used every tool the portal offers. If the bug still works after this, it is not a matter of the old owner simply remembering an old secret.

Step 4: alex re-adds themselves with one GET

alex opens https://weblate.org/en/fosdem/donate/?amount=30. It redirects to a payment page, and nothing has to be paid.

HTTP
# 4. alex is re-added by one GET (no CSRF token, no invitation)
alex   GET  /en/fosdem/donate/?amount=30       302 -> /en/payment/302a6208-.../
alex   GET  /en/customer/1/                    200 <- owner again
       activation token on alex's /en/user/: XcGhSA...  <- the rotated token
       e-mails sent by step 4: 0

Line by line:

  • The comment says this is step 4, and that alex is re-added by a single GET, with no CSRF token and no invitation.
  • alex GET /en/fosdem/donate/?amount=30 means alex opens the donation page with an amount of 30 in the address. ?amount=30 is a query parameter, a value attached to the end of a web address.
  • 302 -> /en/payment/302a6208-.../ is the redirect to a payment page. The long string is a payment reference; the dots shorten it.
  • alex GET /en/customer/1/ means alex opens the customer page again.
  • 200 <- owner again is the server's answer: the page loads normally, so alex is an owner once more.
  • activation token on alex's /en/user/: XcGhSA... records that alex's user page now shows the new token, the one bianca had just issued.
  • e-mails sent by step 4: 0 records that no notification e-mail went out.

Why this step was taken: it is the actual attack. It shows that opening a normal page, with no form, no secret value and no payment, is enough to undo the removal. The fact that the redirect goes to a payment page is a distraction: the re-add happens before any payment, and nothing has to be paid.

Step 5: alex removes bianca

HTTP
# 5. alex removes bianca
alex   POST /en/customer/1/owners/             302 -> /en/user/ owner=2&remove=1
bianca GET  /en/customer/1/                    404 <- bianca locked out

Line by line:

  • The comment says this is step 5, alex removing bianca.
  • alex POST /en/customer/1/owners/ means alex submits the owners form for customer 1, with owner=2&remove=1: remove the owner whose id is 2 (bianca).
  • 302 -> /en/user/ is the redirect after the change.
  • bianca GET /en/customer/1/ means bianca opens the customer page.
  • 404 <- bianca locked out is the server's answer: not found, because bianca is no longer an owner.

Why this step was taken: to show the consequence. The owner who removed alex is now locked out.

The customer's interaction log afterwards (attachment 02) has bianca removing alex and then alex removing bianca, with nothing in between. Anyone reading the CRM sees a non-owner removing an owner: the re-add in step 4 left no entry. A CRM here is the customer record system the portal keeps, and the interaction log is the list of actions recorded against the customer.

Regression tests

The same checks were written as Django tests (attachment 06, results in 03). Django is the web framework the portal is built with, and its tests are small programs that exercise the code automatically.

test main @ 7d0a3f762 with fix
removed owner opens /fosdem/donate/, must stay removed FAIL ok
removed owner submits the donate form, must stay removed FAIL ok
removed owner must not be able to remove the remaining owner FAIL ok

On unmodified main all three fail; the table shows ok with the fix. Why this matters: the tests turn the report into something the developers can run themselves, and they cover both the plain GET and the form submission.

Root cause

Removal deletes the Customer.owners row but leaves Customer.user_id pointing at the creator. Both fosdem_donation() and get_customer() use that id as a lookup key and then call customer.owners.add(request.user). The creator is therefore re-added whenever they touch any flow that goes through those functions.

The existing defences do not cover this path:

  • The consent requirement from 550fe33a0 applies to invitations, not to the user_id re-add.
  • The audited removal from b726a3ffd logs the removal, but the re-add writes no log entry, so the audit trail shows a non-owner removing an owner.
  • Token rotation revokes the old token, but the re-added owner is shown the new token on /en/user/, so rotation does not help.

fosdem_donation() is neither @login_required nor POST-only, so a plain GET is enough to trigger the re-add. get_customer() falls through to the same re-add when the requester owns no customer, which is exactly the state removal leaves them in, and it is called from DonateView, subscription_new, AddDiscoveryView and DiscoveryRegistrationView.

Impact

Removing someone is how a customer takes away their access. The person this bug brings back is the one most likely to be removed: whoever set up the account. That is usually an employee who bought the subscription and later left, or an agency that bought it for a client and handed it over.

The obvious objection is that a former owner already saw everything. The reproduction answers that: bianca took every revocation step the portal offers, removal and token rotation, and alex still came back with the new token. Back as an owner, alex can:

  • regain full owner rights with one GET. The remaining owners are not told, and the CRM log has no entry for it.
  • get the service activation token even after it has been rotated (shown). They can also rotate it themselves, which disconnects the customer's own Weblate instance from its support subscription: step 3b shows that a rotated-out token gets 404 from /api/support/.
  • read and change the customer's billing details (company name, address, VAT ID, billing e-mail) on /en/customer/<id>/, turn off recurring payments so subscriptions lapse, and download agreements and invoices.
  • remove every remaining owner (shown). The paying customer then has no access to their own account until Weblate staff restore it.

The researcher scored C:H and I:H, because the attacker has full owner rights over billing data, service tokens and the owner list. AC:H instead of AC:L was chosen because the attacker has to be the account's creator and has to have been removed. That gives 6.8, Medium.

Those letters come from CVSS, a standard scoring system for vulnerabilities. C is confidentiality, how much secret data can be exposed; I is integrity, how much data can be changed. H means high. AC is attack complexity: L means low, easy to do; H means high, meaning conditions have to line up. The score of 6.8 puts the issue in the Medium band.

Fix

The report proposes three remediation steps.

  1. Minimal fix (attachment 05): when the removed owner's id matches user_id, set user_id to -1. With this applied the three tests pass and the HTTP run stops at step 5 (attachment 04).
  2. Better: in get_customer() and fosdem_donation(), find the customer only through Customer.objects.for_owner(request.user), and create a new customer otherwise. Remove the same user_id fallback from can_download_payment_invoice().
  3. Customers whose creator was removed before the fix still have a stale user_id. A data migration that sets user_id = -1 wherever that user is no longer an owner fixes them.

In plain terms: the minimal fix breaks the link between the removed person and the customer at the moment of removal, so the lookup finds nothing. The better fix stops using the "created by" number as a way in, looking the customer up through for_owner instead. The third item is housekeeping for accounts that were already affected: a data migration is a one-off script that updates existing records in the database.

Variants to test

These are the general lessons the researcher suggests looking for elsewhere:

  • Look for any model where a "creator" or "owner" foreign key survives removal of the corresponding membership row, and where a lookup by that key is followed by an add or grant. A positive result is a removed user regaining access through a normal flow without an invitation or consent step.
  • Check GET endpoints that mutate membership or billing state. A positive result is a state change from a plain GET with no CSRF token, visible in the account state afterwards.
  • Check whether re-adds write an audit entry. A positive result is a membership change that appears in the account state but not in the interaction log.
  • Check whether token rotation invalidates access for users who can re-enter through a fallback path. A positive result is a rotated-out token being shown to, or usable by, a user who should no longer have access.
  • Check other callers of the same lookup helper (DonateView, subscription_new, AddDiscoveryView, DiscoveryRegistrationView in this codebase) for the same fallback. A positive result is any of those flows re-adding a removed user.
  • Check invoice and agreement download paths for the same user_id fallback. A positive result is a removed user downloading documents after removal.

A foreign key is a database field that points at a record in another table, like the "created by" number pointing at a user. An endpoint is a specific web address the server responds to. Mutate means change data. Audit entry means a line in the log of who did what.

Glossary

  • Access control: the rules that decide who may do what on a site.
  • Activation token: a secret string that proves a customer's Weblate installation belongs to a paying subscription.
  • API: a way for one program to talk to another over the web, using web addresses and requests.
  • Audit entry: a recorded line in a log showing that an action happened and who did it.
  • Commit: a saved snapshot of a code repository, identified by a short code.
  • Cookie: a small piece of data a browser stores for a site and sends back with each request, often used to remember a login.
  • CRM: the system a company uses to keep records about its customers.
  • CSRF token: a secret value placed inside a form so the server can tell a genuine submission from one triggered by another site.
  • CVSS: a standard scoring system for vulnerabilities, using letters such as C, I and AC and a number out of ten.
  • Data migration: a one-off script that updates existing records in a database.
  • Diff: a file showing exactly which lines of code change.
  • Django: the web framework the portal is built with, which also provides a way to write automated tests.
  • Endpoint: a specific web address that a server responds to.
  • Foreign key: a database field that points at a record in another table.
  • GET: the kind of web request made when you open a page or click a link.
  • HTTP status code: the three-digit number a server returns, such as 200 (fine), 302 (redirect) or 404 (not found).
  • Improper access control: a vulnerability where the rules about who may do what exist but some code path skips them.
  • Local instance: a copy of the software running on the researcher's own computer rather than on the real site.
  • Mutate: to change data.
  • Owner: a person with full control over a customer account, including billing, service settings, secrets and other owners.
  • POST: the kind of web request made when you submit a form.
  • Query parameter: a value attached to the end of a web address after a question mark.
  • Regression test: an automated check that confirms a fixed bug stays fixed.
  • SAML: a standard way for a site to let you log in through a separate identity provider.
  • Token: a secret string that stands in for a password.
  • Token rotation: replacing a token with a new one so the old one stops working.
  • Vulnerability: a weakness in software that lets someone do something they should not be able to do.

More by sujitjaunjal

View all

8 more disclosed reports, best first.

More from Weblate

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

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.