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_frontend command that executes JavaScript from Rust using the webview.eval() method.
  • Evidence: let script = format!("window.showNotification('{}')", message); webview.eval(&script).unwrap(); in SKILL.md.
  • Risk: This pattern uses unsafe string interpolation to build a JavaScript payload. If the message variable 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 message parameter in the notify_frontend Rust function in SKILL.md.
  • Boundary markers: None; the code uses basic single-quote wrapping within a Rust format! macro.
  • Capability inventory: The webview.eval capability 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-javascript as a more complex alternative.
Audit Metadata
Risk Level
MEDIUM
Analyzed
Sep 16, 2026, 09:53 PM