/

CVE-2026-41654

Severity:

HIGH RISK

(8.1)

Improper Input Validation / Server-Side Request Forgery

CVE-2026-41654

Analyzed

Vulnerability type

Category:

Improper Input Validation / Server-Side Request Forgery (SSRF)

CWE:

CWE-20, CWE-918

Impact:

Server-Side Request Forgery and Interaction with Internal Resources

Severity:

HIGH RISK

(8.1)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Weblate's project backup import functionality allowed authenticated users with project creation permissions to load crafted JSON metadata that specified arbitrary repository URLs, including private network addresses and disallowed schemes.

Because model-level validation was bypassed, unvalidated repo URLs were persisted and later written directly into Git configuration, exposing the application to potential server-side request forgery (SSRF) and interaction with internal or non-HTTP resources.

Affected context

This issue occurs in Weblate's project backup import mechanism, specifically when restoring components from a ZIP archive that contains components/<name>.json files.

It affects deployments where:

  • Authenticated users have the project.add permission (default on hosted Weblate SaaS for billing/trial users).
  • The import process persists component objects via bulk_create without invoking model validators.
  • Git repositories are automatically configured using the URL stored in the component model, which is then written unchanged into .git/config.

In such environments, a crafted backup file can introduce repository URLs pointing to internal services or using non-allow‑listed URL schemes.

Exploit preconditions

  • Attack surface: Authenticated Weblate web interface, specifically the project backup import feature.
  • Required access: Valid user account with project.add permission or equivalent capability to import projects.
  • User interaction: The attacker must upload and import a malicious project backup ZIP containing tampered components/<name>.json.
  • Trigger point: During import, Weblate calls Component.objects.bulk_create([component])[0], persisting the component without running full_clean(); later, configure_repo(pull=False) writes the unvalidated URL into .git/config and may interact with it.
  • Why exploitation is possible: Input validation logic (validate_repo_url) is attached to the model but is bypassed by the use of bulk_create, allowing arbitrary URLs to be stored and used by server-side Git operations.

Why this happens

The vulnerability stems from improper input validation (CWE-20) combined with trust in user-supplied configuration that ultimately drives server-side network operations (CWE-918).

Specifically, the model field for the repository URL relies on Django's validation (full_clean() and field validators such as validate_repo_url) to enforce allowed schemes and host patterns.

However, the import code path uses Component.objects.bulk_create([component])[0], which does not automatically invoke model validation methods.

As a result, attacker-controlled JSON from the imported backup can specify repo URLs pointing to internal IPs, loopback addresses, or using schemes like file:// or git://.

Since this URL is later consumed by Git configuration routines without additional checking, the application treats untrusted configuration as if it were already validated, enabling SSRF-style interactions with internal or otherwise restricted resources.

Potential impact

  • Weblate may make outbound requests to attacker-chosen internal or private network addresses (SSRF), potentially exposing network topology or service behavior.
  • Interaction with services bound to 127.0.0.1 or other non-routable addresses that are not accessible from outside the host.
  • Misuse of non-HTTP or file-based schemes (e.g., file://, git://) that could lead to unauthorized local resource access or unexpected Git behavior.
  • Abuse of Weblate's network position to pivot deeper into an internal network or reach otherwise firewalled services.
  • Potential leakage of metadata or errors that reveal internal service details or configurations.

General mitigation guidance

Mitigation typically focuses on enforcing consistent validation paths and hardening server-side network behavior:

  • Ensure that all persistence paths for security-sensitive fields (such as repository URLs) invoke model or schema validation, even when using bulk operations.
  • Centralize repository URL validation in a shared routine that is called explicitly before saving data from imports, APIs, or administrative tools.
  • Apply strict allow-lists for URL schemes and host patterns used by backend systems, rejecting or normalizing anything outside this policy.
  • Introduce a network-layer SSRF defense pattern (e.g., allow-listing outbound destinations or blocking access to loopback and private address ranges from application-level network calls).
  • Limit what Git operations can access by running them under constrained accounts and with minimal filesystem and network privileges.
  • Treat imported backups and migrations as untrusted input; apply the same or stricter validation as for interactive user input.

How teams detect issues like this

Detection revolves around both code-level analysis and runtime monitoring:

  • Use static analysis or linters to flag calls to bulk_create, direct ORM save() calls, or custom import paths that bypass full_clean() or equivalent validation layers, especially on fields that influence network or filesystem access.
  • During code review, pay particular attention to import, backup/restore, and admin utilities to confirm they reuse existing validation and normalization logic.
  • Implement configuration or policy checks that prevent unsafe URL schemes or internal IP ranges from being used as repository endpoints.
  • Monitor application logs for repository URLs referencing loopback addresses, private IP ranges, or unusual schemes; treat these as indicators of suspicious imports.
  • Consider integrating application security testing tools that can model SSRF sinks (e.g., Git or HTTP clients) and trace back to user-controlled sources.

Sources

SourceLink
github.comgithub.com/WeblateOrg/weblate/commit/e1eff1f517c1ee315d69581910baaabb724e5ef0
github.comgithub.com/WeblateOrg/weblate/commit/e4b67a76d95d5165ecb9937f7485fd79223b7f14
github.comgithub.com/WeblateOrg/weblate/pull/19061
github.comgithub.com/WeblateOrg/weblate/pull/19062
github.comgithub.com/WeblateOrg/weblate/releases/tag/weblate-5.17.1
github.comgithub.com/WeblateOrg/weblate/security/advisories/GHSA-cwcx-382v-8m9g

Frequently asked

questions

It requires an authenticated Weblate account with project creation/import permissions, so it is not exploitable by unauthenticated internet users. However, in hosted or multi-tenant deployments where many users have project.add, an attacker could feasibly obtain such access and exploit the flaw remotely via the web interface.

The attacker must be able to sign in to Weblate and have the project.add permission (or equivalent rights to import a project backup). No direct server shell or database access is required; the attack is carried out entirely through the project import UI/API.

The safest pattern is to ensure that all data paths leading to persistence of security-sensitive fields go through the same validation logic, regardless of whether they are triggered by bulk operations, imports, or admin tools. Avoid relying solely on framework defaults; explicitly call validators or full_clean() before saving models that influence network or system-level behavior.

Adopt a defensive design where:

  • All user-supplied configuration is treated as untrusted, including backups and administrative imports.
  • Validation and normalization logic is centralized and reused by every code path that sets critical fields (such as URLs, file paths, or commands).
  • SSRF defenses are implemented at both the application and network layers, including allow-listed destinations, blocked address ranges, and restricted URL schemes.
  • Regular security reviews focus on import/export features and any mechanism that reconstructs state from user-provided archives or metadata.
Find out what's already
exploitable in your codebase.