Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 0 additions & 54 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion desktop/src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ clavyn-core = { path = "../../core" }
tauri = { version = "2", features = [] }
tauri-plugin-shell = "2"
tauri-plugin-dialog = "2"
tauri-plugin-os = "2"
tauri-plugin-updater = "2"
tauri-plugin-process = "2"
tauri-plugin-single-instance = "2"
Expand Down
66 changes: 64 additions & 2 deletions desktop/src-tauri/capabilities/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,70 @@
"description": "Default capability for the main window",
"windows": ["main"],
"permissions": [
"core:default",
"core:event:allow-listen",
"core:event:allow-unlisten",
"core:webview:allow-internal-toggle-devtools",
"shell:allow-open",
"os:default"
Comment thread
computerbox124 marked this conversation as resolved.
Resolved
"allow-startup-failure",
"allow-set-aside-unreadable-file",
"allow-restart-app",
"allow-list-hosts",
"allow-add-host",
"allow-update-host",
"allow-delete-host",
"allow-list-groups",
"allow-add-group",
"allow-delete-group",
"allow-list-identities",
"allow-add-identity",
"allow-update-identity",
"allow-delete-identity",
"allow-vault-is-initialized",
"allow-secure-initialize-vault",
"allow-secure-unlock-vault",
"allow-secure-lock-vault",
"allow-secure-reset-vault",
"allow-is-vault-unlocked",
"allow-biometric-available",
"allow-biometric-passphrase-stored",
"allow-store-biometric-passphrase",
"allow-unlock-with-biometric",
"allow-clear-biometric-passphrase",
"allow-list-keys",
"allow-generate-key",
"allow-import-key",
"allow-delete-key",
"allow-list-known-hosts",
"allow-remove-known-host",
"allow-list-removed-known-hosts",
"allow-forget-known-host",
"allow-list-host-key-changes",
"allow-replace-known-host",
"allow-list-workspaces",
"allow-create-workspace",
"allow-save-workspace",
"allow-delete-workspace",
"allow-set-active-workspace",
"allow-connect-ssh",
"allow-create-local-terminal",
"allow-session-write",
Comment on lines +51 to +53

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

1. Webview script can control local shells 📎 Requirement gap ⛨ Security

The capability grants the main app webview both create_local_terminal and session_write without
any backend-attested authorization. JavaScript running on that page can therefore spawn a shell or
send bytes to an existing local terminal by session ID, including terminals opened through the
normal UI.
Agent Prompt
## Issue description
The main webview is granted both local-terminal creation and session input commands, while the backend authorizes requests only by command parameters and session ID. Webview JavaScript can create a shell or write to an existing local terminal without backend-attested authorization.

## Fix Focus Areas
- desktop/src-tauri/capabilities/default.json[51-53]
- desktop/src-tauri/permissions/app-commands.toml[177-183]
- desktop/src-tauri/src/commands.rs[669-766]
- desktop/src-tauri/src/commands.rs[866-894]

## Recommended Fix
Remove direct webview access to terminal creation and session input, or require a backend-issued authorization bound to the intended terminal and session before both commands execute. Ensure `session_write` cannot act solely on a caller-supplied session ID and that the normal UI obtains authorization through a backend-controlled flow.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Dismiss ↗ | View ↗

"allow-session-resize",
"allow-close-session",
"allow-list-sessions",
"allow-sftp-connect",
"allow-sftp-list-dir",
"allow-sftp-canonicalize",
"allow-sftp-create-dir",
"allow-sftp-remove-file",
"allow-sftp-remove-dir",
"allow-sftp-rename",
"allow-sftp-close",
"allow-sftp-pick-upload-file",
"allow-sftp-download-to-local",
"allow-sftp-upload-from-local",
"allow-pick-key-file",
"allow-get-app-info",
"allow-check-for-updates",
"allow-install-update"
]
}
Loading
Loading