[Openvpn-devel] Exit early when external scripts are specified with script-security < 2
| Message ID | 1549917961-632-1-git-send-email-selva.nair@gmail.com |
|---|---|
| State | Superseded |
| Headers |
Return-Path: <openvpn-devel-bounces@lists.sourceforge.net> Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director10.mail.ord1d.rsapps.net ([172.30.191.6]) by backend30.mail.ord1d.rsapps.net with LMTP id sP8QF0vfYVxBYwAAIUCqbw for <patchwork@openvpn.net>; Mon, 11 Feb 2019 15:47:07 -0500 Received: from proxy5.mail.ord1d.rsapps.net ([172.30.191.6]) by director10.mail.ord1d.rsapps.net with LMTP id AA3cFkvfYVyINQAApN4f7A ; Mon, 11 Feb 2019 15:47:07 -0500 Received: from smtp3.gate.ord1d ([172.30.191.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy5.mail.ord1d.rsapps.net with LMTP id SC4ZFkvfYVybaAAA8Zzt7w ; Mon, 11 Feb 2019 15:47:07 -0500 X-Spam-Threshold: 95 X-Spam-Score: 0 X-Spam-Flag: NO X-Virus-Scanned: OK X-Orig-To: openvpnslackdevel@openvpn.net X-Originating-Ip: [216.105.38.7] Authentication-Results: smtp3.gate.ord1d.rsapps.net; iprev=pass policy.iprev="216.105.38.7"; spf=pass smtp.mailfrom="openvpn-devel-bounces@lists.sourceforge.net" smtp.helo="lists.sourceforge.net"; dkim=fail (signature verification failed) header.d=sourceforge.net; dkim=fail (signature verification failed) header.d=sf.net; dkim=fail (signature verification failed) header.d=gmail.com; dmarc=fail (p=none; dis=none) header.from=gmail.com X-Suspicious-Flag: YES X-Classification-ID: 31930dfe-2e3e-11e9-a7d9-5254006d4589-1-1 Received: from [216.105.38.7] ([216.105.38.7:8698] helo=lists.sourceforge.net) by smtp3.gate.ord1d.rsapps.net (envelope-from <openvpn-devel-bounces@lists.sourceforge.net>) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id 01/74-15476-A4FD16C5; Mon, 11 Feb 2019 15:47:07 -0500 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.90_1) (envelope-from <openvpn-devel-bounces@lists.sourceforge.net>) id 1gtIT1-0004wH-5F; Mon, 11 Feb 2019 20:46:15 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from <selva.nair@gmail.com>) id 1gtISz-0004w9-B2 for openvpn-devel@lists.sourceforge.net; Mon, 11 Feb 2019 20:46:13 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=Lp5miuQGnx5+slQwjTY4h34jiQ8tkT0+XZ9mV4m/R+U=; b=FKHYM/LM+CE/o5MWRoEjrEBYMO uDAN0P+1rlfH5J701UApe4il1Xquq8CZi1hSU8kr6WMxOLaFGCUHjS3qgotkIHMjCJGATlo3XXlD2 YBU9k7uS98bXhXgFVpClDHWXA37H68Mi+Cylkz9vI80QumDB3ET+FWcL4G6+JC+xT5Bs=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:MIME-Version: Content-Type:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=Lp5miuQGnx5+slQwjTY4h34jiQ8tkT0+XZ9mV4m/R+U=; b=gqmLZPNqNBk5jlbw9pX/kbwvqs vAeayYm7L9bDQNPJuOQ7GnnX0y0lj/9K23Ln4fqfRNYWPaqOigDEvFbC/kKmqa8YhOrwJOdamB3sR C2FAlnn/uBYN15SGTsMo43+bEB4+wWwl6H4Ag9zdH1OvTjUWLMEdUA/McEnMbjSo35Qw=; Received: from mail-it1-f196.google.com ([209.85.166.196]) by sfi-mx-3.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.90_1) id 1gtISx-001N8R-5R for openvpn-devel@lists.sourceforge.net; Mon, 11 Feb 2019 20:46:13 +0000 Received: by mail-it1-f196.google.com with SMTP id i2so1688954ite.5 for <openvpn-devel@lists.sourceforge.net>; Mon, 11 Feb 2019 12:46:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=Lp5miuQGnx5+slQwjTY4h34jiQ8tkT0+XZ9mV4m/R+U=; b=TLQe629298swWhGa4KypwVPTGoTtu08Ln3p5ejhb9LCUod/goQpvvlBMnPkq450ChP V1dnyq8r5vkhsgeRG8NVMfsuBkp0+pI3RInTb4d4B3E4ptW3lkigG2v3xszppPYg/Hgv 8P+7Mr0LtxFrIG/bbfl6VHxjTmnHOjYlO0t3Egf5m5paNsPGfKGOSt81Saf+1tKvK2EH GJq+3uC83Pl+LzSk27NAaXIOD6Cqegovh4zcynBs9XBNy806gnO67oGW7Slr04hoXFaJ iPSPzj2w21aWRRccEQKn1SdIMLiL6RtZYzCm/e148w6HUgronisw5xn7md9Ckq+E5T0b R/1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Lp5miuQGnx5+slQwjTY4h34jiQ8tkT0+XZ9mV4m/R+U=; b=DpKkDkJ/vqXYyyrcunGe+oikSW+s3Iun+c++eI++au3Z97yd4NFuu+HbH61qzJcBDh B/dfPfA79bSvaLs7ZhhZ5fM6DmlVebOnLItR94/sneLgyxuoC3TsbSFaZ1xCfmXH5A+P Z3u/B1PFbGLDLDOWlDmBv9BwkRjujISqgXukCud6hiio/QJ3WVPZAdI+gVSiWdNsvzFu iP2K4hyZQH4WSgaN9OxihORVJwPk8aHCUWorqZdwEHDnKuiMcT3cA+2oq9MNSLp2CkEU YRxjPS+AKks7/t+dijHjL2khR9qo0E7pNr3RIwIrBRURtMI6gaLUaxzbULLPSQhYkvMe yseA== X-Gm-Message-State: AHQUAua8RTS8NUbeUzTxBog0LKp8NTDRJOB45ACy5ezIX08++2mB+576 AYCRi0MpE5FqmwNq8E0uwG5L9P3Q X-Google-Smtp-Source: AHgI3IbGKJkRiyRGvMdzTfvl++jqd8rYIGiwknXNjBZTJad7h8QMRgHgQmfeSGykENSJhzqRIXpu6w== X-Received: by 2002:a24:ac65:: with SMTP id m37mr67036iti.49.1549917965181; Mon, 11 Feb 2019 12:46:05 -0800 (PST) Received: from saturn.home.sansel.ca (CPE40167ea0e1c2-CM788df74daaa0.cpe.net.cable.rogers.com. [99.228.215.92]) by smtp.gmail.com with ESMTPSA id x23sm5381782ion.38.2019.02.11.12.46.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 11 Feb 2019 12:46:04 -0800 (PST) From: selva.nair@gmail.com To: openvpn-devel@lists.sourceforge.net Date: Mon, 11 Feb 2019 15:46:01 -0500 Message-Id: <1549917961-632-1-git-send-email-selva.nair@gmail.com> X-Mailer: git-send-email 2.1.4 X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (selva.nair[at]gmail.com) -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [209.85.166.196 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.166.196 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-Headers-End: 1gtISx-001N8R-5R Subject: [Openvpn-devel] [PATCH] Exit early when external scripts are specified with script-security < 2 X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: <openvpn-devel.lists.sourceforge.net> List-Unsubscribe: <https://lists.sourceforge.net/lists/options/openvpn-devel>, <mailto:openvpn-devel-request@lists.sourceforge.net?subject=unsubscribe> List-Archive: <http://sourceforge.net/mailarchive/forum.php?forum_name=openvpn-devel> List-Post: <mailto:openvpn-devel@lists.sourceforge.net> List-Help: <mailto:openvpn-devel-request@lists.sourceforge.net?subject=help> List-Subscribe: <https://lists.sourceforge.net/lists/listinfo/openvpn-devel>, <mailto:openvpn-devel-request@lists.sourceforge.net?subject=subscribe> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox |
| Series |
[Openvpn-devel] Exit early when external scripts are specified with script-security < 2
|
|
Commit Message
Selva Nair
Feb. 11, 2019, 9:46 a.m. UTC
From: Selva Nair <selva.nair@gmail.com> Currently this raises a warning only. A fatal error is triggered later with a confusing message that script failed to execute. This helps the Windows GUI to show a relevant error message when script-security is over-ridden as a security measure. Signed-off-by: Selva Nair <selva.nair@gmail.com> --- src/openvpn/init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On 11/02/2019 21:46, selva.nair@gmail.com wrote: > From: Selva Nair <selva.nair@gmail.com> > > Currently this raises a warning only. A fatal error is triggered > later with a confusing message that script failed to execute. > > This helps the Windows GUI to show a relevant error message when > script-security is over-ridden as a security measure. > > Signed-off-by: Selva Nair <selva.nair@gmail.com> > --- > src/openvpn/init.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/openvpn/init.c b/src/openvpn/init.c > index 3c44967..5863828 100644 > --- a/src/openvpn/init.c > +++ b/src/openvpn/init.c > @@ -3206,7 +3206,7 @@ do_option_warnings(struct context *c) > } > else > { > - msg(M_WARN, "NOTE: starting with " PACKAGE_NAME " 2.1, '--script-security 2' or higher is required to call user-defined scripts or executables"); > + msg(M_FATAL, "ERROR: starting with " PACKAGE_NAME " 2.1, '--script-security 2' or higher is required to call user-defined scripts or executables"); Generally speaking, I am fine with this (so Feature-ACK). What I am struggling with though is that this may break existing configurations for users who do have an invalid configuration file. In this case trying to use scripts without --script-security *and* ignoring that their scripts does not work. The cynical me says "scr** them, they need to fix their configs". But I also got lots of complaints from Fedora users when we changed _incorrect_ configurations to fail in similar ways. It's just amazing how few users who really *read* their log files. So with this in mind, I think this behavioural change should go in 2.5 only. So I can give this a full ACK for git master only.
Hi,
On Fri, Feb 15, 2019 at 09:26:50PM +0100, David Sommerseth wrote:
> So I can give this a full ACK for git master only.
I can see your line of reasoning, but there is another aspect to it - we
want to change the windows GUI to override script-security, to disarm
possibly dangerous .ovpn files that have "--up $eviltrickery" in them.
With this change, the GUI has a chance to tell people "look, this is
the problem. If you trust the source, you can enable scripts in this
config (press <here>), if not, you better leave the ovpn alone!" -
without, things will silently stop working for windows users...
But we *do* want this on windows, disable script-security unless
explicitely activated *outside* the .ovpn file...
(I'm halfway tempted to make this an #ifdef _WIN32, but that cannot
truly be the way forward)
So - I had planned to give this an ACK both for 2.4 and master, but
since you have reservations, we need to find the best way forward.
gert
Hi, On Sat, Feb 16, 2019 at 8:19 AM David Sommerseth < openvpn@sf.lists.topphemmelig.net> wrote: > On 15/02/2019 21:31, Selva Nair wrote: > > Hi > > > > On Fri, Feb 15, 2019 at 3:26 PM David Sommerseth > > <openvpn@sf.lists.topphemmelig.net <mailto: > openvpn@sf.lists.topphemmelig.net>> > > wrote: > > > > On 11/02/2019 21:46, selva.nair@gmail.com <mailto: > selva.nair@gmail.com> wrote: > > > From: Selva Nair <selva.nair@gmail.com <mailto: > selva.nair@gmail.com>> > > > > > > Currently this raises a warning only. A fatal error is triggered > > > later with a confusing message that script failed to execute. > > > > > > This helps the Windows GUI to show a relevant error message when > > > script-security is over-ridden as a security measure. > > > > > > Signed-off-by: Selva Nair <selva.nair@gmail.com > > <mailto:selva.nair@gmail.com>> > > > --- > > > src/openvpn/init.c | 2 +- > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > diff --git a/src/openvpn/init.c b/src/openvpn/init.c > > > index 3c44967..5863828 100644 > > > --- a/src/openvpn/init.c > > > +++ b/src/openvpn/init.c > > > @@ -3206,7 +3206,7 @@ do_option_warnings(struct context *c) > > > } > > > else > > > { > > > - msg(M_WARN, "NOTE: starting with " PACKAGE_NAME " 2.1, > > '--script-security 2' or higher is required to call user-defined > scripts > > or executables"); > > > + msg(M_FATAL, "ERROR: starting with " PACKAGE_NAME " > 2.1, > > '--script-security 2' or higher is required to call user-defined > scripts > > or executables"); > > > > Generally speaking, I am fine with this (so Feature-ACK). > > > > What I am struggling with though is that this may break existing > > configurations for users who do have an invalid configuration file. > In this > > case trying to use scripts without --script-security *and* ignoring > that their > > scripts does not work. The cynical me says "scr** them, they need > to fix > > their configs". > > > > I fail to get this.. Users cannot ignore it as currently they do get a > FATAL > > error in such cases. > > I'm only moving the error to happen earlier. > > Am I missing something? > > So another M_FATAL occurs later on? I haven't checked the code yet, but I > was > quite sure there were scenarios where scripts failed to run - with with > some > other complaints in the log. > > If all script hooks results in M_FATAL later on (server and client > configs), > then this is a non-issue. > That got me worried as I had checked this only with up/down scripts on client in which case it causes a FATAL error later in openvpn_run_script. But you are right, not all scripts cause FATAL error when not executed or failed.. In that case, a better option may be to get a proper error msg -- instead of "external program fork failed" we want "script not executed because of script-security < xxx " or something like that.. Selva <div dir="ltr"><div>Hi,</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Feb 16, 2019 at 8:19 AM David Sommerseth <<a href="mailto:openvpn@sf.lists.topphemmelig.net" target="_blank">openvpn@sf.lists.topphemmelig.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 15/02/2019 21:31, Selva Nair wrote:<br> > Hi<br> > <br> > On Fri, Feb 15, 2019 at 3:26 PM David Sommerseth<br> > <<a href="mailto:openvpn@sf.lists.topphemmelig.net" target="_blank">openvpn@sf.lists.topphemmelig.net</a> <mailto:<a href="mailto:openvpn@sf.lists.topphemmelig.net" target="_blank">openvpn@sf.lists.topphemmelig.net</a>>><br> > wrote:<br> > <br> > On 11/02/2019 21:46, <a href="mailto:selva.nair@gmail.com" target="_blank">selva.nair@gmail.com</a> <mailto:<a href="mailto:selva.nair@gmail.com" target="_blank">selva.nair@gmail.com</a>> wrote:<br> > > From: Selva Nair <<a href="mailto:selva.nair@gmail.com" target="_blank">selva.nair@gmail.com</a> <mailto:<a href="mailto:selva.nair@gmail.com" target="_blank">selva.nair@gmail.com</a>>><br> > ><br> > > Currently this raises a warning only. A fatal error is triggered<br> > > later with a confusing message that script failed to execute.<br> > ><br> > > This helps the Windows GUI to show a relevant error message when<br> > > script-security is over-ridden as a security measure.<br> > ><br> > > Signed-off-by: Selva Nair <<a href="mailto:selva.nair@gmail.com" target="_blank">selva.nair@gmail.com</a><br> > <mailto:<a href="mailto:selva.nair@gmail.com" target="_blank">selva.nair@gmail.com</a>>><br> > > ---<br> > > src/openvpn/init.c | 2 +-<br> > > 1 file changed, 1 insertion(+), 1 deletion(-)<br> > ><br> > > diff --git a/src/openvpn/init.c b/src/openvpn/init.c<br> > > index 3c44967..5863828 100644<br> > > --- a/src/openvpn/init.c<br> > > +++ b/src/openvpn/init.c<br> > > @@ -3206,7 +3206,7 @@ do_option_warnings(struct context *c)<br> > > }<br> > > else<br> > > {<br> > > - msg(M_WARN, "NOTE: starting with " PACKAGE_NAME " 2.1,<br> > '--script-security 2' or higher is required to call user-defined scripts<br> > or executables");<br> > > + msg(M_FATAL, "ERROR: starting with " PACKAGE_NAME " 2.1,<br> > '--script-security 2' or higher is required to call user-defined scripts<br> > or executables");<br> > <br> > Generally speaking, I am fine with this (so Feature-ACK).<br> > <br> > What I am struggling with though is that this may break existing<br> > configurations for users who do have an invalid configuration file. In this<br> > case trying to use scripts without --script-security *and* ignoring that their<br> > scripts does not work. The cynical me says "scr** them, they need to fix<br> > their configs".<br> > <br> > I fail to get this.. Users cannot ignore it as currently they do get a FATAL<br> > error in such cases.<br> > I'm only moving the error to happen earlier.<br> > Am I missing something?<br> <br> So another M_FATAL occurs later on? I haven't checked the code yet, but I was<br> quite sure there were scenarios where scripts failed to run - with with some<br> other complaints in the log.<br> <br> If all script hooks results in M_FATAL later on (server and client configs),<br> then this is a non-issue.<br></blockquote><div><br></div><div>That got me worried as I had checked this only with up/down scripts on client</div><div>in which case it causes a FATAL error later in openvpn_run_script.</div><div><br></div><div>But you are right, not all scripts cause FATAL error when not executed or failed..</div><div><br></div><div>In that case, a better option may be to get a proper error msg -- instead of "external program fork failed"</div><div>we want "script not executed because of script-security < xxx " or something like that..</div><div><br></div><div>Selva</div></div></div>
diff --git a/src/openvpn/init.c b/src/openvpn/init.c index 3c44967..5863828 100644 --- a/src/openvpn/init.c +++ b/src/openvpn/init.c @@ -3206,7 +3206,7 @@ do_option_warnings(struct context *c) } else { - msg(M_WARN, "NOTE: starting with " PACKAGE_NAME " 2.1, '--script-security 2' or higher is required to call user-defined scripts or executables"); + msg(M_FATAL, "ERROR: starting with " PACKAGE_NAME " 2.1, '--script-security 2' or higher is required to call user-defined scripts or executables"); } } }