# Risk map — clash-verge-rev/clash-verge-rev

> Canonical page: https://codevetter.com/unpack/clash-verge-rev/risk-map

# Risk map — clash-verge-rev/clash-verge-rev

Scanned commit fd06fbb3b71ee5c4467bc0e3cc505dcac5348371 (2026-09-22). Generated by codevetter codevetter 1.12.0 on 2026-09-22.

The highest-impact code is the core lifecycle and the system-proxy/TUN apply path: a bad transition can leave the OS proxy half-set or the core unguarded. The webview is loosely sandboxed (CSP off, filesystem scope **). Profile JavaScript is sandboxed in Boa but can still rewrite the config that Mihomo will load. Secrets at rest are only as private as the app-data directory, because the AES key sits beside verge.yaml. Deep links import remote subscriptions immediately, and a user-configured startup script is executed as a shell.
- tauri.conf.json sets CSP to null and enables the asset protocol with allow ** and requireLiteralLeadingDot false. Capability migrated grants fs:allow-read-file and fs:allow-write-file with scope $APPDATA/**, $RESOURCE/../**, and **. desktop-capability allows http and https to any host via http:allow-fetch. — [src-tauri/tauri.conf.json#L50-L61](https://github.com/clash-verge-rev/clash-verge-rev/blob/fd06fbb3b71ee5c4467bc0e3cc505dcac5348371/src-tauri/tauri.conf.json#L50-L61) [src-tauri/capabilities/migrated.json#L7-L18](https://github.com/clash-verge-rev/clash-verge-rev/blob/fd06fbb3b71ee5c4467bc0e3cc505dcac5348371/src-tauri/capabilities/migrated.json#L7-L18) [src-tauri/capabilities/desktop.json#L20-L27](https://github.com/clash-verge-rev/clash-verge-rev/blob/fd06fbb3b71ee5c4467bc0e3cc505dcac5348371/src-tauri/capabilities/desktop.json#L20-L27)
- PAC is mounted with .or(pac) outside instance_auth. Any local process that can reach 127.0.0.1 on the embedded port can read the PAC body, including the mixed port, once PAC_AVAILABLE is true. Window-restore and scheme import stay behind x-instance-token. — [src-tauri/src/utils/server.rs#L140-L153](https://github.com/clash-verge-rev/clash-verge-rev/blob/fd06fbb3b71ee5c4467bc0e3cc505dcac5348371/src-tauri/src/utils/server.rs#L140-L153) [src-tauri/src/utils/server.rs#L225-L266](https://github.com/clash-verge-rev/clash-verge-rev/blob/fd06fbb3b71ee5c4467bc0e3cc505dcac5348371/src-tauri/src/utils/server.rs#L225-L266)
- startup_script executes an arbitrary existing .sh via bash or .ps1/.bat via powershell from a path stored in verge config, during every startup, with the script directory as cwd. — [src-tauri/src/utils/init.rs#L599-L635](https://github.com/clash-verge-rev/clash-verge-rev/blob/fd06fbb3b71ee5c4467bc0e3cc505dcac5348371/src-tauri/src/utils/init.rs#L599-L635)
- resolve_scheme imports a subscription as soon as the URL parses. There is no confirm command on that path. A clash:// or clash-verge:// link that reaches the primary instance therefore downloads and saves a remote profile. — [src-tauri/src/utils/resolve/scheme.rs#L13-L38](https://github.com/clash-verge-rev/clash-verge-rev/blob/fd06fbb3b71ee5c4467bc0e3cc505dcac5348371/src-tauri/src/utils/resolve/scheme.rs#L13-L38) [src-tauri/src/utils/resolve/scheme.rs#L82-L112](https://github.com/clash-verge-rev/clash-verge-rev/blob/fd06fbb3b71ee5c4467bc0e3cc505dcac5348371/src-tauri/src/utils/resolve/scheme.rs#L82-L112)
- WebDAV secrets are encrypted in verge.yaml, but get_encryption_key stores the raw 32-byte key in app_home/.encryption_key with no OS keychain. A local reader of that directory can decrypt the fields. (inferred) — [src-tauri/src/utils/dirs.rs#L155-L170](https://github.com/clash-verge-rev/clash-verge-rev/blob/fd06fbb3b71ee5c4467bc0e3cc505dcac5348371/src-tauri/src/utils/dirs.rs#L155-L170) [src-tauri/src/config/encrypt.rs#L18-L31](https://github.com/clash-verge-rev/clash-verge-rev/blob/fd06fbb3b71ee5c4467bc0e3cc505dcac5348371/src-tauri/src/config/encrypt.rs#L18-L31) [src-tauri/src/config/verge.rs#L168-L190](https://github.com/clash-verge-rev/clash-verge-rev/blob/fd06fbb3b71ee5c4467bc0e3cc505dcac5348371/src-tauri/src/config/verge.rs#L168-L190)
- check_media_unlock's HTTP client sets danger_accept_invalid_certs(true) and danger_accept_invalid_hostnames(true) and forces traffic through http://127.0.0.1:<mixed port>. Unlock checks can succeed against intercepted TLS. — [src-tauri/src/cmd/media_unlock_checker/mod.rs#L11-L26](https://github.com/clash-verge-rev/clash-verge-rev/blob/fd06fbb3b71ee5c4467bc0e3cc505dcac5348371/src-tauri/src/cmd/media_unlock_checker/mod.rs#L11-L26)
- System proxy writes are classified as SysproxyFailure: SYSPROXY_PRIVILEGE_REQUIRED, SYSPROXY_DIRECT_FALLBACK, SYSPROXY_SIDECAR_WHILE_SERVICE_READY, SYSPROXY_GUARD_STOPPED, SYSPROXY_CORE_NOT_READY, and SYSPROXY_SYSTEM_CALL_FAILED. SystemProxyStateUnknown means a write was left partly applied and a turn-off was attempted. rollback_failure keeps the actionable code. — [src-tauri/src/core/proxy_control.rs#L31-L120](https://github.com/clash-verge-rev/clash-verge-rev/blob/fd06fbb3b71ee5c4467bc0e3cc505dcac5348371/src-tauri/src/core/proxy_control.rs#L31-L120)
- Windows service start uses run_service_start_with_sidecar_fallback. A non-location ServiceStartRefusal is returned rather than ignored. An unclear occupancy probe blocks sidecar fallback. Sidecar continuation is rejected unless can_allow_sidecar_for_session matches mode and status, and a failed sidecar attempt withdraws the allowance and rolls back the proxy. — [src-tauri/src/core/manager/lifecycle.rs#L188-L228](https://github.com/clash-verge-rev/clash-verge-rev/blob/fd06fbb3b71ee5c4467bc0e3cc505dcac5348371/src-tauri/src/core/manager/lifecycle.rs#L188-L228) [src-tauri/src/core/manager/lifecycle.rs#L362-L426](https://github.com/clash-verge-rev/clash-verge-rev/blob/fd06fbb3b71ee5c4467bc0e3cc505dcac5348371/src-tauri/src/core/manager/lifecycle.rs#L362-L426)
- Updater endpoints prefer https://update.hwdns.net/... and https://gh-proxy.org/... ahead of the GitHub release update.json. Payloads are still checked with the configured minisign pubkey, but availability depends on those proxies. — [src-tauri/tauri.conf.json#L32-L39](https://github.com/clash-verge-rev/clash-verge-rev/blob/fd06fbb3b71ee5c4467bc0e3cc505dcac5348371/src-tauri/tauri.conf.json#L32-L39)
- Config validation and the running core shell out to a sidecar binary named by verge's clash core (verge-mihomo or verge-mihomo-alpha). Replacing that binary in the install or sidecar directory changes what -t and the runtime execute. — [src-tauri/src/core/validate.rs#L361-L364](https://github.com/clash-verge-rev/clash-verge-rev/blob/fd06fbb3b71ee5c4467bc0e3cc505dcac5348371/src-tauri/src/core/validate.rs#L361-L364) [src-tauri/tauri.conf.json#L17](https://github.com/clash-verge-rev/clash-verge-rev/blob/fd06fbb3b71ee5c4467bc0e3cc505dcac5348371/src-tauri/tauri.conf.json#L17)
- Profile scripts are not a browser sandbox escape, but they do receive the full clash mapping and their returned object becomes the runtime config after authoritative-field enforcement. A malicious local script profile can still rewrite rules and proxies within those limits. Remote subscriptions are YAML fetched by PrfItem::from_url, not executed as JavaScript by themselves. — [src-tauri/src/enhance/script.rs#L22-L60](https://github.com/clash-verge-rev/clash-verge-rev/blob/fd06fbb3b71ee5c4467bc0e3cc505dcac5348371/src-tauri/src/enhance/script.rs#L22-L60) [src-tauri/src/enhance/mod.rs#L936-L959](https://github.com/clash-verge-rev/clash-verge-rev/blob/fd06fbb3b71ee5c4467bc0e3cc505dcac5348371/src-tauri/src/enhance/mod.rs#L936-L959) [src-tauri/src/config/prfitem.rs#L250-L285](https://github.com/clash-verge-rev/clash-verge-rev/blob/fd06fbb3b71ee5c4467bc0e3cc505dcac5348371/src-tauri/src/config/prfitem.rs#L250-L285)
- Lock order is documented as config write lock then lifecycle lock. continue_with_sidecar and uninstall_service_and_start_sidecar both comment that taking them in the other order can commit another transaction's staged verge patch. — [src-tauri/src/core/manager/lifecycle.rs#L370-L373](https://github.com/clash-verge-rev/clash-verge-rev/blob/fd06fbb3b71ee5c4467bc0e3cc505dcac5348371/src-tauri/src/core/manager/lifecycle.rs#L370-L373) [src-tauri/src/core/manager/lifecycle.rs#L437-L439](https://github.com/clash-verge-rev/clash-verge-rev/blob/fd06fbb3b71ee5c4467bc0e3cc505dcac5348371/src-tauri/src/core/manager/lifecycle.rs#L437-L439)
- Linux desktop file template declares only MimeType x-scheme-handler/clash, while init_scheme registers both clash and clash-verge via xdg-mime. A packaging drift can leave clash-verge:// unregistered even though Tauri lists both schemes. — [src-tauri/packages/linux/clash-verge.desktop#L10](https://github.com/clash-verge-rev/clash-verge-rev/blob/fd06fbb3b71ee5c4467bc0e3cc505dcac5348371/src-tauri/packages/linux/clash-verge.desktop#L10) [src-tauri/src/utils/init.rs#L569-L597](https://github.com/clash-verge-rev/clash-verge-rev/blob/fd06fbb3b71ee5c4467bc0e3cc505dcac5348371/src-tauri/src/utils/init.rs#L569-L597) [src-tauri/tauri.conf.json#L44-L47](https://github.com/clash-verge-rev/clash-verge-rev/blob/fd06fbb3b71ee5c4467bc0e3cc505dcac5348371/src-tauri/tauri.conf.json#L44-L47)

Every claim links to its cited files at the pinned commit. Citations identify source evidence; they do not establish runtime correctness. Independent CodeVetter scan — not reviewed by upstream maintainers.

## Public product links

- [CodeVetter](https://codevetter.com/)
- [Download](https://codevetter.com/download)
- [Documentation](https://codevetter.com/docs/)
- [Source](https://github.com/Codevetter/codevetter)
