CVE-2012-5825: Tweepy Tweepy Does Not Verify SSL Vulnerability

MODERATE
Advisory Identifier: GHSA-pwx5-xg7g-wpc5
CVSS 5.3
CWE-20
Published
Advisory Summary

CVE-2012-5825 is a MODERATE (CVSS 5.3) tweepy does not verify ssl vulnerability (CWE-20: Improper Input Validation) affecting Tweepy libraries in the PyPI ecosystem. The issue involves tweepy does not verify ssl certificate. Remediation is available by upgrading affected packages to version 3.0.

CVE-2012-5825 at a Glance

CVE Identifier CVE-2012-5825
GHSA Identifier GHSA-pwx5-xg7g-wpc5
Severity MODERATE
CVSS v3.1 Base Score 5.3
CWE Classification CWE-20: Improper Input Validation
Affected Product Tweepy
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 5.3

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:L/A:N).

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 Low (I:L)
Availability None (A:N)

How to Fix CVE-2012-5825

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

tweepy fixed: 3.0
pip install tweepy>=3.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 tweepy

How to Check if You Are Affected

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

pip show tweepy

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

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

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-20: Improper Input Validation, where the product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly. In Tweepy, 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

Tweepy does not verify that the server hostname matches a domain name in the subject's Common Name (CN) or subjectAltName field of the X.509 certificate, which allows man-in-the-middle attackers to spoof SSL servers via an arbitrary valid certificate, related to use of the Python httplib library.

CVE-2012-5825 Affected Tweepy Versions

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

References

Frequently Asked Questions

What is CVE-2012-5825?
CVE-2012-5825 is a security vulnerability in Tweepy involving Tweepy does not verify SSL Certificate under CWE-20: Improper Input Validation.
Which Tweepy versions are affected?
Affected versions include releases prior to 3.0 across affected packages: tweepy.
What version fixes CVE-2012-5825?
Upgrading to 3.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is tweepy affected?
Yes, tweepy is affected in releases prior to 3.0. Upgrade your dependency to 3.0 or later.
What is the CVSS score of CVE-2012-5825?
CVE-2012-5825 has a CVSS v3.1 base score of 5.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N.
What CWE is associated with CVE-2012-5825?
CVE-2012-5825 is classified under CWE-20: Improper Input Validation (The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.).
How can I check PyPI dependencies for CVE-2012-5825?
Run the dependency tree command: 'pip show tweepy'. 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-pwx5-xg7g-wpc5",
  "modified" : "2024-11-18T22:57:06Z",
  "published" : "2022-05-17T01:38:35Z",
  "aliases" : [ "CVE-2012-5825" ],
  "summary" : "Tweepy does not verify SSL Certificate ",
  "details" : "Tweepy does not verify that the server hostname matches a domain name in the subject's Common Name (CN) or subjectAltName field of the X.509 certificate, which allows man-in-the-middle attackers to spoof SSL servers via an arbitrary valid certificate, related to use of the Python httplib library.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "tweepy"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2012-5825"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/tweepy/tweepy/issues/279"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/tweepy/tweepy/pull/400"
  }, {
    "type" : "WEB",
    "url" : "https://exchange.xforce.ibmcloud.com/vulnerabilities/79831"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/tweepy/PYSEC-2012-17.yaml"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/tweepy/tweepy"
  }, {
    "type" : "WEB",
    "url" : "http://www.cs.utexas.edu/~shmat/shmat_ccs12.pdf"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-20" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-08-29T21:28:26Z",
    "nvd_published_at" : "2012-11-04T22:55:00Z"
  }
}