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 ...
Keywords:
Status: CLOSED ERRATA
Alias: CVE-2020-27304
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
high
high
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
URL:
Whiteboard:
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:
Environment:
Last Closed: 2021-12-01 17:52:04 UTC
Embargoed:


Attachments (Terms of Use)


Links
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

Reference:
https://groups.google.com/g/civetweb/c/yPBxNXdGgJQ
https://jfrog.com/blog/cve-2020-27304-rce-via-directory-traversal-in-civetweb-http-server/

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:

  RHACS-3.67-RHEL-8

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):

https://access.redhat.com/security/cve/cve-2020-27304


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