KEVWire

Security intelligence, with context.

Response snapshot Oct 27, 2026, 01:56 UTC

Back to the wire
Permalink
VulnerabilityCVE-2026-62204

SiYuan: Missing consistency check between packageName and repoURL/repoHash in bazaar package install allows overwriting an existing, trusted plugin

`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.

At a glance

Exploited
Not known
Severity
6.6 Medium (CVSS 3.1)
Chance of exploitation
<0.1% in the next 30 days
Sources
1 source

What to do

GitHub lists first patched versions: github.com/siyuan-note/siyuan/kernel: 0.0.0-20260808010544-26ccb40d390e. Confirm the affected range and upgrade guidance in the exact advisory.

Read GitHub-reviewed advisory GHSA-rpx2-p6hp-x5gj (opens a new tab)

What happened

## 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

Continue reading

`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 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 lands in the *wrong, existing* location within the intended directory, not outside it — an authorization/identity-verification gap, not a path traversal.

## Reachability / why this is not trivially remote

The bazaar endpoints are gated by `model.CheckAuth`, `model.CheckAdminRole`, `model.CheckReadonly`. When no lock-screen password is configured (the common desktop default), `CheckAuth` still enforces a same-origin check: ```go if !localhost || ... || ("" != origin && !util.IsLocalOrigin(origin)) || ...

{ // reject with 401 } ``` I verified `IsLocalOrigin`/`IsLocalHostname` correctly parse the `Origin` header via `url.Parse` and check exact hostname / loopback IP: ```go func IsLocalOrigin(origin string) bool { if u, err := url.Parse(origin); err == nil { return IsLocalHostname(u.Hostname()) } return false } func IsLocalHostname(hostname string) bool { if "localhost" == hostname || strings.HasSuffix(hostname, ".

localhost") { return true } if ip := net.ParseIP(hostname); nil != ip { return ip.IsLoopback() } return false } ``` This was tested against common bypass patterns (subdomain-suffix tricks like `localhost.attacker.com`, and `Origin: null` as sent by sandboxed iframes) and found no bypass — this is a correctly-implemented check. This means a purely remote attacker (e.g.

a malicious website) cannot invoke this endpoint via CSRF; a request must originate from SiYuan's own renderer origin.

## Realistic impact

Given SiYuan runs as an Electron app with `nodeIntegration: true` (per prior advisories in this repository), a same-origin script-execution primitive (e.g. an XSS bug in the renderer, of which several have been fixed in this repository recently) is typically already sufficient for direct code execution.

This bug's marginal value is **persistence**: a transient XSS-driven compromise can use this endpoint to overwrite an existing, trusted, already-enabled plugin's `index.js`, converting a one-time compromise into code that runs on every future launch of the application, surviving after the original XSS vector is closed.

The overwrite does not effect immediately, via this specific endpoint. `PushReloadPlugin` (the websocket event that triggers frontend hot-reload without restart) is only called from the batch-update path (`InstallBazaarPackages`, used by `batchUpdatePackage`), which explicitly checks `if petal != nil && petal.Enabled` before forcing a reload via `SetPetalEnabled`.

The single-package install endpoint (`installBazaarPlugin`) does not call `PushReloadPlugin` at all — it only pushes a generic success toast. So an overwrite via this endpoint activates on the next app restart or manual plugin toggle, rather than instantly still a realistic and frequent event for a desktop application, but not an instant hot-reload.

## Suggested fix

Verify that `packageName` matches the package name declared in the downloaded package's own `plugin.json`/`theme.json`/etc. before copying into `installPath`, and/or refuse to install over an existing, non-empty destination directory unless the request is explicitly an update of that same package (matching by source repo identity, not just by request-supplied name).

## Verification notes

Confirmed via static source review of `kernel/api/bazaar.go`, `kernel/model/bazaar.go`, `kernel/bazaar/install.go`, `kernel/model/session.go` (CheckAuth), `kernel/util/net.go` (IsLocalOrigin/IsLocalHostname), and `kernel/model/push_reload.go` / `app/src/plugin/loader.ts` (reload trigger wiring).

I do not have a running SiYuan instance in this environment to execute an end-to-end proof of concept; findings are based on tracing the actual, unmodified control flow across these files rather than assumption.

Affected package ranges reported by GitHub: github.com/siyuan-note/siyuan/kernel: < 0.0.0-20260808010544-26ccb40d390e

Scores and how they were measured

CVSS base severity

6.6

Version 3.1As of

CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:C/C:L/I:H/A:L

Measurement source (opens a new tab)

How bad it is if exploited. Not a prediction of exploitation or proof you are exposed.

EPSS probability

<0.1%

Scored Percentile 0.6%

Model and measurement source (opens a new tab)

A model's estimate of exploitation in the next 30 days, not certainty or your own risk.

Related technology

Sources

  1. Primary source

    GitHub-reviewed advisory GHSA-rpx2-p6hp-x5gj (opens a new tab)

    The public advisory supplies the description, affected package/version ranges, and any listed CVSS metric. GitHub review is not local review.

    Published Checked

  2. Primary source

    GitHub public advisory API page (opens a new tab)

    The API page supplied GHSA-rpx2-p6hp-x5gj, its actual identifiers, source dates, and structured metrics.

    Published Date not suppliedChecked

  3. Primary source

    GitHub public advisory API page (opens a new tab)

    The API page supplied GHSA-rpx2-p6hp-x5gj, its actual identifiers, source dates, and structured metrics.

    Published Date not suppliedChecked

  4. Primary source

    GitHub public advisory API page (opens a new tab)

    The API page supplied GHSA-rpx2-p6hp-x5gj, its actual identifiers, source dates, and structured metrics.

    Published Date not suppliedChecked

  5. Primary source

    GitHub public advisory API page (opens a new tab)

    The API page supplied GHSA-rpx2-p6hp-x5gj, its actual identifiers, source dates, and structured metrics.

    Published Date not suppliedChecked

  6. Primary source

    GitHub public advisory API page (opens a new tab)

    The API page supplied GHSA-rpx2-p6hp-x5gj, its actual identifiers, source dates, and structured metrics.

    Published Date not suppliedChecked

  7. Primary source

    GitHub public advisory API page (opens a new tab)

    The API page supplied GHSA-rpx2-p6hp-x5gj, its actual identifiers, source dates, and structured metrics.

    Published Date not suppliedChecked

  8. Primary source

    GitHub public advisory API page (opens a new tab)

    The API page supplied GHSA-rpx2-p6hp-x5gj, its actual identifiers, source dates, and structured metrics.

    Published Date not suppliedChecked

  9. Primary source

    GitHub public advisory API page (opens a new tab)

    The API page supplied GHSA-rpx2-p6hp-x5gj, its actual identifiers, source dates, and structured metrics.

    Published Date not suppliedChecked

  10. Primary source

    FIRST measured EPSS score (opens a new tab)

    Measured EPSS probability and percentile for CVE-2026-62204, scored 2026-10-26. This is a model estimate, not proof of exposure.

    Published Checked

Cite this record

For factual claims, cite the primary sources above; cite KEVWire for its compilation, dates, and classifications.

APA

KEVWire. (2026, October 23). SiYuan: Missing consistency check between packageName and repoURL/repoHash in bazaar package install allows overwriting an existing, trusted plugin (CVE-2026-62204). https://kevwire.com/record/CVE-2026-62204

MLA

"SiYuan: Missing consistency check between packageName and repoURL/repoHash in bazaar package install allows overwriting an existing, trusted plugin (CVE-2026-62204)." KEVWire, 23 Oct. 2026, kevwire.com/record/CVE-2026-62204.

Chicago

KEVWire. "SiYuan: Missing consistency check between packageName and repoURL/repoHash in bazaar package install allows overwriting an existing, trusted plugin (CVE-2026-62204)." Last modified October 23, 2026. https://kevwire.com/record/CVE-2026-62204.

Evidence summary (plain text)

SiYuan: Missing consistency check between packageName and repoURL/repoHash in bazaar package install allows overwriting an existing, trusted plugin (Oct 23, 2026).
`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`:
```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)
```
CVSS 6.6 (version 3.1; evidence as of Oct 23, 2026; https://github.com/advisories/GHSA-rpx2-p6hp-x5gj).
EPSS <0.1% for the following 30 days, scored Oct 26, 2026 (https://api.first.org/data/v1/epss?cve=CVE-2026-62204&date=2026-10-26).
Sources:
GitHub-reviewed advisory GHSA-rpx2-p6hp-x5gj: https://github.com/advisories/GHSA-rpx2-p6hp-x5gj
GitHub public advisory API page: https://api.github.com/advisories?type=reviewed&per_page=100&sort=updated&direction=desc&after=Y3Vyc29yOnYyOpK0MjAyNi0xMC0yM1QyMDo1MTozMFrOAAf0Mg%3D%3D
GitHub public advisory API page: https://api.github.com/advisories?type=reviewed&per_page=100&sort=updated&direction=desc&after=Y3Vyc29yOnYyOpK0MjAyNi0xMC0yM1QyMDo0OToxMlrOAAf0LQ%3D%3D
GitHub public advisory API page: https://api.github.com/advisories?type=reviewed&per_page=100&sort=updated&direction=desc&after=Y3Vyc29yOnYyOpK0MjAyNi0xMC0yM1QyMDo0NzoxN1rOAAf0Kg%3D%3D
GitHub public advisory API page: https://api.github.com/advisories?type=reviewed&per_page=100&sort=updated&direction=desc&after=Y3Vyc29yOnYyOpK0MjAyNi0xMC0yM1QyMDo0NTozNlrOAAf0Jw%3D%3D
GitHub public advisory API page: https://api.github.com/advisories?type=reviewed&per_page=100&sort=updated&direction=desc&after=Y3Vyc29yOnYyOpK0MjAyNi0xMC0yM1QyMDo0NTowNVrOAAf0JQ%3D%3D
GitHub public advisory API page: https://api.github.com/advisories?type=reviewed&per_page=100&sort=updated&direction=desc&after=Y3Vyc29yOnYyOpK0MjAyNi0xMC0yM1QyMDo0Mzo0NVrOAAf0Iw%3D%3D
GitHub public advisory API page: https://api.github.com/advisories?type=reviewed&per_page=100&sort=updated&direction=desc&after=Y3Vyc29yOnYyOpK0MjAyNi0xMC0yM1QyMDo0MzozMVrOAAf0Ig%3D%3D
GitHub public advisory API page: https://api.github.com/advisories?type=reviewed&per_page=100&sort=updated&direction=desc
FIRST measured EPSS score: https://api.first.org/data/v1/epss?cve=CVE-2026-62204&date=2026-10-26
Record ID: CVE-2026-62204.
Record origin: Ingested record.
AI evidence: Not assessed.
Known exploitation: Not assessed.
Zero-day status: Not assessed. KEV membership alone does not establish zero-day status.
About this data

This record was ingested from a data source. Retrieved: Oct 27, 2026, 01:40 UTC. Ingestion is not an independent editorial investigation.

A CISA KEV listing documents known exploitation, not necessarily a zero-day; absence from the catalog does not prove a vulnerability has never been exploited.

Technology tags indicate possible relevance, not verified exposure. Confirm the affected product, version, and configuration against your own inventory; KEVWire does not scan your systems.

A personal reading checklist on this device, not verified remediation.

Record JSON

Your account

Email alerts

Email alerts are not available yet. To follow your stack today, use its RSS feed, which honors your filters, or connect an AI agent through the API.

Suggest an improvement

Ideas, missing sources, corrections, and bugs are all welcome. No account needed. Suggestions are reviewed by a person before anything changes.

Record details

Record detail