installBazaarPlugin (and the equivalent endpoints for widgets/icons/templates/themes) accept
packageName, repoURL, and repoHash as independent request fields with no validation that
they refer to the same package. packageName alone determines the install destination;
repoURL/repoHash alone determine what content gets downloaded and written there. A request
can name an already-installed, already-enabled plugin as packageName while pointing repoURL/
repoHash at different, attacker-influenced content, silently overwriting the existing plugin's
files.
kernel/api/bazaar.go:
util.BindJsonArg("packageName", &packageName, true, true)
util.BindJsonArg("repoURL", &repoURL, true, true)
util.BindJsonArg("repoHash", &repoHash, true, true)
err := model.InstallBazaarPackage("plugins", repoURL, repoHash, packageName, 0)
kernel/model/bazaar.go:
func getPackageInstallPath(pkgType, packageName string) (string, string, error) {
case "plugins":
return filepath.Join(util.DataDir, "plugins", packageName), "plugin.json", nil
kernel/bazaar/install.go:
func installPackage(data []byte, installPath string) (err error) {
...
if err = filelock.Copy(srcPath, installPath); err != nil { return }
return
}
installPath is derived solely from packageName; the downloaded data is derived solely from
repoURL/repoHash; nothing cross-validates them, and installPackage performs no check for
whether installPath already contains an existing package before copying into it. The same
pattern applies to the widget/icon/template/theme install endpoints, which share
getPackageInstallPath.
This does not involve path traversal — installPath always resolves inside
DataDir/plugins/ (or the corresponding directory for other package types), so this is not an
instance of "arbitrary file write outside the workspace path" (excluded by this project's
SECURITY.md). The issue is that the write...
0.0.0-20260808010544-26ccb40d390eExploitability
AV:LAC:HPR:LUI:RScope
S:CImpact
C:LI:HA:L6.6/CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:C/C:L/I:H/A:L