kolibri
Affected
- introduced
0, fixed0.19.4(ecosystem)
Fixed versions
0.19.4
Fix
- Fixed version
0.19.4pip install --upgrade kolibri==0.19.4
Advisory
Also known as: CVE-2026-48053, GHSA-4mj9-pf4r-cqrc
Kolibri has Unauthenticated Server-Side Request Forgery (SSRF) in RemoteFacilityUserViewset
Summary
Several Kolibri API endpoints accept an unvalidated baseurl parameter and fetch attacker-controlled URLs from the Kolibri server, reflecting the response body back to the caller. The original report identified two endpoints on the RemoteFacilityUser* viewsets; remediation review found two further reflection points on the same pattern. The GET endpoint was unauthenticated.
Affected endpoints
Reported:
GET /api/auth/remotefacilityuser → RemoteFacilityUserViewset (kolibri/core/auth/api.py:1570). No authentication required.POST /api/auth/remotefacilityauthenticateduserinfo → RemoteFacilityUserAuthenticatedViewset (kolibri/core/auth/api.py:1594). Authentication is checked against the *remote* server rather than the local Kolibri.Found during remediation:
POST /api/public/setupwizard/loddata → setup wizard's remote-signup proxy (kolibri/plugins/setup_wizard/api.py). Reachable on unprovisioned devices.GET /api/public/networklocation/<id>/facilities/ → NetworkLocationFacilitiesView (kolibri/core/discovery/api.py). Authenticated but with the same Response(remote_payload) pattern.Root cause
Two compounding issues:
Response(response.json()), Response(facility_info["users"]), etc.).baseurl was validated only by URLValidator(schemes=["http", "https"]). NetworkClient.build_for_address() would connect to any host with a valid Kolibri-shaped /api/public/info/ response, and requests followed 30x redirects by default, so a hostile peer could pivot the fetch to an arbitrary host (cloud metadata, internal services) before reflection.Two reflection vectors
GET vector (`RemoteFacilityUserViewset`):
The viewset fetched <baseurl>/api/public/facilitysearchuser/ and returned Response(response.json()). An attacker-controlled baseurl returned a 302 to an arbitrary internal URL; requests followed the redirect, and the redirected response body was returned to the attacker.
POST vector (`RemoteFacilityUserAuthenticatedViewset`):get_remote_users_info() fetched <baseurl>/api/public/facilityuser/ with Basic Auth and the viewset returned Response(facility_info["users"]). A malicious baseurl returned crafted user-shaped JSON; arbitrary smuggled fields were reflected back to the caller. The setup wizard and NetworkLocationFacilitiesView endpoints had the same shape on different remote URLs.
Reproduction
The vulnerability can be reproduced by pointing baseurl at an attacker-controlled HTTP server that:
GET /api/public/info/ with a valid Kolibri info payload (so NetworkClient.build_for_address() succeeds).GET /api/public/facilitysearchuser/ with a 302 redirect to the target URL. The redirected response body is reflected via Response(response.json()).A working PoC has been retained internally and is not published with this advisory.
Demonstrated impact (pre-fix)
GET with JSON and no special request headers./metadata/v1.json) — reachableMetadata-Flavor / Metadata / token headers that the attacker could not inject)Not demonstrated
The earlier draft asserted port scanning via a timing oracle and generic "internal network mapping." The reflection vector reads response bodies directly when the target speaks JSON; timing-based scanning of arbitrary TCP services was not demonstrated and is not the headline risk.
Mitigation
Four layers of defence:
RemoteFacilityUser* endpoints now require an authenticated caller (or an unprovisioned device, for setup-wizard flows).baseurl resolve it only to peers Kolibri already knows about, rather than connecting to arbitrary hosts. Discovery and CLI flows that legitimately need to probe new addresses use a separate code path.Credit
Initial report and identification of the RemoteFacilityUser* viewsets by @beraoudabdelkhalek. Reflection-based PoC, additional vector identification, and remediation by the Kolibri maintainers.
<details><summary>Original report by @beraoudabdelkhalek</summary>
Summary
The RemoteFacilityUserViewset API endpoint (/api/auth/remotefacilityuser) has no authentication or permission checks and accepts a user-controlled baseurl parameter. This parameter is passed directly to NetworkClient.build_for_address() which makes server-side HTTP requests to the attacker-specified URL. An unauthenticated attacker can force the Kolibri server to reach out to arbitrary internal hosts, port-scan internal networks, and access cloud metadata endpoints.
Details
This is mainly due to the following issues:
1. Missing authentication on the API endpoint
File: kolibri/core/auth/api.py, line ~1553
class RemoteFacilityUserViewset(views.APIView): # No permission_classes → AllowAny
def get(self, request):
baseurl = request.query_params.get("baseurl", "")
validator(baseurl) # Only checks URL format (http/https scheme + valid hostname)
client = NetworkClient.build_for_address(baseurl)
response = client.get(url, params={"facility": facility, "search": username})
No permission_classes attribute is defined, and DEFAULT_PERMISSION_CLASSES is not set in the DRF configuration, so the endpoint defaults to AllowAny , accepting requests with zero authentication.
Similarly, RemoteFacilityUserAuthenticatedViewset (line ~1577, POST endpoint) also has no permission_classes, though it currently checks permissions via a different mechanism. The initial build_for_address() call still fires before that check.
2. Weak URL validation
File: kolibri/utils/urls.py, line 1-7
from django.core.validators import URLValidator
validator = URLValidator(schemes=["http", "https"])Medium Basis: CVSS v3 score 5.8, vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:N/A:N
0, fixed 0.19.4 (ecosystem)0.19.4
0.19.4pip install --upgrade kolibri==0.19.4Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.
Check your own computer: guard packages check
Source: PyPA Advisory Database · CC BY 4.0