CVE-2020-27304
The CivetWeb web library does not validate uploaded filepaths when running on an OS other than...
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
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- None
- User interaction
- None
What an attacker can affect
- Confidentiality
- High
- Integrity
- High
- Availability
- High
Exploit likelihood
What each source reports
NVD Score used
9.8
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
- Record
CVE-2020-27304- CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - CVSS 2.0
- 7.5 High
AV:N/AC:L/Au:N/C:P/I:P/A:P - Weakness
- CWE-23, CWE-22
- Updated
- 2026-11-02
CVE List No score
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
- Record
CVE-2020-27304- Weakness
- CWE-23
- Updated
- 2026-11-02
EUVDEUVD-2020-19817 No score
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
- Record
EUVD-2020-19817- Updated
- 2026-11-03
GitHub AdvisoriesGHSA-wphm-mh7c-38cf
9.8
The CivetWeb web library does not validate uploaded filepaths when running on an OS other than...
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
- Record
GHSA-wphm-mh7c-38cf- CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Weakness
- CWE-22
- Updated
- 2026-11-02
OSVAZL-39076
9.8
CVE-2020-27304 affecting package ceph for versions less than 18.2.1-1
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
- Record
AZL-39076- CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Updated
- 2026-11-02
OSV
9.8
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
- Record
CVE-2020-27304- CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Updated
- 2026-11-02
OSVDEBIAN-CVE-2020-27304
9.8
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
- Record
DEBIAN-CVE-2020-27304- CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Updated
- 2026-11-02
OSVUBUNTU-CVE-2020-27304
9.8
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
- Record
UBUNTU-CVE-2020-27304- CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Updated
- 2026-11-02
OSVopenSUSE-SU-2021:1424-1 No score
Security update for civetweb
This update for civetweb fixes the following issues:
Version 1.15:
- boo#1191938 / CVE-2020-27304: missing uploaded filepath validation in the default form-based file upload mechanism
- New configuration for URL decoding
- Sanitize filenames in handle form
- Example “embedded_c.c”: Do not overwrite files (possible security issue)
- Remove obsolete examples
- Remove “experimental” label for some features
- Remove MG_LEGACY_INTERFACE that have been declared obsolete in 2017 or earlier
- Modifications to build scripts, required due to changes in the test environment
- Unix domain socket support fixed
- Fixes for NO_SSL_DL
- Fixes for some warnings / static code analysis
Version 1.14:
- Change SSL default setting to use TLS 1.2 as minimum (set config if you need an earlier version)
- Add local_uri_raw field (not sanitized URI) to request_info
- Additional API functions and a callback after closing connections
- Allow mbedTLS as OpenSSL alternative (basic functionality)
- Add OpenSSL 3.0 support (OpenSSL 3.0 Alpha 13)
- Support UNIX/Linux domain sockets
- Fuzz tests and ossfuzz integration
- Compression for websockets
- Restructure some source files
- Improve documentation
- Fix HTTP range requests
- Add some functions for Lua scripts/LSP
- Build system specific fixes (CMake, MinGW)
- Update 3rd party components (Lua, lfs, sqlite)
- Allow Lua background script to use timers, format and filter logs
- Remove WinCE code
- Update version number
Version 1.13:
- Add arguments for CGI interpreters
- Support multiple CGi interpreters
- Buffering HTTP response headers, including API functions mg_response_header_* in C and Lua
- Additional C API functions
- Fix some memory leaks
- Extended use of atomic operations (e.g., for server stats)
- Add fuzz tests
- Set OpenSSL 1.1 API as default (from 1.0)
- Add Lua 5.4 support and deprecate Lua 5.1
- Provide additional Lua API functions
- Fix Lua websocket memory leak when closing the server
- Remove obsolete 'file in memory' implementation
- Improvements and fixes in documentation
- Fixes from static source code analysis
- Additional unit tests
- Various small bug fixes
- Experimental support for some HTTP2 features (not ready for production)
- Experimental support for websocket compression
- Remove legacy interfaces declared obsolete since more than 3 years
Version 1.12
- See https://github.com/civetweb/civetweb/releases/tag/v1.12 for detailed changelog
- Record
openSUSE-SU-2021:1424-1- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
cephAzure Linux:3 |
before 18.2.1-1 | 18.2.1-1 |
civetwebDebian:12 |
before 1.15+dfsg-1 | 1.15+dfsg-1 |
civetwebDebian:13 |
before 1.15+dfsg-1 | 1.15+dfsg-1 |
civetwebDebian:14 |
before 1.15+dfsg-1 | 1.15+dfsg-1 |
civetwebUbuntu:25.10 |
All versions, plus listed versions 1.16+dfsg-2 |
None known |
civetwebopenSUSE:Leap 15.2 |
before 1.15-lp152.2.3.1 | 1.15-lp152.2.3.1 |
History
| Recorded | Changed | Sources |
|---|---|---|
| aliases, products | EUVD | |
| first indexed | CVE List, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2020-27304 is a critical vulnerability (CVSS 9.8) in Civetweb, published October 21, 2021. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 3.27%, the 88th percentile. Fixed in ceph 18.2.1-1.
References
jfrog.com/blog/cve-2020-27304-rce-via-directory-traversal-in-civetweb-http-server
groups.google.com/g/civetweb/c/yPBxNXdGgJQ
cert-portal.siemens.com/productcert/pdf/ssa-389290.pdf
cert-portal.siemens.com/productcert/pdf/ssa-222547.pdf
nvd.nist.gov/vuln/detail/CVE-2020-27304
github.com/advisories/GHSA-wphm-mh7c-38cf