fix: open only web OIDC URLs and keep connect secrets out of stdout

Refs #17400.

The OIDC login URL comes from the API server and the UI hands it to the
OS, which also opens file:, UNC and other registered handlers. A
malicious or spoofed (plain-http) API server could make "Continue with
..." open a UNC path and leak the user's NetNTLM hash. Accept only http
and https URLs.

The desktop windows printed the arguments of every multi-window call,
and a new window printed its launch arguments. Connect calls carry the
password and connToken, and debugPrint prints in release builds; on
Linux, stdout of a desktop-launched app usually lands in the journal.
Print the method name, and for a launch only the number of arguments.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkig1bcC5Xrr1uwX47b
This commit is contained in:
rustdeskandClaude Opus 5.5 committed 2026-12-04 13:09:17 +08:00
1 parent 1966b41d3f
commit 1729aebd82
8 files changed
+16 -10

No files matched your search

@@ -794,8 +794,7 @@ class _DesktopHomePageState extends State<DesktopHomePage>
rustDeskWinManager.setMethodHandler((call, fromWindowId) async {
if (!isChattyMethod(call.method)) {
debugPrint(
"[Main] call ${call.method} with args ${call.arguments} from window $fromWindowId");
debugPrint("[Main] call ${call.method} from window $fromWindowId");
}
if (call.method == kWindowMainWindowOnTop) {
windowOnTop(null);
@@ -68,7 +68,7 @@ class _FileManagerTabPageState extends State<FileManagerTabPage> {
rustDeskWinManager.setMethodHandler((call, fromWindowId) async {
debugPrint(
"[FileTransfer] call ${call.method} with args ${call.arguments} from window $fromWindowId to ${windowId()}");
"[FileTransfer] call ${call.method} from window $fromWindowId to ${windowId()}");
// for simplify, just replace connectionId
if (call.method == kWindowEventNewFileTransfer) {
final args = jsonDecode(call.arguments);
@@ -59,7 +59,7 @@ class _PortForwardTabPageState extends State<PortForwardTabPage> {
rustDeskWinManager.setMethodHandler((call, fromWindowId) async {
debugPrint(
"[Port Forward] call ${call.method} with args ${call.arguments} from window $fromWindowId");
"[Port Forward] call ${call.method} from window $fromWindowId");
// for simplify, just replace connectionId
if (call.method == kWindowEventNewPortForward) {
final args = jsonDecode(call.arguments);
@@ -422,8 +422,7 @@ class _ConnectionTabPageState extends State<ConnectionTabPage> {
RemoteCountState.find().value = tabController.length;
Future<dynamic> _remoteMethodHandler(call, fromWindowId) async {
debugPrint(
"[Remote Page] call ${call.method} with args ${call.arguments} from window $fromWindowId");
debugPrint("[Remote Page] call ${call.method} from window $fromWindowId");
dynamic returnValue;
// for simplify, just replace connectionId
@@ -505,8 +505,7 @@ class _TerminalTabPageState extends State<TerminalTabPage> {
HardwareKeyboard.instance.addHandler(_handleKeyEvent);
rustDeskWinManager.setMethodHandler((call, fromWindowId) async {
print(
"[Remote Terminal] call ${call.method} with args ${call.arguments} from window $fromWindowId");
print("[Remote Terminal] call ${call.method} from window $fromWindowId");
if (call.method == kWindowEventNewTerminal) {
final args = jsonDecode(call.arguments);
final id = args['id'];
@@ -387,7 +387,7 @@ class _ViewCameraTabPageState extends State<ViewCameraTabPage> {
Future<dynamic> _remoteMethodHandler(call, fromWindowId) async {
debugPrint(
"[View Camera Page] call ${call.method} with args ${call.arguments} from window $fromWindowId");
"[View Camera Page] call ${call.method} from window $fromWindowId");
dynamic returnValue;
// for simplify, just replace connectionId
+1 -1
View File
@@ -39,7 +39,7 @@ Future<void> main(List<String> args) async {
earlyAssert();
WidgetsFlutterBinding.ensureInitialized();
debugPrint("launch args: $args");
debugPrint("launch with ${args.length} args");
kBootArgs = List.from(args);
if (!isDesktop) {
+9
View File
@@ -278,6 +278,15 @@ impl OidcSession {
return;
}
};
// The UI hands this URL to the OS, which would also open file:, UNC or other handlers.
if !matches!(code_url.url.scheme(), "http" | "https") {
Self::set_state_if_current(
auth_attempt,
REQUESTING_ACCOUNT_AUTH,
"Invalid auth response".to_owned(),
);
return;
}
{
let mut session = OIDC_SESSION.write().unwrap();