Potential fix for code scanning alert no. 12: Unvalidated dynamic method call#10
Open
noisyloop wants to merge 1 commit into
Open
Potential fix for code scanning alert no. 12: Unvalidated dynamic method call#10noisyloop wants to merge 1 commit into
noisyloop wants to merge 1 commit into
Conversation
…hod call Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
noisyloop
pushed a commit
that referenced
this pull request
Mar 10, 2026
- Bump tar to 7.5.11 and minimatch to 3.1.5 (dependabot PRs #16, #17) - Fix resource exhaustion (alert #10): add 1MB body size limit in API server parseBody and 10MB line buffer cap in MCP stdio transport - Fix unvalidated dynamic method call (alert #12): validate plugin/action identifiers against allowlist pattern before dynamic dispatch - Add input schema validation in PluginRegistry.execute - Add command allowlist to MCPStdioTransport to prevent arbitrary spawns - Fix symlink sandbox escape in file-ops by resolving real paths - Block internal event types from external API emission https://claude.ai/code/session_019XKgAhVu9mEc6NuLMMb5Wn
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Potential fix for https://github.com/m0rs3c0d3/EverythingOS/security/code-scanning/12
General approach: Ensure that any dynamically selected handler is validated before invocation. That means confirming we actually have a function conforming to
NodeHandlerbefore calling it inexecuteWithTimeout, and centralizing any additional type checks there. Even thoughgetHandleralready ensures either a registered handler orundefined, adding a runtimetypeofcheck at the call site addresses the static tool’s concern and guards against accidental misuse (e.g., someone storing a non-function inhandlersin future changes).Best concrete fix in this code:
executeWithTimeoutinsrc/core/workflow/WorkflowEngine.tsso that it:handleris a function (typeof handler === 'function').Promise.racepath.handleris a proper function (as is currently assumed), but it converts any future accidental misuse into a predictable error with a clear message, and satisfies the static analysis tool’s requirement to validate the dynamically called target.No other files need code changes; we just adjust the implementation of
executeWithTimeoutwhere the flagged call occurs. No new imports or types are required.Suggested fixes powered by Copilot Autofix. Review carefully before merging.