From patchwork Tue Oct 17 16:12:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 5595 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.161.90 with SMTP id m26csp359289jah; Tue, 17 Oct 2017 09:12:30 -0700 (PDT) X-Google-Smtp-Source: ABhQp+T2+Py1+VF+HQB0fQJVqqmKiXq4et+8RckyoS/gLR+rN4cIS4Chgx6vOUcr4Z7K/FC14vm4 X-Received: by 10.28.8.212 with SMTP id 203mr3908434wmi.43.1508256750518; Tue, 17 Oct 2017 09:12:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508256750; cv=none; d=google.com; s=arc-20160816; b=wgjb+mBEEEFfo0DK65iXhf6hcUZR/3HJdns/FLkCE30GtJFgSQZPPHrfpNyzTlrHoJ M17ca3TJYaVrBP5/KLl1JE+LupqQZ0dugvO60ogCMgVlhj9m8lyEv4oy72sMlI9i8Zdd P5BXtv1xz1FFVka/RssQq67iMka0Ee4IbKfjmHNOLXyWYQ6UrFkaIs27LNRsHdIRn2Vd Ca+vsPlhat25bkn6zf+ASe1UjyUKHPpWBSLtU5nvA3og9w7j2HZ7aLiF3udcQcsOjTat R5jLUET2aY5+tjeOJ1AykdOf8Ggk5Kj7IgIIzfyl+IjNvOctYojtsnyMO9YePfBiRsWM ul5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:delivered-to :arc-authentication-results; bh=npaO8Fv4UU5vm2t8nBfwZKIE9JRUIfZd3FJ0f6q7bSw=; b=ZDawT2MZ1Lx1M3ToPRbEPSr0F02vjyPUN3qZHr1b/TuN+Vy62XSOzreA5wC5dHVPUF yOq/yG6sGaSu6QYUX+WnP6i3YGPWUuj4QI19kps2zf5uh9TXEnUnldfplvBmOxvIariK HGRQsfUyU/CUJk9GSCcizXp+zbRos04WcohQprqnYMMRXoJB7sPZgHxVJdexqPPEWrOi EFN/OCQVzBB8UTa8mWbcORZkxbXzXKH/nnbWbA+fRQwnPXr11cBS3yV/XNcF+wmBbrvr WggGttaUUEEOpJWq0bgMFvJl4UY3raYLWPy7BVGh/xqw2FrC88SU4CyI0cnRPWz7uRFz GAbw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id a16si7964402wrf.316.2017.10.17.09.12.30; Tue, 17 Oct 2017 09:12:30 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 7C3B8689F02; Tue, 17 Oct 2017 19:12:24 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-qmta-pe01-2.mx.upcmail.net (vie01a-qmta-pe01-2.mx.upcmail.net [62.179.121.179]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 20B43689753 for ; Tue, 17 Oct 2017 19:12:19 +0300 (EEST) Received: from [172.31.218.36] (helo=vie01a-dmta-pe02-3.mx.upcmail.net) by vie01a-pqmta-pe01.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1e4UTf-0004MF-N0 for ffmpeg-devel@ffmpeg.org; Tue, 17 Oct 2017 18:12:23 +0200 Received: from [172.31.216.43] (helo=vie01a-pemc-psmtp-pe01) by vie01a-dmta-pe02.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1e4UTZ-0001GQ-Rc for ffmpeg-devel@ffmpeg.org; Tue, 17 Oct 2017 18:12:17 +0200 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id NgCD1w02E0S5wYM01gCEGa; Tue, 17 Oct 2017 18:12:14 +0200 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Tue, 17 Oct 2017 18:12:13 +0200 Message-Id: <20171017161213.6748-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.14.2 Subject: [FFmpeg-devel] [PATCH] fateserver/log: clean chars in slot, time and log X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Fixes: Directory Traversal Found-by: Pankaj Jadhav Signed-off-by: Michael Niedermayer --- log.cgi | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/log.cgi b/log.cgi index d5d2abb..8767e3a 100755 --- a/log.cgi +++ b/log.cgi @@ -22,7 +22,11 @@ use FATE; my $req_slot = param 'slot'; my $req_time = param 'time'; +$req_slot =~ s/[^-._A-Za-z0-9 ]*//g; +$req_time =~ s/[^0-9]*//g; my ($req_log, $req_diff) = param('log') =~ m!([^/]+)(?:/([^/]+))?!; +$req_log =~ s/[^a-z]*//g; +$req_diff =~ s/[^0-9]*//g; my $repdir = "$fatedir/$req_slot/$req_time"; my $log = "$repdir/$req_log.log.gz";