Skip to main content

Boteraser | Website and Server Security Solutions

🛡️ CVE-2026-40318 — siyuan

🟠 CVSS 8.5 — High ✅ No Known Exploit CWE-24 NVD
8.5
CVSS Score
0 Low4 Medium7 High9 Critical10

Description

SiYuan: Publish Reader Path Traversal Delete via removeUnusedAttributeView

Summary

The endpoint /api/av/removeUnusedAttributeView is vulnerable to a path traversal (CWE-22) that allows an attacker to delete arbitrary .json files on the server.

The issue arises because user-controlled input (id) is directly used in filesystem path construction without validation or restriction.

> Access to this endpoint (e.g., via a Reader-role or publish context) is considered a precondition and not part of the vulnerability. The root cause is unsafe path handling.

Steps To Reproduce

1. Ensure the target instance has the publish service enabled (or any valid access to the endpoint).

2. Send the following request:

```http

POST /api/av/removeUnusedAttributeView HTTP/1.1

Host: <target>

Content-Type: application/json

{

"id": "../../../conf/conf"

}

```

3. Observe that the request is accepted.

4. The server resolves the path outside the intended directory and deletes the target file.

Impact

An attacker can delete arbitrary .json files within the workspace directory.

This may lead to:

  • Deletion of global configuration files (e.g., conf/conf.json)
  • Loss of user data and application state
  • Corruption of workspace metadata
  • Persistent application instability or forced recovery

This represents a server-side arbitrary file deletion primitive, which can have severe impact depending on the targeted files.

Technical Details

The vulnerable code constructs file paths as follows:

```go

filepath.Join(util.DataDir, "storage", "av", id+".json")

```

Because id is not validated, attackers can inject path traversal sequences such as ../ to escape the intended directory.

Example payloads

  • ../localdata/storage/local.json
  • ../../storage/outlinedata/storage/outline.json
  • ../../../conf/confconf/conf.json

No validation or restriction is applied to:

  • input format
  • path normalization
  • directory boundaries

Root Cause

  • Untrusted user input (id) is directly used in filesystem path construction
  • No input validation or sanitization
  • No enforcement that the resolved path stays within the intended directory

Remediation

1. Validate input strictly

  • Only allow valid Attribute View IDs
  • Reject any input containing path traversal sequences

2. Enforce directory boundaries

```go

base := filepath.Join(util.DataDir, "storage", "av")

absPath := filepath.Join(base, id+".json")

if !util.IsSubPath(base, absPath) {

return error

}

```

3. Normalize paths before use

  • Ensure canonical paths cannot escape the base directory

4. Add additional logical checks

  • Verify that the target object is valid and allowed to be deleted

How this vulnerability can be exploited

This issue can be reached over the network, attack complexity is low, an attacker needs low-level privileges on the target. No user interaction is required. The scope is changed, meaning a successful attack can affect components beyond the vulnerable one. Rated impact: confidentiality none, integrity low, availability high.

CVSS metrics in full

The score comes from this vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:N/I:L/A:H

  • Attack vector: Network — reachable from anywhere that can route to the service.
  • Attack complexity: Low — the attack works reliably, with no preparation.
  • Privileges required: Low — an ordinary user account is enough.
  • User interaction: None — nobody has to be tricked into anything.
  • Scope: Changed — a successful attack reaches components beyond the vulnerable one.
  • Confidentiality impact: None.
  • Integrity impact: Low — limited, and the attacker does not choose what is affected.
  • Availability impact: High — total loss, or loss the attacker controls.

Weakness class

CVE-2026-40318 is classified as CWE-24: Path Traversal: '../filedir'. The product uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize "../" sequences that can resolve to a location that is outside of that directory.

Affected software

CVE-2026-40318 is recorded against 2 packages.

  • github.com/siyuan-note/siyuan/kernel
  • siyuan (fixed in 3.6.4)

Timeline and source

Published on 10 April 2026 and last revised on 25 June 2026. No public exploit is currently recorded for this entry. Record sourced from NVD.

References

github.com (Web)
nvd.nist.gov (Advisory)
github.com (Package)
github.com (Web)

Other advisories for this package

github.com/siyuan-note/siyuan/kernel has other advisories on record. If you are patching this one, these are worth checking on the same host:

Same weakness in other software

These advisories are the same class of weakness (CWE-24: Path Traversal: '../filedir') in other software:

Details

Severity HIGH
CVSS Score 8.5
CVSS Vector CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:N/I:L/A:H
CWE CWE-24
Public Exploit ✅ No
Source NVD
Published 2026-04-10
Updated 2026-08-20
Modified 2026-06-25
Fix URL N/A

Affected Packages

Software From version Fixed in
github.com/siyuan-note/siyuan/kernel
siyuan 3.6.4

Similar Threats

Site Security Check

Is siyuan part of your stack?

CVE-2026-40318 is rated CVSS 8.5 High. BotEraser scans your installation against known CVE records and tells you whether this vulnerability applies to the versions you actually run.

Scan My Site Free →

No credit card required  ·  Results in minutes

ⓘ Data Notice: The information presented above has been compiled from publicly available internet sources. Boteraser aggregates this data solely for informational purposes and does not independently classify, evaluate, or endorse any findings about the vulnerabilities listed. The accuracy and completeness of this information is the sole responsibility of the original publishers. Boteraser and its operators accept no liability for any decisions made based on this data.

Browse related advisories

All advisoriesCVECVE 2026