Weblate Arbitrary File Read via ssh-keyscan Host Argument Injection — CVE-2026-24126
by Alejandro Baño (alexb616) · 2026-07-05
- Severity
- High
- CVE
- CVE-2026-24126
- Category
- web
- Affected product
- Weblate (self-hosted translation platform)
- Affected versions
- All versions <= 5.15.2 (tested against 5.0.2 and 5.15.2; fixed in 5.16.0)
- Disclosed
- 2026-07-05
- Patch status
- patched
Tags
Archive entry
intelseclab/poc-archiveMetadata
| Field | Value |
|---|---|
| Date Added | 2026-07-05 |
| Last Updated | 2026-03 |
| Author / Researcher | Alejandro Baño (alexb616) |
| CVE / Advisory | CVE-2026-24126 |
| Category | web |
| Severity | High |
| CVSS Score | 6.5 (CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:L/I:L/A:L, per source repository) |
| Status | PoC |
| Tags | weblate, argument-injection, command-injection, ssh-keyscan, arbitrary-file-read, authenticated, python, cwe-88 |
| Related | N/A |
Affected Target
| Field | Value |
|---|---|
| Software / System | Weblate (self-hosted translation platform) |
| Versions Affected | All versions <= 5.15.2 (tested against 5.0.2 and 5.15.2; fixed in 5.16.0) |
| Language / Platform | Python (PoC), Django-based Weblate backend |
| Authentication Required | Yes (Weblate administrator account) |
| Network Access Required | Yes |
Summary
Weblate’s SSH host-key management feature (weblate/ssh/views.py, add_host_key()) passes the administrator-supplied host field straight into an ssh-keyscan subprocess invocation with no sanitization and no -- argument terminator. Because ssh-keyscan supports a -f <file> flag to read a list of target hostnames from a file, an authenticated admin can submit a host value like -f/etc/passwd to make the server run ssh-keyscan -f /etc/passwd, treating each line of the target file as a “hostname” it fails to resolve. The resulting per-line resolution errors are captured by Weblate’s error handler and reflected back into the page’s alert-danger block, effectively leaking the file’s contents line by line. The PoC script logs in as an admin, extracts the CSRF token, submits the crafted host value to /manage/ssh/, and parses the leaked file content out of the returned error text.
Vulnerability Details
Root Cause
add_host_key() builds the ssh-keyscan command line by directly appending the user-controlled host POST parameter without stripping leading dashes or inserting a -- terminator, allowing the value to be interpreted as a command-line flag (-f) rather than a hostname (classic argument injection, CWE-88).
Attack Vector
- Authenticate to the target Weblate instance as an administrator (or otherwise obtain admin session cookies).
- Fetch the SSH management page to obtain a valid CSRF token.
- Submit a POST request to
/manage/ssh/withhost=-f<path>(e.g.,-f/etc/passwd) and anaction=add-hostparameter. - Weblate invokes
ssh-keyscan -f <path> ..., which reads<path>as a hostname list and emits a resolution error for every line. - Parse the returned
alert-dangerblock in the HTTP response to reconstruct the target file’s contents from the per-line error messages.
Impact
An authenticated Weblate administrator-level attacker (or an attacker who has otherwise obtained/stolen admin credentials or a session) can read arbitrary files accessible to the Weblate server process, including application secrets (settings.py, .env), private SSH keys, and database credentials.
Environment / Lab Setup
Target: Weblate <= 5.15.2 (tested on 5.0.2 and 5.15.2), self-hosted instance
Attacker: Python 3 with `requests` and `beautifulsoup4` (bs4) installed
Proof of Concept
PoC Script
See
CVE-2026-24126.pyin this folder.
| |
The script logs into Weblate with the supplied admin credentials, extracts the CSRF token from the SSH management page, POSTs a host=-f<file> payload to /manage/ssh/, then parses the resulting alert-danger error block using regex patterns matching ssh-keyscan’s resolution-failure messages to reconstruct and print the target file’s contents.
Detection & Indicators of Compromise
POST /manage/ssh/ host=-f... action=add-host
Signs of compromise:
- Requests to
/manage/ssh/with ahostparameter beginning with-for other leading-dash flag-like values. - Unusually large or repeated
ssh-keyscansubprocess invocations/errors in server logs correlated with admin session activity. - Sensitive file contents (e.g.,
/etc/passwd,.env, private keys) appearing in web application error pages or logs.
Remediation
| Action | Detail |
|---|---|
| Primary fix | Upgrade to Weblate 5.16.0 or later, which adds proper input validation on the SSH host field. |
| Interim mitigation | Restrict admin account access and monitor /manage/ssh/ requests; consider a WAF rule blocking host parameter values starting with - until patched. |
References
Notes
Mirrored from https://github.com/alexb616/Weblate-CVE-2026-24126 on 2026-07-05.
| |