CVE-2012-2921: Feedparser Denial of Service Vulnerability

HIGH
Advisory Identifier: GHSA-hjf3-r7gw-9rwg
CVSS 7.5
CWE-611
Published
Advisory Summary

CVE-2012-2921 is a HIGH (CVSS 7.5) denial of service vulnerability (CWE-611: Improper Restriction of XML External Entity Reference) affecting Feedparser libraries in the PyPI ecosystem. The issue involves feedparser denial of service vulnerability. Remediation is available by upgrading affected packages to version 5.1.2.

CVE-2012-2921 at a Glance

CVE Identifier CVE-2012-2921
GHSA Identifier GHSA-hjf3-r7gw-9rwg
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-611: Improper Restriction of XML External Entity Reference
Affected Product Feedparser
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 7.5

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

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

How to Fix CVE-2012-2921

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

feedparser fixed: 5.1.2
pip install feedparser>=5.1.2
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 feedparser

How to Check if You Are Affected

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

pip show feedparser

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

Note: The pip show feedparser 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 Feedparser, 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

Universal Feed Parser (aka feedparser or python-feedparser) before 5.1.2 allows remote attackers to cause a denial of service (memory consumption) via a crafted XML ENTITY declaration in a non-ASCII encoded document.

CVE-2012-2921 Affected Feedparser Versions

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

References

Frequently Asked Questions

What is CVE-2012-2921?
CVE-2012-2921 is a security vulnerability in Feedparser involving feedparser denial of service vulnerability under CWE-611: Improper Restriction of XML External Entity Reference.
Which Feedparser versions are affected?
Affected versions include releases prior to 5.1.2 across affected packages: feedparser.
What version fixes CVE-2012-2921?
Upgrading to 5.1.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is feedparser affected?
Yes, feedparser is affected in releases prior to 5.1.2. Upgrade your dependency to 5.1.2 or later.
What is the CVSS score of CVE-2012-2921?
CVE-2012-2921 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2012-2921?
CVE-2012-2921 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-2012-2921?
Run the dependency tree command: 'pip show feedparser'. 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-hjf3-r7gw-9rwg",
  "modified" : "2024-09-20T17:15:41Z",
  "published" : "2018-07-24T20:00:41Z",
  "aliases" : [ "CVE-2012-2921" ],
  "summary" : "feedparser denial of service vulnerability",
  "details" : "Universal Feed Parser (aka feedparser or python-feedparser) before 5.1.2 allows remote attackers to cause a denial of service (memory consumption) via a crafted XML ENTITY declaration in a non-ASCII encoded document.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "feedparser"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "5.1.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2012-2921"
  }, {
    "type" : "WEB",
    "url" : "https://code.google.com/p/feedparser/source/browse/trunk/NEWS?spec=svn706&r=706"
  }, {
    "type" : "WEB",
    "url" : "https://code.google.com/p/feedparser/source/detail?r=703&path=/trunk/feedparser/feedparser.py"
  }, {
    "type" : "ADVISORY",
    "url" : "https://github.com/advisories/GHSA-hjf3-r7gw-9rwg"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/kurtmckee/feedparser"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/feedparser/PYSEC-2012-14.yaml"
  }, {
    "type" : "WEB",
    "url" : "https://web.archive.org/web/20120604210617/http://www.securityfocus.com/bid/53654"
  }, {
    "type" : "WEB",
    "url" : "https://web.archive.org/web/20150523060531/http://www.mandriva.com/en/support/security/advisories/advisory/MDVSA-2013:118/?name=MDVSA-2013:118"
  }, {
    "type" : "WEB",
    "url" : "https://wiki.mageia.org/en/Support/Advisories/MGASA-2012-0157"
  }, {
    "type" : "WEB",
    "url" : "http://freecode.com/projects/feedparser/releases/344371"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-611" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-06-16T21:40:30Z",
    "nvd_published_at" : null
  }
}