{"answers":{"affected":"3 open source packages ship an affected version, including pysaml2. It affects 2 products.","exploited":"There is no known exploitation of CVE-2021-21239 in the wild and no public exploit code.","fix":"Upgrade pysaml2 to 6.5.0 or later.","what":"CVE-2021-21239 is a medium-severity vulnerability in Debian Debian Linux, published on 21 Jan 2021. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link."},"fix_prompt":"Check this codebase for CVE-2021-21239 and fix it if it is affected.\n\nWhat it is: CVE-2021-21239 is a medium-severity vulnerability in Debian Debian Linux, published on 21 Jan 2021. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.\nExploitation: There is no known exploitation of CVE-2021-21239 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- pysaml2 (PyPI): affected all versions; fixed in 6.5.0\n- pysaml2 (PyPI): affected all versions; fixed in 6.5.0\n- pysaml2 (PyPI): affected all versions; fixed in 6.5.0\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2021-21239/ (Markdown: https://insights.sbomify.com/CVE-2021-21239/index.md)","id":"CVE-2021-21239","markdown":"https://insights.sbomify.com/CVE-2021-21239/index.md","name":"CVE-2021-21239","record":{"aliases":["DEBIAN-CVE-2021-21239","GHSA-5p3x-r448-pc62","PYSEC-2021-49","UBUNTU-CVE-2021-21239","USN-5066-1","USN-5066-2"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["security_bypass"],"network_reachable":"yes","non_default_config":false,"product_category":"Python SAML library","requires_auth":"none","summary":"Attackers can bypass SAML signature verification in PySAML2 by exploiting default xmlsec1 key-type preferences, allowing forged authentication assertions.","user_interaction":"required","vuln_class":"security_feature_bypass"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[{"product":"debian_linux","vendor":"debian"},{"product":"pysaml2","vendor":"pysaml2_project"}],"cvss":{"score":6.5,"severity":"medium","source":"cna","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N","version":"3.1"},"cwes":[{"id":"CWE-347","name":"Improper Verification of Cryptographic Signature"}],"description":"PySAML2 is a pure python implementation of SAML Version 2 Standard. PySAML2 before 6.5.0 has an improper verification of cryptographic signature vulnerability. Users of pysaml2 that use the default CryptoBackendXmlSec1 backend and need to verify signed SAML documents are impacted. PySAML2 does not ensure that a signed SAML document is correctly signed. The default CryptoBackendXmlSec1 backend is using the xmlsec1 binary to verify the signature of signed SAML documents, but by default xmlsec1 accepts any type of key found within the given document. xmlsec1 needs to be configured explicitly to only use only _x509 certificates_ for the verification process of the SAML document signature. This is fixed in PySAML2 6.5.0.","ecosystems":["PyPI"],"exploits":{"exploitdb":0,"first_seen":"2024-07-18","github_poc":4,"max_poc_stars":0,"metasploit":0,"nuclei":0,"refs":[{"date":"2024-07-18T23:02:10Z","kind":"github_poc","ref":"https://github.com/RyanBoomer30/CVE-2021-21239-Exploit","stars":0,"title":"Report documentation of this script is below"},{"date":"2025-08-03T03:36:47Z","kind":"github_poc","ref":"https://github.com/GrantBirki/redash-vulnerable","stars":0,"title":"A Dockerized Redash instance that is vulnerable to CVE-2021-21239"},{"date":"2025-09-10T17:48:08Z","kind":"github_poc","ref":"https://github.com/illera88/CVE-2021-21239","stars":0,"title":null},{"date":"2026-02-26T18:35:37Z","kind":"github_poc","ref":"https://github.com/Crims-on/CVE-2021-21239","stars":0,"title":"A script to exploit a vulnerability in xmlsec1 where xmlsec ignores loaded public keys"}],"tier":"poc_unverified"},"has_fix":true,"headline":"Open default xmlsec1 key-type preference","id":"CVE-2021-21239","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"PyPI","product":"debian:debian_linux","products":["debian:debian_linux"],"type":"security_feature_bypass","year":"2021"},"n_packages":3,"n_references":6,"next":{"headline":"Regular Expression Denial of Service in httplib2","id":"CVE-2021-21240"},"packages":[{"ecosystem":"PyPI","fixed":["6.5.0"],"introduced":["0"],"last_affected":[],"package":"pysaml2","purl":null,"source":"GHSA-5p3x-r448-pc62"},{"ecosystem":"PyPI","fixed":["6.5.0"],"introduced":["0"],"last_affected":[],"package":"pysaml2","purl":"pkg:pypi/pysaml2","source":"GHSA-5p3x-r448-pc62"},{"ecosystem":"PyPI","fixed":["6.5.0"],"introduced":["0"],"last_affected":[],"package":"pysaml2","purl":"pkg:pypi/pysaml2","source":"PYSEC-2021-49"}],"prev":{"headline":"SAML XML Signature wrapping","id":"CVE-2021-21238"},"products":["pysaml2"],"published":"2021-01-21","related":[{"cvss_score":10,"headline":"ProFTPD Improper Access Control","id":"CVE-2015-3306","kev_date_added":"2026-10-08","published":"2015-05-18"},{"cvss_score":9.9,"headline":"RoundCube Webmail Deserialization of Untrusted Data","id":"CVE-2025-49113","kev_date_added":"2026-02-20","published":"2025-06-02"},{"cvss_score":9.8,"headline":"GNU InetUtils Argument Injection","id":"CVE-2026-24061","kev_date_added":"2026-01-26","published":"2026-01-21"},{"cvss_score":9.8,"headline":"Linux Kernel Improper Check for Unusual or Exceptional Conditions","id":"CVE-2025-39682","kev_date_added":"2026-09-18","published":"2025-09-05"},{"cvss_score":9.8,"headline":"Mozilla Firefox Use-After-Free","id":"CVE-2024-9680","kev_date_added":"2024-10-15","published":"2024-10-09"},{"cvss_score":9.8,"headline":"RARLAB UnRAR Directory Traversal","id":"CVE-2022-30333","kev_date_added":"2022-08-09","published":"2022-05-09"},{"cvss_score":9.8,"headline":"Roundcube Webmail SQL Injection","id":"CVE-2021-44026","kev_date_added":"2023-06-22","published":"2021-11-19"}],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"CC BY 4.0","name":"PyPA Advisory Database","prefix":"PYSEC"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"},{"class":"open","licence":"CC0","name":"PoC-in-GitHub"}],"ssvc":{"automatable":null,"exploitation":null,"technical_impact":null},"state":"PUBLISHED","updated":"2024-08-03","vendors":["IdentityPython"]},"summary":"Attackers can bypass SAML signature verification in PySAML2 by exploiting default xmlsec1 key-type preferences, allowing forged authentication assertions.","url":"https://insights.sbomify.com/CVE-2021-21239/"}