calling-frontend-from-tauri-rust
Fail
Audited by Gen Agent Trust Hub on Feb 17, 2026
Risk Level: HIGHCOMMAND_EXECUTIONCREDENTIALS_UNSAFE
Full Analysis
- [COMMAND_EXECUTION] (HIGH): Insecure use of
webview.eval()in thenotify_frontendfunction. The code usesformat!()to interpolate a string directly into a JavaScript execution context:format!("window.showNotification('{}')", message). Ifmessagecontains characters like', an attacker can break the string literal and execute arbitrary JavaScript code in the frontend (XSS/JS Injection). - [CREDENTIALS_UNSAFE] (LOW): The
loginfunction example contains hardcoded credentials (user == "tauri-apps"andpassword == "tauri"). While provided as a simplified guide example, it promotes insecure coding practices. - [EXTERNAL_DOWNLOADS] (LOW): The guide references the
serialize-to-javascriptcrate inCargo.toml. While this crate is intended to mitigate the injection issue mentioned above, the skill still presents the insecureformat!method as a valid approach.
Recommendations
- AI detected serious security threats
Audit Metadata