CVE-2018-7490: uWSGI Directory Traversal Vulnerability

uwsgi Updated 02 Oct 2025

Summary

26/02/2018
Yes i
High
7.5

CVE-2018-7490: uWSGI before 2.0.17 mishandles a DOCUMENT_ROOT check during use of the --php-docroot option, allowing directory traversal. Affects uwsgi versions < 2.0.17. Fixed in 2.0.17. How to fix ↓

Also tracked for

The same CVE-2018-7490 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

uWSGI is a fast, self-healing and developer-friendly application server that deploys web applications written in various languages, including Python. It provides a wide range of features such as load balancing, caching, and process management. This vulnerability affects uWSGI versions prior to 2.0.17 and is related to the mishandling of the DOCUMENT_ROOT check when using the --php-docroot option. This flaw allows an attacker to perform directory traversal attacks, potentially accessing sensitive files outside the intended directory.

Vulnerability Detail

The vulnerability in uWSGI arises from a lack of proper input validation when processing the --php-docroot option. By manipulating the value of this option, an attacker can bypass the intended document root directory and traverse the file system to access files or directories that should be restricted. This could lead to unauthorized disclosure of sensitive information or even remote code execution if the attacker can exploit other vulnerabilities in the system. It is important to note that this vulnerability only affects uWSGI versions prior to 2.0.17.

How To Fix

Minimum fixed version

2.0.17

This is the first release that contains the fix.

pip install --upgrade "uwsgi==2.0.17"

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

If upgrading uWSGI is not immediately feasible, a temporary workaround can be implemented by disabling the --php-docroot option or ensuring that the value provided for this option is properly validated and restricted to the intended document root directory. Here is an example of how to disable the --php-docroot option in a uWSGI configuration file:

[uwsgi]
php-docroot=

By setting the value of php-docroot to an empty string, the vulnerable functionality is effectively disabled.

Conclusion

The uWSGI directory traversal vulnerability (CVE-2018-7490) allows attackers to bypass the intended document root directory and access sensitive files outside the intended scope. To mitigate this vulnerability, it is recommended to upgrade uWSGI to version 2.0.17 or later. If immediate upgrade is not possible, disabling the --php-docroot option or properly validating its value can serve as a temporary workaround. Stay vigilant and apply the necessary security patches to protect your system from potential exploitation. For further support on vulnerability remediation, you can reach out to DevNack.com.

See every vulnerability recorded for uwsgi →

Share this vulnerability

FAQ

The vulnerability allows an attacker to perform directory traversal attacks, potentially accessing sensitive files outside the intended directory. This could lead to unauthorized disclosure of sensitive information or even remote code execution if the attacker can exploit other vulnerabilities in the system.

The vulnerability affects uWSGI versions prior to 2.0.17. It is recommended to upgrade to version 2.0.17 or later to mitigate the risk.

At the time of this report, there are no known public exploits specifically targeting this vulnerability. However, it is important to promptly apply the recommended fixes to prevent potential exploitation.

Yes, a temporary workaround is to disable the --php-docroot option or ensure that the value provided for this option is properly validated and restricted to the intended document root directory. Please refer to the 'workaround' section for more details.

For more information about this vulnerability, including technical details and the official fix, you can refer to the advisory provided by the Python Package Index (PyPI) advisory database. The link to the advisory is available in the 'affected' section of this report.

Related vulnerabilities

Recent vulnerabilities recorded for uwsgi.

How To Fix

Minimum fixed version

2.0.17

This is the first release that contains the fix.

pip install --upgrade "uwsgi==2.0.17"

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback