SiYuan: Missing consistency check between packageName and repoURL/repoHash in bazaar package install allows overwriting an existing, trusted plugin
## Summary `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. ## Affected code `kernel/api/bazaar.go`: ```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`: ```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`: ```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 con
- Products
- github.com/siyuan-note/siyuan/kernel
- Affected versions
- Not specified
- Fixed versions
- 0.0.0-20260808010544-26ccb40d390e
- CVEs
- CVE-2026-62204
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 1 Nov 2026, 02:32 UTC · Revision 1
Source evidence
SiYuan: Missing consistency check between packageName and repoURL/repoHash in bazaar package install allows overwriting an existing, trusted plugin
core-osv · Original sourcePublished 23 Oct 2026, 18:38 UTC
## Summary `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. ## Affected code `kernel/api/bazaar.go`: ```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`: ```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`: ```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 con
osv:GHSA-rpx2-p6hp-x5gj
github.com/siyuan-note/siyuan/kernel
Fixed versions: 0.0.0-20260808010544-26ccb40d390e
Complete source record
{
"id": "350ad97f9decd3bdf90711096ee1249809d7f515f3f167d936f6274c8ac14b82",
"url": "https://osv.dev/vulnerability/GHSA-rpx2-p6hp-x5gj",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "SiYuan: Missing consistency check between packageName and repoURL/repoHash in bazaar package install allows overwriting an existing, trusted plugin",
"summary": "## Summary `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. ## Affected code `kernel/api/bazaar.go`: ```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`: ```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`: ```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 con",
"evidence": "osv:GHSA-rpx2-p6hp-x5gj",
"products": [
{
"name": {
"value": "github.com/siyuan-note/siyuan/kernel",
"evidence": "/affected/0/package/name"
},
"prerequisites": [],
"fixed_versions": [
{
"value": "0.0.0-20260808010544-26ccb40d390e",
"evidence": "/affected/0/ranges"
}
],
"affected_versions": []
}
],
"severity": "medium",
"structured": {
"id": "GHSA-rpx2-p6hp-x5gj",
"aliases": [
"CVE-2026-62204",
"GHSA-rpx2-p6hp-x5gj"
],
"metrics": [
{
"type": "CVSS_V3",
"score": "CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:C/C:L/I:H/A:L"
}
],
"affected": [
{
"ranges": [
{
"type": "SEMVER",
"events": [
{
"introduced": "0"
},
{
"fixed": "0.0.0-20260808010544-26ccb40d390e"
}
]
}
],
"package": {
"name": "github.com/siyuan-note/siyuan/kernel",
"purl": "pkg:golang/github.com/siyuan-note/siyuan/kernel",
"ecosystem": "Go"
},
"database_specific": {
"source": "https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/10/GHSA-rpx2-p6hp-x5gj/GHSA-rpx2-p6hp-x5gj.json"
}
}
],
"modified": "2026-10-23T18:45:08.585065959Z",
"provider": "osv",
"references": [
"https://github.com/siyuan-note/siyuan/security/advisories/GHSA-rpx2-p6hp-x5gj",
"https://nvd.nist.gov/vuln/detail/CVE-2026-62204",
"https://github.com/siyuan-note/siyuan/commit/26ccb40d390eb7d9b04673629a58ab1d69cc7e53",
"https://github.com/siyuan-note/siyuan",
"https://github.com/siyuan-note/siyuan/releases/tag/v3.8.0",
"https://www.vulncheck.com/advisories/siyuan-before-plugin-overwrite-via-bazaar-install"
],
"provider_metadata": {
"cwe_ids": [
"CWE-345",
"CWE-668"
],
"severity": "MODERATE",
"github_reviewed": true,
"nvd_published_at": null,
"github_reviewed_at": "2026-10-23T18:38:25Z"
}
},
"related_cves": [
{
"value": "CVE-2026-62204",
"evidence": "/aliases"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 424606,
"published_at": "2026-10-23T18:38:25+00:00"
}