提交 #1055361: FredrikNoren ungit 1.5.30 Argument Injection信息

标题FredrikNoren ungit 1.5.30 Argument Injection
描述ungit 1.5.30 exposes multiple Git and filesystem APIs without authentication when the default authentication setting is false. The most direct RCE vector is POST /api/clone. In source/git-api.js, the clone handler builds the Git argument array as clone, url, destinationDir. The url value is not validated as a URL, values beginning with a hyphen are accepted, and no -- separator is inserted before the positional arguments. An attacker can therefore provide a value such as --upload-pack=<command>. Git interprets this value as an option and executes the supplied upload-pack command through a shell during the clone operation. A local file:// repository can be used as the accompanying repository path, so the command executes on the machine running ungit. The Node.js layer does not need to spawn a shell; the command execution occurs because Git itself interprets the injected option. The API response may be an error after the command has already executed. Successful exploitation runs the attacker-controlled command with the privileges of the ungit process and can create files, modify data, or launch additional payloads. The same unauthenticated API surface also enables a persistent plugin-based code execution chain. An attacker can use /api/createdir and /api/clone to place a repository containing an ungit-plugin.json manifest under the ungit plugin directory. When the victim subsequently opens the ungit interface or restarts the application, the plugin server module is loaded with require and its install function executes inside the ungit process. The plugin directory is also statically served, allowing an attacker-controlled page to become same-origin with the ungit API. Additional exposed operations allow arbitrary repository pushes to attacker-controlled remotes, destruction of uncommitted files through reset and clean operations, arbitrary file reads through path traversal, and filesystem reconnaissance. Ordinary cross-origin POST requests are blocked by the CORS preflight, so the direct write vectors require a local process, a directly connected LAN client, DNS rebinding, or a same-origin page served by a planted plugin. The issue is publicly documented at: https://github.com/FredrikNoren/ungit/issues/1690 Remediation should authenticate all Git and filesystem APIs, reject option-like clone URLs, validate URL schemes, insert a -- separator before positional arguments, restrict repository paths and remotes, and require integrity checks or explicit approval before loading plugins.
来源⚠️ https://github.com/FredrikNoren/ungit/issues/1690
用户
 fifker (UID 101353)
提交2026-10-24 10時09分 (1 月前)
管理2026-11-23 14時33分 (1 month later)
状态已接受
VulDB条目442303 [FredrikNoren ungit 1.5.30 /api/clone source/git-api.js url 权限提升]
积分20

Do you need the next level of professionalism?

Upgrade your account now!