From patchwork Mon Oct 16 20:36:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 5590 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.161.90 with SMTP id m26csp4121606jah; Mon, 16 Oct 2017 13:36:23 -0700 (PDT) X-Google-Smtp-Source: ABhQp+QB/vZZBLP/fyXEU0izOOORRODh35dr67ajefWbIg5NXAPkQTpzS0aaoYMCyH09iERIbSG1 X-Received: by 10.28.217.130 with SMTP id q124mr2049671wmg.30.1508186183156; Mon, 16 Oct 2017 13:36:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508186183; cv=none; d=google.com; s=arc-20160816; b=Ne3p4A44SXWaIjnz/LS/Lnvw7gRzv0GhQg1VfY0/F0/cPIu3cdaZ4rIk9pVnKWJVki S/daDFV32WL1z/Le9HpyaxJIaGEeqO1p8Xb5mpvoayNdplmhYlK27bRQPdcO6Uimb6kG qcw4q/R0ZNmruZFE1k9bsJ9QkCDMSApxYXaT69EjhlcHQ+Q653iwh4xuEpYnqTil2gq2 lj7IcI4yflkY9AzjrouxV49lz9L+zsMW5Arq3XHcEhx+Qlv+ETIVdjWs3CwUZ04bX6yZ HkI3eJMK2owdFoXFPZbMWVqCj37CiIM+A45QuW51f6s26H+cDAWlXlcp+A5HHjgPNECc 2epg== 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=/0VCQuGUT3JaCUiHb1KiS42h0/emk9Du0bzEWjbcnbk=; b=b83Y8qO0WrpyHTHYyDHMeyoLRt6U9dqfaIVt7FBrWs3CeNrLuSsN/RCmJnIy5MYKgT Wnec9k2sX69i/Qbx68Qdl3eItYPna24bJDHZTkccJKHfUDogvSneIPica/VI+jHW4Qnl iF2yK7c0s6dy/XUd1Fg4XOdeAVzKFywiw540bbkDSWxFcoOynbzbNfH/F599sFQSLMb3 lx1+2dWBquHn6SqHNMER/OpUL0UkRGxAiQp0ButzjGowL2GrawkSCMxep8HWcs0yc8ta IIiHBEVmc65TC3aOUzwz3mZuyqDBro4FK0hzix/innBhCDlb7lORodOkIE7jbnV/WFUe 7u7A== 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 v64si6399408wrc.287.2017.10.16.13.36.22; Mon, 16 Oct 2017 13:36:23 -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 D3DDA689E8E; Mon, 16 Oct 2017 23:36:16 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe07-3.mx.upcmail.net (vie01a-dmta-pe07-3.mx.upcmail.net [84.116.36.19]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5B2BF689CFA for ; Mon, 16 Oct 2017 23:36:10 +0300 (EEST) Received: from [172.31.216.43] (helo=vie01a-pemc-psmtp-pe01) by vie01a-dmta-pe07.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1e4C7S-0002ih-4z for ffmpeg-devel@ffmpeg.org; Mon, 16 Oct 2017 22:36:14 +0200 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id NLc41w01v0S5wYM01Lc5tC; Mon, 16 Oct 2017 22:36:06 +0200 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Mon, 16 Oct 2017 22:36:04 +0200 Message-Id: <20171016203604.5789-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.14.2 Subject: [FFmpeg-devel] [PATCH] fateserver/index: clean chars in sort parameter 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" Prevents cross site scripting attack Found-by: Pankaj Jadhav Signed-off-by: Michael Niedermayer --- index.cgi | 2 ++ 1 file changed, 2 insertions(+) diff --git a/index.cgi b/index.cgi index 030fb52..a164d3b 100755 --- a/index.cgi +++ b/index.cgi @@ -32,6 +32,8 @@ use URI::Escape; my @queries = split(/\/\//, uri_unescape param 'query') if (param 'query'); my $sort = param('sort'); +$sort =~ s/[^A-Za-z0-9 ]*//g; +param('sort', $sort); $sort = $sort eq 'arch' ? 'subarch': $sort; (my $uri = $ENV{REQUEST_URI}) =~ s/\?.*//;