Critical XML External Entity (XXE) Vulnerability in PySAML2 Package

python-pysaml2 Updated 02 Oct 2025

Summary

24/03/2017
N/A
Yes i
High
7.5

CVE-2016-10149: XML External Entity (XXE) vulnerability in PySAML2 4.4.0 and earlier allows remote attackers to read arbitrary files via a crafted SAML XML request or response. Affects python-pysaml2 across 3 version ranges.

< 3.0.0-5 < 6e09a25d9b4b7aa7a506853210a9a14100b8bc9b < 78261b9ae13c3855b33009cb1c5abc2c45839828

Fixed in 3.0.0-5. How to fix ↓

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

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

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

PySAML2 is a Python library that provides support for SAML (Security Assertion Markup Language) authentication. It is widely used in applications requiring secure identity management and single sign-on capabilities. The library facilitates the exchange of authentication and authorization data between parties, particularly in web services. However, versions 4.4.0 and earlier are vulnerable to an XML External Entity (XXE) attack, which can lead to unauthorized access to sensitive files on the server.

Vulnerability Detail

The vulnerability arises from improper handling of XML input in PySAML2, allowing remote attackers to exploit the XXE flaw through crafted SAML XML requests or responses. This can lead to the disclosure of arbitrary files on the server, potentially exposing sensitive information. The vulnerability is particularly concerning as it can be exploited without authentication, making it a high-risk issue for applications using affected versions of the library.

How To Fix

Minimum fixed version

3.0.0-5

This is the first release that contains the fix.

sudo apt-get install --only-upgrade python-pysaml2

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

Workaround

If an immediate upgrade is not possible, consider disabling XML entity processing in your application. This can be done by modifying the XML parser settings to prevent external entities from being processed. For example, if using lxml, you can disable DTD processing as follows:

from lxml import etree

parser = etree.XMLParser(load_dtd=False)

This will help mitigate the risk until a proper upgrade can be performed.

Conclusion

The XXE vulnerability in PySAML2 poses a significant risk to applications using the library. Upgrading to a secure version is crucial to protect sensitive data from unauthorized access. Users are encouraged to implement the recommended fixes and utilize tools like Vulert for ongoing vulnerability monitoring.

See every vulnerability recorded for python-pysaml2 →

Share this vulnerability

FAQ

An XXE vulnerability allows an attacker to interfere with the processing of XML data, potentially leading to the disclosure of sensitive files or server-side request forgery.

You can use tools like Vulert to monitor and alert for open-source vulnerabilities in your software. Check your manifest file against known vulnerabilities.

Failure to address this vulnerability can lead to unauthorized access to sensitive files, which may result in data breaches and compliance issues.

Yes, you can use the Vulert playground to check if your application is affected by this vulnerability without needing to sign up.

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

Related vulnerabilities

Recent vulnerabilities recorded for python-pysaml2.

How To Fix

Minimum fixed version

3.0.0-5

This is the first release that contains the fix.

sudo apt-get install --only-upgrade python-pysaml2

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