Weblate 威胁模型

范围:核心 Weblate web 程序、其与用户浏览器的交互、后端部件(web 服务器、WSGI、数据库、数据存储、Redis、Celery)及和外部 VCS 的集成。

假设:标准 Weblate 部署,有典型部件(nginx/Apache、granian/Gunicorn/uWSGI、PostgreSQL、数据存储、Celery)和用户角色(未经身份认证用户、已认证身份的用户、审核者、项目经理、管理员、项目范围的 API 令牌)。

Webhook endpoints for some VCS integrations are intentionally compatibility-oriented and can accept unauthenticated deliveries from supported forges. Weblate therefore treats webhook-triggered repository updates as a deployment-hardened interface rather than a cryptographically authenticated one by default.

Until native authenticated integrations are available for these platforms, webhook abuse resistance depends on compensating controls such as reverse-proxy rate limiting, request size limits, minimizing public exposure, and monitoring.

系统描述和范围

Weblate 是构建在 Django 之上的开放源码的,基于 web 的本地化平台。它与 Git 仓库紧密集成来管理翻译并提供 CI/CD 样式的特性用于自动化、hooks、和 VCS 同步。

Authorization in Weblate is not limited to instance-wide administrator versus regular user access. Permissions can be delegated per site, project, component, language, glossary, or other scope, including dedicated VCS, translation memory, screenshot, review, and project access management permissions. Project-scoped API tokens can also be granted team memberships and permissions similar to users.

资产:

  • 机密性:翻译字符串、VCS 集成的 API 密钥/凭据、用户凭据(密码、双因素身份认证 secrets)、用户个人数据(电子信箱、名字)、会话令牌、审计日志和私密项目数据。

  • 完整性:翻译字符串内容、VCS 仓库完整性、项目和部件配置、用户权限、审计日志。

  • 可用性:Weblate web 界面、VCS 集成、数据库访问、后台任务处理。

  • 真实性/不可否认性:翻译提交历史、翻译的用户归因、管理操作的审计日志。

概念数据流动示意图

digraph translations { graph [fontname = "sans-serif", fontsize=10]; node [fontname = "sans-serif", fontsize=10, margin=0.1, height=0, style=filled, fillcolor=white, shape=note]; edge [fontname = "sans-serif", fontsize=10, dir=both]; "External user (browser)" -> "Web server (nginx/Apache)" [label="HTTPS"]; "External webhook source" -> "Web server (nginx/Apache)" [label="HTTPS webhook"]; "Web server (nginx/Apache)" -> "Weblate application (WSGI, Celery)" [label="Internal API"]; "Weblate application (WSGI, Celery)" -> "Database (PostgreSQL)" [label="Database access"]; "Weblate application (WSGI, Celery)" -> "Datastore (Valkey/Redis)" [label="Key/value access"]; "Weblate application (WSGI, Celery)" -> "Internal VCS repository" [label="Filesystem access"]; "Weblate application (WSGI, Celery)" -> "External VCS repository" [label="Git/API"]; "Weblate application (WSGI, Celery)" -> "Logging (SIEM)" [label="GELF"]; }

信任边界

  • 互联网 ↔ Web 服务器:与防御第一线交互的公共互联网流量。

  • Webhook source ↔ Web server: External code hosting services or other callers invoking repository hooks, sometimes with unauthenticated endpoints enabled per project.

  • Web 服务器 ↔ Weblate 程序:反向代理/web 服务器和程序逻辑之间的通信。

  • Weblate 程序 ↔ 数据库: 访问持久和缓存数据的程序逻辑。

  • Weblate 程序 ↔ 日志记录:创建日志的程序逻辑。

  • Weblate 程序 ↔ 内部 VCS 仓库:与 VCS 仓库本地副本交互的程序逻辑。

  • Weblate 程序 ↔ 外部 VCS 仓库:和外部代码托管平台联系的 Weblate。

  • Privileged user configuration ↔ Outbound network: Project and integration settings can cause Weblate to initiate connections to external VCS hosts or other services.

  • Imported backup archive ↔ Weblate application/filesystem: Backup restore processes attacker-controlled archive contents, metadata, and VCS state.

  • 未经身份认证的调用方 ↔ 已进行身份认证的用户/令牌: 浏览器、API 和 webhook 访问的不同特权等级。

  • Authenticated user/token ↔ Project manager/reviewer/VCS manager: Delegated project- and component-scoped permissions create additional privilege boundaries inside the application.

威胁识别

部件/交互

STRIDE 威胁类别

威胁描述

潜在影响

Web服务器 (nginx/Apache)

拒绝服务

拒绝服务:攻击者用请求淹没服务器,使 Weblate 不可用。

丧失翻译可用性。

信息披露

配置暴露:错误配置的服务器暴露敏感文件(如 config 文件、私钥等)。

凭据、内部架构暴露。

篡改

恶意请求注入:攻击者将恶意数据注入 HTTP 标头或请求正文。

如后端未正确处理可能导致 SQL 注入、XSS、或其他注入。

Webhook 处理

伪造

Forged webhook delivery: An attacker submits a fake webhook payload to trigger repository updates or other automation, especially when unauthenticated hooks are enabled.

Unauthorized repository synchronization, noisy task execution, or follow-on abuse of automation paths.

篡改

Payload manipulation or replay: An attacker replays or modifies webhook payloads so Weblate processes repository states or branches different from the legitimate event.

Unexpected updates, repository confusion, or misuse of privileged VCS credentials.

拒绝服务

Hook flooding: An attacker sends excessive webhook requests or oversized payloads, overwhelming request handling or background workers.

Weblate 速度变慢或不可用。

信息披露

Repository enumeration via webhook responses: An attacker probes webhook payloads and learns whether repositories, branches, or components exist based on response metadata.

Disclosure of private project structure, enabled hooks, or component identifiers.

否认

Limited webhook attribution: Hook-triggered updates are recorded as coming from a service bot rather than a forge-authenticated principal.

Reduced forensic confidence when investigating malicious or disputed hook activity.

Weblate 程序

伪造

用户冒充:攻击者获取对合法用户会话的访问(如通过会话劫持、被攻陷的凭据)。

未经授权的翻译、仓库访问。

(WSGI/Celery)

篡改

未经授权的翻译修改:恶意用户或遭利用的漏洞允许更改译文、项目配置或 VCS 集成设置。

不正确的翻译、破损的构建、通过 VCS 钩子的远程代码执行。

篡改

VCS 集成操控:攻击者操纵 Weblate 与 VCS 的交互(如,通过精心构造的仓库 URL 注入恶意 URL,如未清理将造成远程代码执行)。

目标项目的代码注入,数据渗出。

否认

未归因的更改:在没有正确归因到负责用户或系统情况下做出恶意改动。

审计和追责难度。

信息披露

敏感数据泄露:SQL 注入、不安全的 API 端点,或错误披露了敏感数据(如,其他用户的翻译、VCS 集成、服务器信息)。

隐私泄露、知识产权窃取。

信息披露

VCS 凭据暴露:Weblate 存储的 VCS 凭据(SSH 密钥、令牌)被攻击者访问。

直接访问集成的代码仓库。

拒绝服务

资源耗尽:攻击者触发的过多的后台任务或低效的数据库查询导致系统放慢或崩溃。

Weblate 不可用性。

权限提升

角色提升:普通的翻译者获得管理权限。

系统彻底被攻陷。

权限提升

命令注入:由于仓库 URL 或附加组件中不当的输入验证造成任意代码执行。

系统贡献、数据渗出。

Backup import / restore

拒绝服务

Archive amplification during restore: A crafted backup contains many members or a large aggregate uncompressed size, exhausting disk, memory, worker time, or inode capacity.

Restore-time denial of service and possible service degradation for the instance.

篡改

Malicious backup metadata or VCS state: A crafted backup restores misleading project metadata or unsafe repository state despite path validation and schema checks.

Corrupted restored projects, unsafe repository state, or administrative confusion.

数据库/数据存储

篡改

数据损坏:数据库的直接访问允许修改翻译字符串、用户数据,或配置。

系统故障、数据完整性丢失。

信息披露

敏感数据访问:对数据库/数据存储未经授权的访问暴露所有存储的数据(凭据、翻译记忆库、用户个人资料)。

重大数据泄露。

拒绝服务

数据库耗尽:攻击者用查询让数据库或数据存储应接不暇,或消耗所有的内存或可用连接。

Weblate 不可用性。

VCS 集成

篡改

来自 Weblate 的恶意提交:被攻陷的 Weblate 向上游仓库推送恶意更改。

将恶意软件/后门引入目标项目。

否认

虚假的提交归因:Weblate 提交更改被归因到错误的用户(如管理员在翻译者不同意情况下强制将一个提交以翻译者名称提交)。

追责问题。

外部集成 / VCS 配置

信息披露

Server-side request forgery or unintended internal reachability: A privileged user configures repository or integration endpoints that cause Weblate to connect to internal or otherwise restricted hosts.

Exposure of internal services, metadata endpoints, or restricted network paths.

用户交互

伪造

钓鱼/社会工程:攻击者欺骗用户揭示 Weblate 或关联的 VCS 账户的凭据。

账户攻陷。

(Web 用户界面)

篡改

跨站脚本 (XSS):恶意脚本注入翻译或用户个人资料在其他用户的浏览器中执行。

会话劫持、凭据偷窃、污损。

信息披露

点击劫持/UI 覆盖:攻击者将恶意 UI 元素遮盖在 Weblate 上,欺骗用户进行无意的操作。

未经授权的操作、数据操纵。

信息披露

UI 中的敏感数据:由于授权漏洞在UI 中无意地暴露敏感数据(如其他用户的电子邮箱)。

隐私泄露。

迁移策略

  • 身份认证&授权:
    • 强密码政策,见 密码政策

    • 强制的双因素身份认证,见 双因素身份认证

    • 强健的会话管理。

    • 基于角色的访问控制(RBAC)来强制最小权限(如分开翻译、审核、VCS、翻译记忆库、屏幕截图和项目访问管理权限),见 访问控制

    • 和外部身份提供商集成(SAML、OAuth、LDAP),见 身份认证

  • Webhook 安全:
    • Current product limitation: webhook authenticity is not uniformly enforced in-app for all supported forge integrations.

    • Treat webhook endpoints as deployment-hardened interfaces and enable them only where necessary, see 通知钩子 and 启用钩子.

    • Deployment controls required today include reverse-proxy rate limiting, request size limits, optional source-IP filtering, minimizing public exposure, and alerting on webhook spikes.

    • Validate webhook event type and payload before triggering repository updates or tasks.

    • Future product direction is to replace compatibility webhooks with native authenticated integrations that validate source authenticity before scheduling repository updates.

  • 输入验证和输出解码:
    • 严格验证所有用户输入(表单、API 请求、VCS URL 等)防止注入攻击(SQL 注入、命令注入、XSS)。

    • 对展示在 web 用户界面上的所有由用户提供的数据进行上下文感知的输出解码以防止 XSS。

  • VCS 集成安全性:
    • VCS 凭据的最小权限原则(如,在可能的地方只读访问,限制令牌的适用范围)。

    • 版本控制系统凭据的安全存储。

    • 严格清洁和验证所有来自 VCS 的数据(如文件名、分支名、可能被展示的提交信息)。

    • 安全执行 Git/Mercurial 命令(避免带用户控制输入的 shell 执行)。

    • Document and review hostname allowlisting and private-network restrictions for outbound integrations where deployments need to constrain server-initiated connections.

  • 备份导入安全:
    • Treat backup archives as untrusted input and validate both metadata and extracted paths.

    • Enforce aggregate archive-size and extraction-budget limits, not only per-entry checks.

    • Monitor restore failures and unusually large imports as potential abuse indicators.

  • 数据保护:
    • 敏感数据的静态加密。

    • 加密传输数据(将 TLS/SSL 用于所有 HTTP/S 和 VCS 通信)。

    • 数据库强化(Weblate 用户的最小权限、强密码)。

  • 系统强化:
    • 定期给操作系统、Weblate、所有依赖项打补丁。

    • 操作系统上 Weblate 用户账户的最小权限原则。

    • 网络隔离(如将数据库和数据存储和公共访问隔开)。

    • 使用 WAF(Web 应用防火墙)。

  • 记录和监控:
    • 所有安全相关事件的综合性审计记录(登录、失败的登录、权限更改、关键配置更改、VCS 操作)。

    • 安全事件的中心化记录和警报,如 Graylog 日志管理

  • 安全开发实践:
    • 聚焦安全的代码审核。

    • 静态程序安全测试(SAST)和动态程序安全测试(DAST),见 Weblate 源代码

    • 依赖项漏洞扫描,见 依赖项

    • 定期安全审计和渗透测试。

  • 错误处理:
    • 不揭示敏感内部信息的一般性错误消息。