Description
The MultipartStream class in Apache Commons Fileupload before 1.3.2, as used in Apache Tomcat 7.x before 7.0.70, 8.x before 8.0.36, 8.5.x before 8.5.3, and 9.x before 9.0.0.M7 and other products, allows remote attackers to cause a denial of service (CPU consumption) via a long boundary string.
Mitigation
We recommend upgrading to a version of this component that is not vulnerable to this specific issue.
**Workaround:**
> 1\. All users of Apache Struts should replace the copy of Commons
>
> 2\. System administrators should restrict the permitted maximum size of HTTP request header values (For example, Apache Httpd provides a LimitRequestFieldSize directive and Apache Tomcat provides a maxHttpHeaderSize attribute in their respective configuration files). A maximum header value size of 2048 bytes would block all dangerous request.
>
> Example:
> File upload requests contain a so-called boundary in the Content-Type header:
>
> ```
> Content-Type: multipart/mixed;
> boundary=gc0p4Jq0M2Yt08jU534c0p
> ```
>
> The boundary may be chosen by the request sender. In the case of previous versions of Apache Commons Fileupload the boundary becomes dangerous if its size is close to 4096 bytes.
Reference: [http://mail-archives.apache.org/mod_mbox/www-announce/201606.mbox/%[email protected]%3E](http://mail-archives.apache.org/mod_mbox/www-announce/201606.mbox/%[email protected]%3E)
Note: If this component is included as a bundled/transitive dependency of another component, there may not be an upgrade path. In this instance, we recommend contacting the maintainers who included the vulnerable package. Alternatively, we recommend investigating alternative components or a potential mitigating control.