Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
address review: use path.relative for containment check, clarify pipeline task ID fallback
Adam Eivy6617c2230064
diff --git a/server/services/subAgentSpawner.js b/server/services/subAgentSpawner.jsindex 5ff2dda2e0..bd6fe0ec2f 100644--- a/server/services/subAgentSpawner.js+++ b/server/services/subAgentSpawner.js@@ -7,7 +7,7 @@*/import { spawn, execSync } from 'child_process';-import { join, resolve } from 'path';+import { join, relative, resolve } from 'path';import { writeFile, mkdir, readFile, readdir, rm, stat, unlink } from 'fs/promises'; // mkdir kept for non-recursive useimport { existsSync } from 'fs';import { homedir } from 'os';@@ -1888,7 +1888,8 @@ async function handlePipelineProgression(task, agentId, success) {if (file) {const filePath = resolve(repoRoot, file);// Only delete files within the repo directory (prevent path traversal)- if (!filePath.startsWith(repoRoot + '/')) continue;+ const rel = relative(repoRoot, filePath);+ if (!rel || rel.startsWith('..') || resolve(rel) === rel) continue;await unlink(filePath).catch(() => {});}}@@ -1918,7 +1919,7 @@ async function handlePipelineProgression(task, agentId, success) {if (task.metadata.app) prompt = prompt.replace(/\{appId\}/g, task.metadata.app);const nextTask = {- id: `${task.id || 'sys'}-stage${nextStageIndex}-${Date.now().toString(36)}`,+ id: `${task.id || 'sys-pipeline'}-stage${nextStageIndex}-${Date.now().toString(36)}`,status: 'pending',description: prompt,priority: task.priority || 'MEDIUM',