Skip to content

Commit 3c52a5e

Browse files
1 parent 9e5b282 commit 3c52a5e

File tree

4 files changed

+248
-0
lines changed

4 files changed

+248
-0
lines changed
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
{
2+
"schema_version": "1.4.0",
3+
"id": "GHSA-3g9h-9hp4-654v",
4+
"modified": "2026-03-18T20:11:00Z",
5+
"published": "2026-03-18T20:11:00Z",
6+
"aliases": [
7+
"CVE-2026-33203"
8+
],
9+
"summary": "SiYuan has an Unauthenticated WebSocket DoS via Auth Keepalive Bypass",
10+
"details": "## Summary\nThe SiYuan kernel WebSocket server accepts unauthenticated connections when a specific “auth keepalive” query parameter is present. After connection, incoming messages are parsed using unchecked type assertions on attacker-controlled JSON.\n\nA remote attacker can send malformed messages that trigger a runtime panic, potentially crashing the kernel process and causing denial of service.\n\n## Details\n**1. Authentication Bypass via Keepalive Query**\n\nUnauthenticated connections are accepted if the request URI matches a specific pattern intended for an authentication page keepalive.\n\n**File: kernel/server/serve.go**\n\n```\nif !authOk {\n authOk = strings.Contains(s.Request.RequestURI, \"/ws?app=siyuan\") &&\n strings.Contains(s.Request.RequestURI, \"&id=auth&type=auth\")\n}\n\n```\n\n**2. Unsafe Type Assertions on Untrusted Input**\n\nIncoming JSON messages are parsed into a generic map and fields are accessed without validation.\n\n**File: kernel/server/serve.go**\n\n```\ncmdStr := request[\"cmd\"].(string)\ncmdId := request[\"reqId\"].(float64)\nparam := request[\"param\"].(map[string]interface{})\n\n```\nMalformed or missing fields trigger a runtime panic.\nThe handler does not implement local panic recovery, allowing crashes to propagate.\n\n## PoC\n**Step 1 — Prepare workspace directory**\n\n```sh\nmkdir -p ./workspace\n```\n\n**Step 2 — Run SiYuan container**\n\n```\ndocker run -d \\\n -p 6806:6806 \\\n -e SIYUAN_ACCESS_AUTH_CODE_BYPASS=true \\\n -v $(pwd)/workspace:/siyuan/workspace \\\n b3log/siyuan \\\n --workspace=/siyuan/workspace\n```\n\nService becomes reachable at http://127.0.0.1:6806\n\n**Step 3 — Confirm service availability**\n\nOpen in browser:\n\n```sh\nhttp://127.0.0.1:6806\n```\n\n**Step 4 — Connect to unauthenticated WebSocket endpoint**\n\n```sh\nws://127.0.0.1:6806/ws?app=siyuan&id=auth&type=auth\n```\n\nThis connection is accepted without credentials.\n\n**Step 5 — Send malformed payload**\n\nPayload:\n\n```sh\n\n{}\n\n```\n\n**Step 6 — Observe behavior**\n\nMonitor container logs:\n\n```sh\n\ndocker logs -f <container_id>\n\n```\n## Impact\nAn unauthenticated attacker with network access can repeatedly crash the kernel, causing persistent denial of service.\n\nImpact is highest when the service is exposed beyond localhost (e.g., Docker deployments, reverse proxies, LAN access, or public hosting).",
11+
"severity": [
12+
{
13+
"type": "CVSS_V3",
14+
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
15+
}
16+
],
17+
"affected": [
18+
{
19+
"package": {
20+
"ecosystem": "Go",
21+
"name": "github.com/siyuan-note/siyuan/kernel"
22+
},
23+
"ranges": [
24+
{
25+
"type": "ECOSYSTEM",
26+
"events": [
27+
{
28+
"introduced": "0"
29+
},
30+
{
31+
"fixed": "3.6.2"
32+
}
33+
]
34+
}
35+
],
36+
"database_specific": {
37+
"last_known_affected_version_range": "<= 3.6.1"
38+
}
39+
}
40+
],
41+
"references": [
42+
{
43+
"type": "WEB",
44+
"url": "https://github.com/siyuan-note/siyuan/security/advisories/GHSA-3g9h-9hp4-654v"
45+
},
46+
{
47+
"type": "PACKAGE",
48+
"url": "https://github.com/siyuan-note/siyuan"
49+
}
50+
],
51+
"database_specific": {
52+
"cwe_ids": [
53+
"CWE-248",
54+
"CWE-306"
55+
],
56+
"severity": "HIGH",
57+
"github_reviewed": true,
58+
"github_reviewed_at": "2026-03-18T20:11:00Z",
59+
"nvd_published_at": null
60+
}
61+
}
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
{
2+
"schema_version": "1.4.0",
3+
"id": "GHSA-5rvc-5cwx-g5x8",
4+
"modified": "2026-03-18T20:11:27Z",
5+
"published": "2026-03-18T20:11:27Z",
6+
"aliases": [
7+
"CVE-2026-33192"
8+
],
9+
"summary": "free5GC UDM incorrectly returns 500 for empty supi path parameter in PATCH sdm-subscriptions reques",
10+
"details": "**Impact** \nThis is an Improper Error Handling vulnerability with Information Exposure implications, combined with an HTTP Method Translation issue. \n- **Security Impact**: The UDM incorrectly converts a downstream 400 Bad Request (from UDR) into a 500 Internal Server Error when handling PATCH requests with an empty `supi` path parameter. Additionally, the UDM incorrectly translates the PATCH method to PUT when forwarding to UDR, indicating a deeper architectural issue. This leaks internal error handling behavior and makes it difficult for clients to distinguish between client-side errors and server-side failures. \n- **Functional Impact**: When a client sends a PATCH request with an empty `supi` (e.g., double slashes `//` in URL path), the UDM forwards a PUT request to UDR with the malformed path, which correctly returns 400. However, UDM propagates this as 500 SYSTEM_FAILURE instead of returning the appropriate 400 error to the client. This violates REST API best practices for PATCH operations and may indicate improper HTTP method handling. \n- **Affected Parties**: All deployments of free5GC v4.0.1 using the UDM Nudm_SDM service with PATCH operations on sdm-subscriptions endpoint.\n\n**Patches** \nYes, the issue has been patched. \nThe fix is implemented in PR free5gc/udm#79. \nUsers should upgrade to the next release of free5GC that includes this commit.\n\n**Workarounds** \nThere is no direct workaround at the application level. The recommendation is to apply the provided patch or implement API gateway-level validation to reject PATCH requests with empty path parameters before they reach UDM.",
11+
"severity": [
12+
{
13+
"type": "CVSS_V4",
14+
"score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N"
15+
}
16+
],
17+
"affected": [
18+
{
19+
"package": {
20+
"ecosystem": "Go",
21+
"name": "github.com/free5gc/udm"
22+
},
23+
"ranges": [
24+
{
25+
"type": "ECOSYSTEM",
26+
"events": [
27+
{
28+
"introduced": "0"
29+
},
30+
{
31+
"fixed": "1.4.2"
32+
}
33+
]
34+
}
35+
]
36+
}
37+
],
38+
"references": [
39+
{
40+
"type": "WEB",
41+
"url": "https://github.com/free5gc/free5gc/security/advisories/GHSA-5rvc-5cwx-g5x8"
42+
},
43+
{
44+
"type": "WEB",
45+
"url": "https://github.com/free5gc/free5gc/issues/784"
46+
},
47+
{
48+
"type": "WEB",
49+
"url": "https://github.com/free5gc/udm/pull/79"
50+
},
51+
{
52+
"type": "PACKAGE",
53+
"url": "https://github.com/free5gc/udm"
54+
}
55+
],
56+
"database_specific": {
57+
"cwe_ids": [
58+
"CWE-209"
59+
],
60+
"severity": "HIGH",
61+
"github_reviewed": true,
62+
"github_reviewed_at": "2026-03-18T20:11:27Z",
63+
"nvd_published_at": null
64+
}
65+
}
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{
2+
"schema_version": "1.4.0",
3+
"id": "GHSA-p9hg-pq3q-v9gv",
4+
"modified": "2026-03-18T20:11:15Z",
5+
"published": "2026-03-18T20:11:15Z",
6+
"aliases": [
7+
"CVE-2026-33191"
8+
],
9+
"summary": "free5GC UDM vulnerable to null byte injection in URL path parameters causing 500 Internal Server Error",
10+
"details": "**Impact** \nThis is an Improper Input Validation vulnerability with Denial of Service and Injection implications. \n- **Security Impact**: A remote attacker can inject null bytes (URL-encoded as `%00`) into the `supi` path parameter of the UDM's Nudm_SubscriberDataManagement API. This causes URL parsing failure in Go's `net/url` package with the error \"invalid control character in URL\", resulting in a 500 Internal Server Error. This null byte injection vulnerability can be exploited for denial of service attacks. \n- **Functional Impact**: When the `supi` parameter contains null characters, the UDM attempts to construct a URL for UDR that includes these control characters. Go's URL parser rejects them, causing the request to fail with 500 instead of properly validating input and returning 400 Bad Request. \n- **Affected Parties**: All deployments of free5GC v4.0.1 using the UDM Nudm_SDM service with endpoints that include path parameters (e.g., `/nudm-sdm/v2/{supi}/am-data`).\n\n**Patches** \nYes, the issue has been patched. \nThe fix is implemented in PR free5gc/udm#79. \nUsers should upgrade to the next release of free5GC that includes this commit.\n\n**Workarounds** \nThere is no direct workaround at the application level. The recommendation is to apply the provided patch or implement API gateway-level validation to reject requests containing null bytes in path parameters before they reach UDM.",
11+
"severity": [
12+
{
13+
"type": "CVSS_V4",
14+
"score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N"
15+
}
16+
],
17+
"affected": [
18+
{
19+
"package": {
20+
"ecosystem": "Go",
21+
"name": "github.com/free5gc/udm"
22+
},
23+
"ranges": [
24+
{
25+
"type": "ECOSYSTEM",
26+
"events": [
27+
{
28+
"introduced": "0"
29+
},
30+
{
31+
"fixed": "1.4.2"
32+
}
33+
]
34+
}
35+
]
36+
}
37+
],
38+
"references": [
39+
{
40+
"type": "WEB",
41+
"url": "https://github.com/free5gc/free5gc/security/advisories/GHSA-p9hg-pq3q-v9gv"
42+
},
43+
{
44+
"type": "WEB",
45+
"url": "https://github.com/free5gc/udm/pull/79"
46+
},
47+
{
48+
"type": "PACKAGE",
49+
"url": "https://github.com/free5gc/udm"
50+
}
51+
],
52+
"database_specific": {
53+
"cwe_ids": [
54+
"CWE-158",
55+
"CWE-248"
56+
],
57+
"severity": "HIGH",
58+
"github_reviewed": true,
59+
"github_reviewed_at": "2026-03-18T20:11:15Z",
60+
"nvd_published_at": null
61+
}
62+
}
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
{
2+
"schema_version": "1.4.0",
3+
"id": "GHSA-vm69-h85x-8p85",
4+
"modified": "2026-03-18T20:10:44Z",
5+
"published": "2026-03-18T20:10:44Z",
6+
"aliases": [
7+
"CVE-2026-33194"
8+
],
9+
"summary": "SiYuan has an Incomplete Fix for IsSensitivePath Denylist Allows File Read from /opt, /usr, /home (GHSA-h5vh-m7fg-w5h6 Bypass)",
10+
"details": "## Summary\n\nThe `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.\n\n## Details\n\nCurrent denylist in `kernel/util/path.go:391-405`:\n\n```go\nprefixes := []string{\n \"/.\", // dotfiles\n \"/etc\", // system config\n \"/root\", // root home\n \"/var\", // variable data\n \"/proc\", // process info\n \"/sys\", // sysfs\n \"/run\", // runtime data\n \"/bin\", // binaries\n \"/boot\", // boot files\n \"/dev\", // devices\n \"/lib\", // libraries\n \"/srv\", // service data\n \"/tmp\", // temp files\n}\n```\n\n**NOT blocked:**\n- `/opt` — commonly contains application data, databases, credentials. In SiYuan Docker, `/opt/siyuan/` contains the application itself.\n- `/usr` — contains `/usr/local/etc`, `/usr/local/share`, custom configs\n- `/home` — other users' home directories (only `~/.ssh` and `~/.config` of the current HomeDir are blocked via separate checks, but other users' homes are accessible)\n- `/mnt`, `/media` — mounted volumes, network shares, often containing secrets\n- `/snap` — snap package data\n- `/sbin`, `/lib64` — system binaries/libraries\n\nThe `globalCopyFiles` endpoint at `kernel/api/file.go:82` uses `IsSensitivePath` as its sole path validation:\n\n```go\nif util.IsSensitivePath(absSrc) {\n // reject\n continue\n}\n// File is copied into workspace — then readable via /api/file/getFile\n```\n\n## PoC\n\n```bash\n# Read SiYuan's own application files from /opt (Docker deployment)\ncurl -s 'http://127.0.0.1:6806/api/file/globalCopyFiles' \\\n -H 'Authorization: Token YOUR_API_TOKEN' \\\n -H 'Content-Type: application/json' \\\n -d '{\"srcs\":[\"/opt/siyuan/kernel/SiYuan-Kernel\"],\"destDir\":\"data/assets\"}'\n\n# Then read the copied file from workspace\ncurl -s 'http://127.0.0.1:6806/api/file/getFile' \\\n -H 'Authorization: Token YOUR_API_TOKEN' \\\n -H 'Content-Type: application/json' \\\n -d '{\"path\":\"data/assets/SiYuan-Kernel\"}'\n\n# Read files from mounted volumes\ncurl -s 'http://127.0.0.1:6806/api/file/globalCopyFiles' \\\n -H 'Authorization: Token YOUR_API_TOKEN' \\\n -H 'Content-Type: application/json' \\\n -d '{\"srcs\":[\"/mnt/secrets/credentials.json\"],\"destDir\":\"data/assets\"}'\n```\n\n## Impact\n\n- Read arbitrary files from `/opt`, `/usr`, `/home`, `/mnt`, `/media` and any other non-denylisted path\n- In Docker deployments: read application source code, configs, mounted secrets\n- The denylist approach is fundamentally flawed — any newly added filesystem path is accessible until explicitly blocked\n\n## Recommended Fix\n\nSwitch from a denylist to an allowlist approach. Only permit copying from the workspace directory and explicitly approved external paths:\n\n```go\nfunc IsSensitivePath(p string) bool {\n absPath := filepath.Clean(p)\n\n // Allowlist: only workspace and configured safe directories\n if strings.HasPrefix(absPath, WorkspaceDir) {\n // Block workspace-internal sensitive paths (conf/)\n if strings.HasPrefix(absPath, filepath.Join(WorkspaceDir, \"conf\")) {\n return true\n }\n return false\n }\n\n // Everything outside workspace is sensitive by default\n return true\n}\n```",
11+
"severity": [
12+
{
13+
"type": "CVSS_V3",
14+
"score": "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:N/A:N"
15+
}
16+
],
17+
"affected": [
18+
{
19+
"package": {
20+
"ecosystem": "Go",
21+
"name": "github.com/siyuan-note/siyuan/kernel"
22+
},
23+
"ranges": [
24+
{
25+
"type": "ECOSYSTEM",
26+
"events": [
27+
{
28+
"introduced": "0"
29+
},
30+
{
31+
"fixed": "3.6.2"
32+
}
33+
]
34+
}
35+
],
36+
"database_specific": {
37+
"last_known_affected_version_range": "<= 3.6.1"
38+
}
39+
}
40+
],
41+
"references": [
42+
{
43+
"type": "WEB",
44+
"url": "https://github.com/siyuan-note/siyuan/security/advisories/GHSA-vm69-h85x-8p85"
45+
},
46+
{
47+
"type": "PACKAGE",
48+
"url": "https://github.com/siyuan-note/siyuan"
49+
}
50+
],
51+
"database_specific": {
52+
"cwe_ids": [
53+
"CWE-22"
54+
],
55+
"severity": "MODERATE",
56+
"github_reviewed": true,
57+
"github_reviewed_at": "2026-03-18T20:10:44Z",
58+
"nvd_published_at": null
59+
}
60+
}

0 commit comments

Comments
 (0)