CVE-2021-39371: XML External Entity Injection in PyWPS

pywps Updated 02 Oct 2025

Summary

02/09/2021
Yes i
High
7.5

CVE-2021-39371: XML External Entity Injection in PyWPS. Affects pywps versions < 4.5.0. Fixed in 4.5.0. How to fix ↓

Also tracked for

The same CVE-2021-39371 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 Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

PyWPS is a Python library that provides an implementation of the Web Processing Service (WPS) standard. It allows users to publish, discover, and execute geospatial processes over the web. PyWPS is widely used in various applications and frameworks for geospatial data processing. However, a vulnerability has been discovered in PyWPS versions prior to 4.5.0 that allows an attacker to perform XML external entity (XXE) injection. This vulnerability can be exploited to view files on the application server filesystem by assigning a path to the entity. OWSLib 0.24.1, a dependency of PyWPS, may also be affected.

Vulnerability Detail

The XML external entity (XXE) injection vulnerability in PyWPS allows an attacker to manipulate XML input and exploit the application's XML parsing functionality. By injecting specially crafted XML entities, an attacker can force the application to access arbitrary files on the server's filesystem. This can lead to unauthorized disclosure of sensitive information, such as configuration files, credentials, or other sensitive data stored on the server. The vulnerability has a CVSS score of 7.5, indicating a high severity level.

How To Fix

Latest published version: 4.8.1 as of 22 Oct 2026

pip install --upgrade "pywps==4.8.1"

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

4.5.0

This is the first release that contains the fix.

pip install --upgrade "pywps==4.5.0"

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

Workaround

As a temporary workaround, developers can disable external entity resolution in the XML parser configuration. This can be achieved by modifying the XML parser settings to disallow the resolution of external entities. However, this workaround may impact the functionality of legitimate XML processing within the application. It is recommended to apply this workaround cautiously and prioritize upgrading to the fixed versions of PyWPS and OWSLib.

Conclusion

The XML external entity (XXE) injection vulnerability in PyWPS versions prior to 4.5.0 poses a significant risk to the confidentiality of sensitive information stored on the server's filesystem. It is crucial for users of PyWPS to upgrade to the fixed version and ensure that OWSLib is also updated to address any potential XXE vulnerabilities. Developers should review their XML parsing code and implement proper input validation to prevent XXE attacks. For further assistance and support in remediating this vulnerability, please contact DevNack.com.

See every vulnerability recorded for pywps →

Share this vulnerability

FAQ

PyWPS is a Python library that implements the Web Processing Service (WPS) standard. It allows users to publish, discover, and execute geospatial processes over the web.

XML external entity (XXE) injection is a vulnerability that allows an attacker to manipulate XML input and exploit the application's XML parsing functionality. By injecting specially crafted XML entities, an attacker can force the application to access arbitrary files on the server's filesystem.

The XXE injection vulnerability in PyWPS can lead to unauthorized disclosure of sensitive information stored on the server's filesystem. This includes configuration files, credentials, or other sensitive data that may be accessible to the application.

The CVSS score of this vulnerability is 7.5, indicating a high severity level.

To mitigate this vulnerability, it is recommended to upgrade PyWPS to version 4.5.0 or later and update OWSLib to the latest version. Additionally, developers should review their application's XML parsing code and implement proper input validation and sanitization measures to prevent XXE attacks.

Related vulnerabilities

Recent vulnerabilities recorded for pywps.

How To Fix

Latest published version: 4.8.1 as of 22 Oct 2026

pip install --upgrade "pywps==4.8.1"

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

4.5.0

This is the first release that contains the fix.

pip install --upgrade "pywps==4.5.0"

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