From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 54A051FF139 for ; Tue, 24 Feb 2026 14:54:07 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 631C1C1B0; Tue, 24 Feb 2026 14:55:03 +0100 (CET) From: Shannon Sterz To: yew-devel@lists.proxmox.com Subject: [PATCH yew-comp] fix #7290: url decode code value in openid redirection authorization Date: Tue, 24 Feb 2026 14:54:28 +0100 Message-ID: <20260224135428.234018-1-s.sterz@proxmox.com> X-Mailer: git-send-email 2.47.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1771941254654 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.282 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment KAM_INFOUSMEBIZ 0.75 Prevalent use of .info|.us|.me|.me.uk|.biz|xyz|id|rocks|life domains in spam/malware SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record WEIRD_PORT 0.001 Uses non-standard port number for HTTP Message-ID-Hash: YF3BUSNBKOPRBABCV5YRD5Q7ZG4KJXYJ X-Message-ID-Hash: YF3BUSNBKOPRBABCV5YRD5Q7ZG4KJXYJ X-MailFrom: s.sterz@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Yew framework devel list at Proxmox List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: this should fix a bug that broke compatability with google's oauth implementation, which seems to regularly use values requiring url encoding. Signed-off-by: Shannon Sterz --- tested this against google's o auth provider following this guide: https://chriscolotti.us/technology/using-google-workspace-oauth-with-proxmox/ set the "Authorized JavaScript origins" and "Authorized redirect URIs" to "https://pdm-test.erna.proxmox.com:8443" and added a line to my `/etc/hosts` to make that name resolution work as intended. src/utils/mod.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/utils/mod.rs b/src/utils/mod.rs index 600e436..c007286 100644 --- a/src/utils/mod.rs +++ b/src/utils/mod.rs @@ -258,7 +258,9 @@ pub fn openid_redirection_authorization() -> Option> { match (key_value.next(), key_value.next()) { (Some("?code") | Some("code"), Some(value)) => { - auth.insert("code".to_string(), value.to_string()); + if let Ok(code) = percent_decode(value.as_bytes()).decode_utf8() { + auth.insert("code".to_string(), code.to_string()); + } } (Some("?state") | Some("state"), Some(value)) => { if let Ok(decoded) = percent_decode(value.as_bytes()).decode_utf8() { -- 2.47.3