Skip to content

Commit b95f8fb

Browse files
1 parent 50fa218 commit b95f8fb

2 files changed

Lines changed: 20 additions & 6 deletions

File tree

advisories/github-reviewed/2026/03/GHSA-7fv4-fmmc-86g2/GHSA-7fv4-fmmc-86g2.json

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
11
{
22
"schema_version": "1.4.0",
33
"id": "GHSA-7fv4-fmmc-86g2",
4-
"modified": "2026-03-10T23:57:23Z",
4+
"modified": "2026-03-11T20:45:18Z",
55
"published": "2026-03-10T23:57:23Z",
66
"aliases": [
77
"CVE-2026-31861"
88
],
99
"summary": "@siteboon/claude-code-ui is Vulnerable to Shell Command Injection in Git Routes",
1010
"details": "# Shell Command Injection in User Git Config Endpoint\n\n| Field | Value |\n|-------|-------|\n| **Severity** | High |\n| **CVSS 3.1** | 8.8 (High) — when chained with VULN-01 |\n| **CWE** | CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') |\n| **Attack Vector** | Network |\n| **Authentication** | JWT required (bypassable via VULN-01) |\n| **Affected Files** | `server/routes/user.js` (lines 58-59) |\n\n## Description\n\nThe `/api/user/git-config` endpoint constructs shell commands by interpolating user-supplied `gitName` and `gitEmail` values into command strings passed to `child_process.exec()`. The input is placed within double quotes and only `\"` is escaped, but backticks (`` ` ``), `$()` command substitution, and `\\` sequences are all interpreted within double-quoted strings in bash.\n\nThis allows authenticated attackers to execute arbitrary OS commands via the git configuration endpoint.\n\n## Root Cause\n\n`server/routes/user.js` lines 58-59:\n\n```javascript\nawait execAsync(`git config --global user.name \"${gitName.replace(/\"/g, '\\\\\"')}\"`);\nawait execAsync(`git config --global user.email \"${gitEmail.replace(/\"/g, '\\\\\"')}\"`);\n```\n\nOnly `\"` is escaped. However, within double-quoted bash strings, the following are still interpreted:\n\n- `` `malicious_command` `` — backtick execution\n- `$(malicious_command)` — subshell execution\n\n## Impact\n\n- **Remote Code Execution (RCE)** — arbitrary OS commands execute as the Node.js process user\n- The `git config --global` vector modifies the **server-wide** git configuration, affecting all git operations\n- When chained with VULN-01 (hardcoded JWT), this is fully **unauthenticated RCE**\n- Attacker can: read/write any file, install backdoors, pivot to other systems, exfiltrate data\n\n## Proof of Concept\n\n```bash\n# Step 1: Forge a JWT (see VULN-01)\nTOKEN=$(python3 -c \"import jwt; print(jwt.encode({'userId':1,'username':'admin'}, 'claude-ui-dev-secret-change-in-production', algorithm='HS256'))\")\n\n# Step 2: Inject via gitName using command substitution\ncurl -X POST \"http://REDACTED:5173/api/user/git-config\" \\\n -H \"Authorization: Bearer $TOKEN\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"gitName\":\"$(id)\",\"gitEmail\":\"attacker@example.com\"}'\n```\n\nThe server executes:\n\n```\ngit config --global user.name \"$(id)\"\n```\n\nBash evaluates `$(id)` before passing it to git, executing the `id` command and setting the username to the output.\n\n## Remediation\n\nReplace `exec()` with `spawn()` (array arguments, no shell):\n\n```javascript\n// BEFORE (vulnerable):\nawait execAsync(`git config --global user.name \"${gitName.replace(/\"/g, '\\\\\"')}\"`);\n\n// AFTER (safe):\nawait spawnAsync('git', ['config', '--global', 'user.name', gitName]);\nawait spawnAsync('git', ['config', '--global', 'user.email', gitEmail]);\n```",
11-
"severity": [],
11+
"severity": [
12+
{
13+
"type": "CVSS_V4",
14+
"score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N"
15+
}
16+
],
1217
"affected": [
1318
{
1419
"package": {
@@ -38,6 +43,10 @@
3843
"type": "WEB",
3944
"url": "https://github.com/siteboon/claudecodeui/security/advisories/GHSA-7fv4-fmmc-86g2"
4045
},
46+
{
47+
"type": "ADVISORY",
48+
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-31861"
49+
},
4150
{
4251
"type": "WEB",
4352
"url": "https://github.com/siteboon/claudecodeui/commit/86c33c1c0cb34176725a38f46960213714fc3e04"
@@ -58,6 +67,6 @@
5867
"severity": "HIGH",
5968
"github_reviewed": true,
6069
"github_reviewed_at": "2026-03-10T23:57:23Z",
61-
"nvd_published_at": null
70+
"nvd_published_at": "2026-03-11T18:16:24Z"
6271
}
6372
}

advisories/github-reviewed/2026/03/GHSA-f2fc-vc88-6w7q/GHSA-f2fc-vc88-6w7q.json

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"schema_version": "1.4.0",
33
"id": "GHSA-f2fc-vc88-6w7q",
4-
"modified": "2026-03-11T00:25:43Z",
4+
"modified": "2026-03-11T20:45:24Z",
55
"published": "2026-03-11T00:25:43Z",
66
"aliases": [
77
"CVE-2026-31862"
@@ -43,6 +43,10 @@
4343
"type": "WEB",
4444
"url": "https://github.com/siteboon/claudecodeui/security/advisories/GHSA-f2fc-vc88-6w7q"
4545
},
46+
{
47+
"type": "ADVISORY",
48+
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-31862"
49+
},
4650
{
4751
"type": "PACKAGE",
4852
"url": "https://github.com/siteboon/claudecodeui"
@@ -54,11 +58,12 @@
5458
],
5559
"database_specific": {
5660
"cwe_ids": [
57-
"CWE-77"
61+
"CWE-77",
62+
"CWE-78"
5863
],
5964
"severity": "CRITICAL",
6065
"github_reviewed": true,
6166
"github_reviewed_at": "2026-03-11T00:25:43Z",
62-
"nvd_published_at": null
67+
"nvd_published_at": "2026-03-11T18:16:25Z"
6368
}
6469
}

0 commit comments

Comments
 (0)