This extension is designed to run JavaScript code that the user themselves writes and configures. The AI model can only choose which pre-written scripts to trigger; it cannot supply its own code. This is the extension's stated purpose and is clearly documented.
Technical evidence
Scanner reason: OpenGrep matched static-analysis rule tavernkeeper.dynamic-execution.javascript-eval in this repository.
Contextual assessment: The Function constructor at line 103 executes JavaScript stored in the user's configured script objects. The data flow is: user authors JavaScript in the Sorcery settings UI, it is persisted as script.javascript, and runScript invokes runJavaScript only for scripts the user explicitly created and enabled. The AI model cannot inject arbitrary code; it can only emit markers that trigger pre-configured scripts by ID. This dynamic execution is the core stated functionality of the extension, disclosed in the README, and the executed code is user-authored rather than model- or attacker-controlled.
This extension is designed to let AI characters run user-written code at specific moments during a chat. The flagged line is simply the mechanism that runs JavaScript that the user themselves has typed into the extension's configuration. The AI cannot supply its own code; it can only trigger scripts the user already set up. This matches the extension's stated purpose and is disclosed in its documentation.
Technical evidence
Scanner reason: JavaScript analysis matched static JavaScript security signal javascript.xray.unsafe-stmt in this repository.
Contextual assessment: The candidate flags Function(javascript)() on line 103 as a dynamic code execution signal. In context, runJavaScript is called from runScript with script.javascript, where script objects come from the user-configured enabledScripts list (line 74). Scripts are triggered when a marker matching a script ID is found in the streaming AI output (lines 134-143). The model can only select among pre-configured script IDs; it cannot inject arbitrary code. This dynamic execution of user-authored JavaScript is the explicitly stated core functionality of the Sorcery extension, disclosed in the README. The capability is proportional to the project purpose, visible to users, and not obfuscated.