From patchwork Wed Nov 12 09:27:37 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 4586 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:33c4:b0:7b1:439f:bdf with SMTP id u4csp2439763maf; Wed, 12 Nov 2025 01:28:00 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVVhAPmPxi/1Q5V84P1js3uYrdI/vOlMmjHYY2PurAI4MItRFFvn69mrUnD3s/9O3Kj+TAjRuE3wkI=@openvpn.net X-Google-Smtp-Source: AGHT+IEXwxM+t7A2lzV4P7UgLgMon81hWX4hqVgUYMlZbimhCJEWV8UhhQfQGTHDdXFvoAl1Wfwi X-Received: by 2002:a05:6808:30a2:b0:450:32f0:4887 with SMTP id 5614622812f47-45074544080mr1021549b6e.31.1762939680814; Wed, 12 Nov 2025 01:28:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1762939680; cv=none; d=google.com; s=arc-20240605; b=HkdRMNmY0v9ydxEsA2+P50Pv8nZ8A2IVcaVDcTjFcbjfNHh3EyGKSeNA/EenCLi0aT T2Wj0QrMSmrsQ8o07/EVqnxbcsSy5MVMOlahAxCQ0P520HSja8lNImzPZMvWFMe5Miis oyEDyiQAauD1OwfmJBMjDIA/P+CHjK+MX5/SPkWARZCrFXJQW3t85Y49lMIm+xiWneTc oRzwOlF5hC3QCaV8tfE4wDTjdZVmSQdgnCxhkrZZuMRwHEQmoBJlsWALejm8M7saSDJ1 p5iuAJoE5nFOUAqMeU8FMxQF8RSR3XoAyJKImcxSdrQVrWxq5CT9DHyVFEixX+n9iV9R YQKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:references:in-reply-to:message-id:date:to:from :dkim-signature:dkim-signature:dkim-signature; bh=OtYNu+MRydFWLVGXl/5s26M7tAwCO8y7xzqmadIJ5Ig=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=cxnxGrVW8p5dSlk2DvMmg8LZbqSFX6MPxagiKU5yliWhzdwJ5kCEcw3z1YIdmiTOXt RxXKhdOk7LFsyRWFGZBKmjpfcNp9gwGg1UEabt1fuNA/HYQbKZh2VgmfnOIRjjy1Xh5a Z8CUJPv6V8u1t1dGKCUaO6yatGk0slAiifumZnXBXys0Acac/QPcyrsHUN+boa0YErAw nTRDKm9CyrA9kVPSd4RlHeXqHyKdJiEziUM4SQAAauAbRm41wpVfwLayAGCqy+xet4TH bupDoAVuty+riehas9uNUjf3ID93l3JDALUFWynB+xUHn/cgMHTNukZyIeofpqRJCd5n 2D0A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=hSbTDimv; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=MGVkZiga; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=fzkaT2Ps; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=muc.de Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id 586e51a60fabf-3e41ebb102esi6944559fac.49.2025.11.12.01.28.00 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 12 Nov 2025 01:28:00 -0800 (PST) Received-SPF: pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) client-ip=216.105.38.7; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=hSbTDimv; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=MGVkZiga; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=fzkaT2Ps; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=muc.de DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.sourceforge.net; s=beta; h=Content-Transfer-Encoding:Content-Type: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: Subject:MIME-Version:References:In-Reply-To:Message-ID:Date:To:From:Sender: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=OtYNu+MRydFWLVGXl/5s26M7tAwCO8y7xzqmadIJ5Ig=; b=hSbTDimv84j9MnZzMd3FDkzwZ2 CwNCuKhGMCvEW33veBXEhtV6/uRrdZinkCmfVg8/Co98P3JQ68arX/s1uk5SWgnhW53u4Q+QIpiMx xqXcPnOpDGebl5H1hneTiPeswgELQCSr8MNGyRym6xy1ylWTaM54XbM+BwbWjoWr/nTs=; Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1vJ78u-00027B-IV; Wed, 12 Nov 2025 09:27:56 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1vJ78t-000274-Ov for openvpn-devel@lists.sourceforge.net; Wed, 12 Nov 2025 09:27:55 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=9TzL5csWIoTkCLHy0h+W3Sfu53xVRzMA4L+YM0ahAGg=; b=MGVkZigaY0rAW/UUwnK3jvuVqk jkQEKIq4fmVwYweIBADu5x34srBBZ2c9qerkDcApYMC5Fxo4fldoawCmNSV22uKmMUBtIHrfoWjNA 1GCo2kQPAXqmNIHB8LbYR68tJ1UEKqWHs+7hXVXA+zFhXt0nFyzA1+LMHzB4/t/CxB+4=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID: Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=9TzL5csWIoTkCLHy0h+W3Sfu53xVRzMA4L+YM0ahAGg=; b=fzkaT2PsJwQf0hB9paXxwmBmzZ RjsEWpCVsPfOXc8r8eBFPfNlyvjPeYNi9URkb3cYN1z3QikB/uzek+GIfhqqXWZgxLDmHd1TsWUYE /J/+vvupO07J7hLDJ/i9T4DKX4/vQBaEF+7+mxo9Yz2L3fmpc2SMAaJTg8DVU40UqTXY=; Received: from [193.149.48.134] (helo=blue.greenie.muc.de) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1vJ78s-0000Co-Sv for openvpn-devel@lists.sourceforge.net; Wed, 12 Nov 2025 09:27:55 +0000 Received: from blue.greenie.muc.de (localhost [127.0.0.1]) by blue.greenie.muc.de (8.18.1/8.18.1) with ESMTP id 5AC9RhsG023188 for ; Wed, 12 Nov 2025 10:27:43 +0100 Received: (from gert@localhost) by blue.greenie.muc.de (8.18.1/8.18.1/Submit) id 5AC9RhwF023187 for openvpn-devel@lists.sourceforge.net; Wed, 12 Nov 2025 10:27:43 +0100 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Wed, 12 Nov 2025 10:27:37 +0100 Message-ID: <20251112092743.23173-1-gert@greenie.muc.de> X-Mailer: git-send-email 2.49.1 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "sfi-spamd-2.hosts.colo.sdot.me", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: Arne Schwabe The username environment variable is already set by the set_verify_user_pass_env function before the verify_user_pass_script function is called, so this call is not doing anything but might erroneousl [...] Content analysis details: (1.3 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.3 RDNS_NONE Delivered to internal network by a host with no rDNS X-Headers-End: 1vJ78s-0000Co-Sv Subject: [Openvpn-devel] [PATCH v2] clean up environment variable handling in verify_user_pass_script X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox X-GMAIL-THRID: =?utf-8?q?1847437251083061650?= X-GMAIL-MSGID: =?utf-8?q?1848576238855125144?= From: Arne Schwabe The username environment variable is already set by the set_verify_user_pass_env function before the verify_user_pass_script function is called, so this call is not doing anything but might erroneously made people think that this needs to be cleaned up. Also ensure that the password is clean from the env even in an error case. Reported-by: Joshua Rogers Found-by: ZeroPath (https://zeropath.com/) Change-Id: I6c502508026c6b85bb092ada4d16d985b20dd41f Signed-off-by: Arne Schwabe Acked-by: Gert Doering Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1326 Message-Id: <20251030194402.1729-1-gert@greenie.muc.de> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg34069.html Signed-off-by: Gert Doering Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1326 --- This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master. Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1326 This mail reflects revision 2 of this Change. Acked-by according to Gerrit (reflected above): diff --git a/src/openvpn/ssl_verify.c b/src/openvpn/ssl_verify.c index 04ef27e..993d22c 100644 --- a/src/openvpn/ssl_verify.c +++ b/src/openvpn/ssl_verify.c @@ -1329,7 +1329,7 @@ } else { - setenv_str(session->opt->es, "username", up->username); + /* username env is already set by set_verify_user_pass_env */ setenv_str(session->opt->es, "password", up->password); } @@ -1377,10 +1377,6 @@ /* purge auth control filename (and file itself) for non-deferred returns */ key_state_rm_auth_control_files(&ks->script_auth); } - if (!session->opt->auth_user_pass_verify_script_via_file) - { - setenv_del(session->opt->es, "password"); - } done: if (tmp_file && strlen(tmp_file) > 0) @@ -1389,6 +1385,11 @@ } error: + if (!session->opt->auth_user_pass_verify_script_via_file) + { + setenv_del(session->opt->es, "password"); + } + argv_free(&argv); gc_free(&gc); return retval;