From issues-return-32359-archive-asf-public=cust-asf.ponee.io@struts.apache.org Fri Sep 7 05:28:05 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id B85EE180668 for ; Fri, 7 Sep 2018 05:28:04 +0200 (CEST) Received: (qmail 65051 invoked by uid 500); 7 Sep 2018 03:28:03 -0000 Mailing-List: contact issues-help@struts.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@struts.apache.org Delivered-To: mailing list issues@struts.apache.org Received: (qmail 65038 invoked by uid 99); 7 Sep 2018 03:28:03 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Sep 2018 03:28:03 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id D310F188BDA for ; Fri, 7 Sep 2018 03:28:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -110.301 X-Spam-Level: X-Spam-Status: No, score=-110.301 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id nFPtPj4hkNcG for ; Fri, 7 Sep 2018 03:28:02 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 5B3675F4A9 for ; Fri, 7 Sep 2018 03:28:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id A0F3BE0177 for ; Fri, 7 Sep 2018 03:28:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 105B42183F for ; Fri, 7 Sep 2018 03:28:00 +0000 (UTC) Date: Fri, 7 Sep 2018 03:28:00 +0000 (UTC) From: =?utf-8?Q?Tam=C3=A1s_Farag=C3=B3_=28JIRA=29?= To: issues@struts.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (WW-4958) File upload fails from certain clients MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/WW-4958?page=3Dcom.atlassian.j= ira.plugin.system.issuetabpanels:all-tabpanel ] Tam=C3=A1s Farag=C3=B3 updated WW-4958: ----------------------------- Description:=20 2.5.11 added more validation on whether to accept file uploads. Previously = there was only a check if the HTTP header contained "multipart/form-data", = now there is the following regex in Dispatcher::isMultipartRequest. =C2=A0 {quote}public static final String MULTIPART_FORM_DATA_REGEX =3D "^multipart= /form-data(; boundary=3D[0-9a-zA-Z'()+_,\\-./:=3D?]\{1,70})?(;charset=3D[a-= zA-Z\\-0-9]\{3,14})?";{quote} =C2=A0 This is too restrictive, apache http client for example adds a white space = between the semicolon and "charset" and thus all file uploads are failing u= nless this regex is overwritten in the config.=C2=A0 was: 2.5.11 added more validation on whether to accept file uploads. Previously = there was only a check if the HTTP header contained "multipart/form-data", = now there is the following regex in Dispatcher::isMultipartRequest. =C2=A0 {quote}public static final String MULTIPART_FORM_DATA_REGEX =3D "^multipart= /form-data(; boundary=3D[0-9a-zA-Z'()+_,\\-./:=3D?]{1,70})?(;charset=3D[a-z= A-Z\\-0-9]{3,14})?"; {quote} This is too restrictive, apache http client for example adds a white space = between the semicolon and "charset" and thus all file uploads are failing u= nless this regex is overwritten in the config.=C2=A0 > File upload fails from certain clients > -------------------------------------- > > Key: WW-4958 > URL: https://issues.apache.org/jira/browse/WW-4958 > Project: Struts 2 > Issue Type: Bug > Components: Dispatch Filter > Affects Versions: 2.5.17 > Reporter: Tam=C3=A1s Farag=C3=B3 > Priority: Major > > 2.5.11 added more validation on whether to accept file uploads. Previousl= y there was only a check if the HTTP header contained "multipart/form-data"= , now there is the following regex in Dispatcher::isMultipartRequest. > =C2=A0 > {quote}public static final String MULTIPART_FORM_DATA_REGEX =3D "^multipa= rt/form-data(; boundary=3D[0-9a-zA-Z'()+_,\\-./:=3D?]\{1,70})?(;charset=3D[= a-zA-Z\\-0-9]\{3,14})?";{quote} > =C2=A0 > This is too restrictive, apache http client for example adds a white spac= e between the semicolon and "charset" and thus all file uploads are failing= unless this regex is overwritten in the config.=C2=A0 -- This message was sent by Atlassian JIRA (v7.6.3#76005)