calling-frontend-from-tauri-rust
Warn
Audited by Gen Agent Trust Hub on Sep 16, 2026
Risk Level: MEDIUMDYNAMIC_EXECUTIONINDIRECT_PROMPT_INJECTION
Full Analysis
- [DYNAMIC_EXECUTION]: The documentation demonstrates a
notify_frontendcommand that executes JavaScript from Rust using thewebview.eval()method. - Evidence:
let script = format!("window.showNotification('{}')", message); webview.eval(&script).unwrap();inSKILL.md. - Risk: This pattern uses unsafe string interpolation to build a JavaScript payload. If the
messagevariable contains untrusted user input, an attacker can escape the string literal (e.g., using'); alert(1); //) to execute arbitrary JavaScript within the application's webview context. - [INDIRECT_PROMPT_INJECTION]: The skill defines a vulnerability surface where externally influenced data flows into an execution sink.
- Ingestion points: The
messageparameter in thenotify_frontendRust function inSKILL.md. - Boundary markers: None; the code uses basic single-quote wrapping within a Rust
format!macro. - Capability inventory: The
webview.evalcapability allows for arbitrary script execution, which can access frontend APIs and potentially trigger other Tauri commands. - Sanitization: The example provides no sanitization or escaping logic for the interpolated input, although it later mentions
serialize-to-javascriptas a more complex alternative.
Audit Metadata