Skip to content

Potential fix for code scanning alert no. 29: Insecure temporary file#886

Open
EmersonBraun wants to merge 1 commit into
mainfrom
alert-autofix-29
Open

Potential fix for code scanning alert no. 29: Insecure temporary file#886
EmersonBraun wants to merge 1 commit into
mainfrom
alert-autofix-29

Conversation

@EmersonBraun
Copy link
Copy Markdown
Collaborator

Potential fix for https://github.com/AgentsKit-io/agentskit/security/code-scanning/29

General fix: do not use the shared OS temp directory as a writable workspace root for filesystem operations. Use a non-temp, explicitly controlled directory, or avoid enabling writable filesystem tooling when only metadata is needed.

Best minimal fix here (without changing functionality of metadata extraction): in packages/tools/src/discovery.ts, change the filesystem instantiation in listTools() from basePath: tmpdir() to a safer fixed path like the current working directory (process.cwd()). Also remove the now-unused tmpdir import.

Edits needed:

  • File: packages/tools/src/discovery.ts
    • Remove import { tmpdir } from 'node:os'.
    • Replace ...filesystem({ basePath: tmpdir() }), with ...filesystem({ basePath: process.cwd() }),.

No changes are required in packages/tools/src/filesystem.ts for this specific finding.

Suggested fixes powered by Copilot Autofix. Review carefully before merging.

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 22, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
agentskit-doc Ignored Ignored Preview May 22, 2026 11:42am

@EmersonBraun EmersonBraun marked this pull request as ready for review May 22, 2026 11:42
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.

1 participant