Bug 2016640 (CVE-2020-27304) - CVE-2020-27304 civetweb: directory traversal when using the built-in example HTTP form-based file upload mechanism via the mg_handle_form_request API
Summary: CVE-2020-27304 civetweb: directory traversal when using the built-in example ...
Alias: CVE-2020-27304
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
Depends On: 2020730 2020740
Blocks: 2016641
TreeView+ depends on / blocked
Reported: 2021-10-22 13:33 UTC by Guilherme de Almeida Suckevicz
Modified: 2022-12-16 08:41 UTC (History)
12 users (show)

Fixed In Version: CivetWeb 1.15
Doc Type: If docs needed, set a value
Doc Text:
A remote code execution vulnerability was found in CivetWeb (embeddable web server/library). Due to a directory traversal issue, an attacker is able to add or overwrite files that are subsequently executed which lead to impact to confidentiality, integrity, and availability of the application.
Clone Of:
Last Closed: 2021-12-01 17:52:04 UTC

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2021:4902 0 None None None 2021-12-01 17:24:16 UTC

Description Guilherme de Almeida Suckevicz 2021-10-22 13:33:02 UTC
The CivetWeb web library does not validate uploaded filepaths when running on an OS other than Windows, when using the built-in HTTP form-based file upload mechanism, via the mg_handle_form_request API. Web applications that use the file upload form handler, and use parts of the user-controlled filename in the output path, are susceptible to directory traversal


Comment 1 Przemyslaw Roguski 2021-11-02 16:14:20 UTC
Important to mention that this vulnerability does not affect component if at least one of these is true:
- You are using the pre-built Windows executable from SourceForge or GitHub releases (no CivetWeb version is affected)
- You are using "make" (for Linux) or "cmake" in the civetweb root directory to build the server on your own.
- You are building only using files from src/ and include/ but not examples/.
- You do not have html form handlers, that allow file upload.

Comment 4 errata-xmlrpc 2021-12-01 17:24:15 UTC
This issue has been addressed in the following products:


Via RHSA-2021:4902 https://access.redhat.com/errata/RHSA-2021:4902

Comment 5 Product Security DevOps Team 2021-12-01 17:52:02 UTC
This bug is now closed. Further updates for individual products will be reflected on the CVE page(s):


Note You need to log in before you can comment on or make changes to this bug.