fix(codex): close symlink escape on GET /file, pin project writes to server cwd

This commit is contained in:
2026-09-08 20:07:57 +07:00
parent 32839332f2
commit 29ed86d672
7 changed files with 246 additions and 89 deletions
+5 -4
View File
@@ -398,9 +398,8 @@ const paths = {
tags: ["CodexConfig"],
summary: "Create or overwrite a text artifact",
description:
"Writes skills/agents/rules/memory/config. `name` is required for skills/agents/rules and forbidden for memory/config (fixed filenames). Backs up any existing file first; broadcasts `codex_config_changed` on success.",
"Writes skills/agents/rules/memory/config. `name` is required for skills/agents/rules and forbidden for memory/config (fixed filenames). `project` scope always resolves against the dashboard server's own cwd — there is no `?cwd=` override on writes, unlike the read routes, so a caller cannot point a write at an arbitrary directory. Backs up any existing file first; broadcasts `codex_config_changed` on success.",
operationId: "codexConfigPutFile",
parameters: [cwdParam],
requestBody: {
required: true,
content: {
@@ -436,9 +435,8 @@ const paths = {
tags: ["CodexConfig"],
summary: "Delete a text artifact",
description:
"Deletes skills/agents/rules/memory/config. Backup is mandatory and runs first. Broadcasts `codex_config_changed` on success.",
"Deletes skills/agents/rules/memory/config. `project` scope always resolves against the dashboard server's own cwd — no `?cwd=` override, same as PUT. Backup is mandatory and runs first. Broadcasts `codex_config_changed` on success.",
operationId: "codexConfigDeleteFile",
parameters: [cwdParam],
requestBody: {
required: true,
content: {
@@ -518,6 +516,7 @@ const paths = {
content: { "application/json": { schema: { type: "object", properties: { mcp: {} } } } },
},
422: cliExitResponse,
502: errorResponse("ECLIBADOUTPUT", "could not parse `codex` JSON output"),
503: errorResponse("ECLINOTFOUND", "the `codex` CLI was not found on PATH"),
},
},
@@ -537,6 +536,7 @@ const paths = {
},
},
422: cliExitResponse,
502: errorResponse("ECLIBADOUTPUT", "could not parse `codex` JSON output"),
503: errorResponse("ECLINOTFOUND", "the `codex` CLI was not found on PATH"),
},
},
@@ -556,6 +556,7 @@ const paths = {
},
},
422: cliExitResponse,
502: errorResponse("ECLIBADOUTPUT", "could not parse `codex` JSON output"),
503: errorResponse("ECLINOTFOUND", "the `codex` CLI was not found on PATH"),
},
},