From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id KH5YFTbFLmTRUwAASxT56A (envelope-from ) for ; Thu, 06 Apr 2023 15:12:22 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id yGL3FDbFLmTsnwAAauVa8A (envelope-from ) for ; Thu, 06 Apr 2023 15:12:22 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id E064C113F0 for ; Thu, 6 Apr 2023 15:12:21 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pkPPO-0004XW-Vn; Thu, 06 Apr 2023 09:12:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pkPPG-0004TH-Sw for guix-patches@gnu.org; Thu, 06 Apr 2023 09:12:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pkPPG-0007ba-9s for guix-patches@gnu.org; Thu, 06 Apr 2023 09:12:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pkPPG-0001JX-0R for guix-patches@gnu.org; Thu, 06 Apr 2023 09:12:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#62678] [PATCH] services: nginx: Harden php-location settings. Resent-From: Bruno Victal Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 06 Apr 2023 13:12:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62678 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Jonathan Brielmaier Cc: 62678@debbugs.gnu.org Received: via spool by 62678-submit@debbugs.gnu.org id=B62678.16807867105030 (code B ref 62678); Thu, 06 Apr 2023 13:12:01 +0000 Received: (at 62678) by debbugs.gnu.org; 6 Apr 2023 13:11:50 +0000 Received: from localhost ([127.0.0.1]:53652 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pkPP4-0001J4-A3 for submit@debbugs.gnu.org; Thu, 06 Apr 2023 09:11:50 -0400 Received: from smtpmciv3.myservices.hosting ([185.26.107.239]:39824) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pkPP1-0001It-Pp for 62678@debbugs.gnu.org; Thu, 06 Apr 2023 09:11:49 -0400 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpmciv3.myservices.hosting (Postfix) with ESMTP id 44874202E2; Thu, 6 Apr 2023 15:11:46 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id F3AB8800A8; Thu, 6 Apr 2023 15:11:45 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mail1.netim.hosting Received: from mail1.netim.hosting ([127.0.0.1]) by localhost (mail1-2.netim.hosting [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id Tr-Y3DHWWlGZ; Thu, 6 Apr 2023 15:11:45 +0200 (CEST) Received: from [192.168.1.239] (unknown [10.192.1.83]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id C1B13800A7; Thu, 6 Apr 2023 15:11:43 +0200 (CEST) Message-ID: <65a26f2b-0ef5-b9ac-b4df-4e3b73ad4474@makinata.eu> Date: Thu, 6 Apr 2023 14:11:43 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.1 Content-Language: en-US References: <068a52bd-8597-a449-c452-4c110f645ca0@web.de> From: Bruno Victal In-Reply-To: <068a52bd-8597-a449-c452-4c110f645ca0@web.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1680786742; a=rsa-sha256; cv=none; b=M5uxMpEEp2O6yunC543O6EDMln9W6ZZffs7WZ7V1DYotEfITZ4jHDU2UDUD4HIIEwBN8N/ kkb7AH5EWa40fmljwBNa4aLzgKRsIEYi2klX+6T7KHNDAnJHw02v6nwJG6jjXe2xFWwqfc hIuj3L+LOjobg5D1RI/bMG9VzoidC8PHMzj42TJCjz+0k5g+i1KdHDp1Hq5CyBbssNu7xq xIPEYv0/LhhyO2SMW8fKch/YAvezB83awfyNZsm11m00yM5YLg55A7ik3XIaGODR6BYmGs FiRaZEBRKOn2NIuna2dlv6KIMqy2fiMFxTnYR8hSH0OaqQPjZDUkpT3vZYR07Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1680786742; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=N6+A7bECB1fVzpKN2U0VfcESyzTikbc0RNL2Ov+5gqE=; b=OyArkVpBSWfn2ABxdVO7vCAfl0ve1661wx0mTlan5wyBpRTNcPdhpk0ISRUXXLiBkC/56C FIY2pwA2D/hnp8DwoGIjSUcKWC4l25nm1C5fd3uJ1LORhXJb/otfz0zJLdp5x0OluTH8Sp pRP2RKGkQMFi1DpuQWaaj09evXzyOZMizYVlDNI7hrtI6vG22XhwF1Q4nK6UkHCJLdkF0u DIVm9HOM2pUxS8YoSBGyeitTs5f3DlgITNFc94dH065ZzFObzbMW/LG0DTF9LaZG+88YP8 m8uTOzekhg4p5qwtOqbSa59npLCPI8k2Q/VWku2lFwxMoD5PsW7/GhkxNujQDg== X-Migadu-Spam-Score: -3.22 X-Migadu-Scanner: scn1.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Spam-Score: -3.22 X-Migadu-Queue-Id: E064C113F0 X-TUID: SU1FHhyqKl0a Hi Jonathan, On 2023-04-05 21:19, Jonathan Brielmaier wrote: > I wonder if we should at least make the HTTP_PROXY variable > configurable. It may need to be set to something else then "" in some > scenarios. I don't know... No, there's no legitimate reason for this, since 'PROXY' is not a standard HTTP header according to [1]. PROXY being passed to a cgi application as HTTP_PROXY is what the exploit is about, since HTTP_PROXY is recognized as a variable for configuring proxies (for curl, wget, etc.) Allowing HTTP_PROXY to be set remotely (due to a confusion with the non-standard 'PROXY' header) is simply incomprehensible. Regarding user intent, that is, configuring the proxy used by the cgi application by setting HTTP_PROXY via nginx? I don't have this use-case but IMO it feels like an extreme poor design, since it's exploiting a name confusion to change the system environment variables for the cgi application. If for some reason you really need this, you can always use the regular nginx-location-configuration to manually craft a php-location. [1]: https://www.iana.org/assignments/http-fields/http-fields.xhtml Cheers, Bruno