Vulnerabilities in pkg:pypi/pysaml2

PACKAGE
Advisory Identifier: GHSA-m269-wj6g-c459
Advisory Summary

CVE-2016-10127 is a CRITICAL (CVSS 9.0) pysaml2 xml external entity attack vulnerability (CWE-611: Improper Restriction of XML External Entity Reference) affecting Pysaml2 libraries in the PyPI ecosystem. The issue involves pysaml2 xml external entity attack. Remediation is available by upgrading affected packages to version 4.5.0.

7 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:pypi/pysaml2

7 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:pypi/pysaml2. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-m269-wj6g-c459 CVE-2016-10127 CRITICAL PySAML2 XML external entity attack
GHSA-qf7v-8hj3-4xw7 CVE-2020-5390 HIGH Improper Verification of Cryptographic Signature in PySAML2
GHSA-924m-4pmx-c67h CVE-2017-1000433 CRITICAL pysaml2 Improper Authentication vulnerability
GHSA-c2vx-49jm-h3f6 CVE-2016-10149 HIGH Pysaml2 does not sanitize XML responses
GHSA-f4g9-h89h-jgv9 CVE-2021-21238 MODERATE SAML XML Signature wrapping in PySAML2
GHSA-5p3x-r448-pc62 CVE-2021-21239 MODERATE Improper Verification of Cryptographic Signature in PySAML2
GHSA-cq94-qf6q-mf2h CVE-2017-1000246 MODERATE Pysaml2 improperly initializes encryption vector

CVE-2016-10127 at a Glance

CVE Identifier CVE-2016-10127
GHSA Identifier GHSA-m269-wj6g-c459
Severity CRITICAL
CVSS v3.1 Base Score 9.0
CWE Classification CWE-611: Improper Restriction of XML External Entity Reference
Affected Product Pysaml2
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 9.0

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.0/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction Required (UI:R)
Scope Changed (S:C)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2016-10127

To remediate this vulnerability, upgrade all affected Pysaml2 dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

pysaml2 fixed: 4.5.0
pip install pysaml2>=4.5.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show pysaml2

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2016-10127, inspect your installed packages using pip:

pip show pysaml2

Analyze the terminal output to locate any version of Pysaml2 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.5.0), your application is affected.

Note: The pip show pysaml2 command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-611: Improper Restriction of XML External Entity Reference, where the product processes an xml document that can contain xml entities with uris that resolve to documents outside of the intended sphere of control, causing the product to embed incorrect documents into its output. In Pysaml2, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

PySAML2 allows remote attackers to conduct XML external entity (XXE) attacks via a crafted SAML XML request or response.

CVE-2016-10127 Affected Pysaml2 Versions

1 component(s)
Fixed Versions:
4.5.0
Product / Package Ecosystem Affected Versions Fixed Version
pysaml2
PyPI
< 4.5.0
4.5.0

References

Frequently Asked Questions

What is CVE-2016-10127?
CVE-2016-10127 is a security vulnerability in Pysaml2 involving PySAML2 XML external entity attack under CWE-611: Improper Restriction of XML External Entity Reference.
Which Pysaml2 versions are affected?
Affected versions include releases prior to 4.5.0 across affected packages: pysaml2.
What version fixes CVE-2016-10127?
Upgrading to 4.5.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is pysaml2 affected?
Yes, pysaml2 is affected in releases prior to 4.5.0. Upgrade your dependency to 4.5.0 or later.
What is the CVSS score of CVE-2016-10127?
CVE-2016-10127 has a CVSS v3.1 base score of 9.0 (CRITICAL) with vector string CVSS:3.0/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H.
What CWE is associated with CVE-2016-10127?
CVE-2016-10127 is classified under CWE-611: Improper Restriction of XML External Entity Reference (The product processes an XML document that can contain XML entities with URIs that resolve to documents outside of the intended sphere of control, causing the product to embed incorrect documents into its output.).
How can I check PyPI dependencies for CVE-2016-10127?
Run the dependency tree command: 'pip show pysaml2'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-m269-wj6g-c459",
  "modified" : "2024-10-24T21:52:38Z",
  "published" : "2022-05-17T02:56:23Z",
  "aliases" : [ "CVE-2016-10127" ],
  "summary" : "PySAML2 XML external entity attack",
  "details" : "PySAML2 allows remote attackers to conduct XML external entity (XXE) attacks via a crafted SAML XML request or response.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:P/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "pysaml2"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "4.5.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2016-10127"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rohe/pysaml2/issues/366"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rohe/pysaml2/pull/379"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rohe/pysaml2/commit/6e09a25d9b4b7aa7a506853210a9a14100b8bc9b"
  }, {
    "type" : "WEB",
    "url" : "https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=850716"
  }, {
    "type" : "ADVISORY",
    "url" : "https://github.com/advisories/GHSA-m269-wj6g-c459"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/pysaml2/PYSEC-2017-67.yaml"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/rohe/pysaml2"
  }, {
    "type" : "WEB",
    "url" : "https://web.archive.org/web/20200227195127/http://www.securityfocus.com/bid/95376"
  }, {
    "type" : "WEB",
    "url" : "http://www.openwall.com/lists/oss-security/2017/01/19/5"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-611" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-06-17T21:31:28Z",
    "nvd_published_at" : "2017-03-03T15:59:00Z"
  }
}