Skip to content

chore: restrict local paths edge_functions#244

Open
staaldraad wants to merge 2 commits intomainfrom
etienne/sec-682-fixed-path-deploy_edge_function
Open

chore: restrict local paths edge_functions#244
staaldraad wants to merge 2 commits intomainfrom
etienne/sec-682-fixed-path-deploy_edge_function

Conversation

@staaldraad
Copy link
Copy Markdown
Contributor

What kind of change does this PR introduce?

chore

What is the current behavior?

mcp server has lax local path name acceptance

What is the new behavior?

enforces paths to be in the current working directory

@staaldraad staaldraad requested a review from mattrossman March 24, 2026 11:57
name: z.string(),
name: z.string().refine(
(filePath) => {
const resolved = path.resolve(process.cwd(), filePath);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks off to me—in this context, name represents the path within the edge function bundle where the function will be written, not a file path on the machine running the MCP process. Why would process.cwd() be a factor? I might need to see a test case showing what sort of scenario this prevents to better understand the motivation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants