Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
Mirrored from https://github.com/Camo67/composio.git
Synced Nov 21, 13:30 UTC
fix(sdk): run typedoc without a shell in generate-docs (SEC-899) (#4416)
## Summary `ts/packages/core/scripts/generate-docs.ts` joined `npx typedoc` and every discovered `src/models/*.ts` file name into one string and ran it with `execSync`, so a model file whose name contains shell metacharacters would execute as a command. The script runs in CI on every push to `next` with a write-scoped app token (`generate-sdk-docs.yml`). Reported by AppSecure as SEC-899 (command injection via documentation generation). Fixes SEC-899 (internal tracker). ## Changes - Build the typedoc argument vector as an array (`buildTypeDocArgs`) and run it with `execFileSync`, so no shell is involved. - Skip model files whose names fall outside `[A-Za-z0-9_.-]` (with a warning) in `discoverModelFiles`. - Regression tests in `test/scripts/generate-docs.test.ts`: metacharacter names are dropped, entry points stay separate arguments. ## Type of change - [x] Bug fix - [ ] New feature - [ ] Refactor/Chore - [ ] Documentation - [ ] Breaking change ## How Has This Been Tested? ``` pnpm --filter @composio/core exec vitest run test/scripts/generate-docs.test.ts Test Files 1 passed (1) Tests 12 passed (12) pnpm exec prettier --check ts/packages/core/scripts/generate-docs.ts ts/packages/core/test/scripts/generate-docs.test.ts All matched files use Prettier code style! ``` Node 24.17.0 and pnpm 11.8.0 via mise. ## Screenshots (if applicable) ## Checklist - [x] I have read the Code of Conduct and this PR adheres to it - [x] I ran linters/tests locally and they passed - [x] I updated documentation as needed - [x] I added tests or explain why not applicable - [x] I added a changeset if this change affects published packages (not needed: `scripts/` is a build-time script, not part of the published package) ## Additional context The generated docs output is unchanged; only how typedoc is invoked changes. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com> Co-authored-by: jkomyno <alberto@composio.dev>