Skip to main content

Tweepy CVE-2012-5825

HIGH
Improper Input Validation (CWE-20)
2012-11-04 cve@mitre.org
7.4
CVSS 3.1 · NVD
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Gain man-in-the-middle network position
  2. Delivery
    Intercept Tweepy HTTPS to Twitter API
  3. Exploit
    Present arbitrary valid certificate
  4. Execution
    Client skips hostname verification
  5. Impact
    Decrypt/alter traffic and steal OAuth tokens

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V2 - Validation and Business Logic Input validation, allowlisting
Exploitation Conditions

Exploitation requires the attacker to occupy an active man-in-the-middle position on the network path between the Tweepy client and Twitter's servers (e.g., rogue/public Wi-Fi, ARP spoofing, DNS/gateway compromise) and to present any certificate that is valid (issued by a trusted CA) but for a different hostname. No special Tweepy configuration is needed - the missing hostname check is the default behavior of the vulnerable versions using Python's httplib, so any application using an affected Tweepy release over HTTPS is exposed. The key limiting factor is the AC:H requirement: without a network intercept position the flaw cannot be triggered, which is why real-world exploitation is localized/targeted rather than remote-from-anywhere despite AV:N.

Impact

This is a genuine but moderate-priority integrity/confidentiality issue whose CVSS 3.1 base score of 7.4 (AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N) is driven by high confidentiality and integrity impact but tempered by AC:H, which correctly reflects that exploitation requires the attacker to first achieve a man-in-the-middle position on the network path between the Tweepy client and Twitter's servers. Multiple signals converge on 'real but not urgent': EPSS is only 0.15% (35th percentile), the flaw is NOT in CISA KEV (no confirmed active exploitation), yet POC/exploit material IS publicly available - the referenced http://www.cs.utexas.edu/~shmat/shmat_ccs12.pdf is the well-known Georgiev/Shmatikov 'The Most Dangerous Code in the World' CCS 2012 paper documenting this exact class of non-browser SSL certificate-validation failure. The signals are internally consistent rather than conflicting: low EPSS + no KEV + academic-paper POC indicates a well-understood weakness that is demonstrable in research but not the subject of mass opportunistic exploitation, largely because it demands an active network position (rogue AP, ARP spoofing, compromised gateway). Treat this as a patch-in-normal-cadence dependency hygiene item, not an emergency; the primary risk is theft or tampering of Twitter API OAuth credentials/tokens transiting an attacker-controlled network.

Exploit ScenarioDerived

An attacker on the same network segment as a host running a Tweepy-based application (public Wi-Fi, compromised router, or ARP-spoofed LAN) intercepts the outbound HTTPS connection to the Twitter API and presents any valid-but-unrelated X.509 certificate. Because Tweepy (via Python httplib) never checks that the certificate's CN/subjectAltName matches the intended hostname, the client accepts the connection, letting the attacker decrypt, read, and modify API traffic including OAuth tokens. A conceptual POC and analysis exist in the referenced CCS 2012 academic paper, though this is not an off-the-shelf weaponized exploit.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.1% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Sep 17, 2026

Man-in-the-middle spoofing of Twitter's servers in Tweepy allows attackers to intercept and modify API communications because the library fails to verify the X.509 certificate hostname. Exploitation requires the attacker to occupy a network intercept position (AC:H), but any application using an affected Tweepy release over HTTPS is exposed, leading to high confidentiality and integrity impact. A public proof-of-concept exists, and the vendor has released a patch; EPSS is low at 0.15%.

RemediationAI

Upgrade Tweepy to a version that includes hostname verification for X.509 certificates. The vendor has released a patch; consult the vendor's security advisory for the exact fixed version. If immediate upgrade is not possible, consider using a Python version that performs hostname verification by default in its SSL module (e.g., Python 2.7.9+ or 3.4.3+), as this may mitigate the issue when Tweepy relies on the underlying library. However, this workaround may not cover all cases and requires testing. Alternatively, implement custom hostname verification in your application code before sending sensitive data, but this is error-prone. Finally, restrict Tweepy usage to trusted networks to reduce the risk of man-in-the-middle attacks, though this is not a complete mitigation. For additional details, refer to the X-Force entry (https://exchange.xforce.ibmcloud.com/vulnerabilities/79831) and the academic paper (http://www.cs.utexas.edu/~shmat/shmat_ccs12.pdf).

Affected Packages

pypi tweepy fix: 2.3.1, 3.0

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in pypi

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

CVE-2012-5825 affects the Tweepy Python library, specifically versions that rely on Python's httplib for HTTPS connections to the Twitter API. The vulnerability arises because Tweepy does not perform hostname verification on the server's X.509 certificate; it checks that the certificate is signed by a trusted CA but does not verify that the certificate's Common Name (CN) or subjectAltName matches the domain being accessed. This is categorized as CWE-20 (Improper Input Validation) because the library fails to validate the input (the certificate's hostname) against the expected value. The root cause is the lack of proper certificate validation in the underlying httplib usage, which was a common issue in older Python versions. As a result, an attacker with a man-in-the-middle position can present any valid certificate (e.g., for a domain they control) to spoof the Twitter server and intercept or modify sensitive API traffic. The CPE cpe:2.3:a:tweepy:tweepy:-:*:*:*:*:*:*:* indicates that all versions of Tweepy prior to the patch are potentially affected, as the CPE does not specify a version, but in practice the fix was applied in a later release.

Know when Tweepy gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

NVD PRIMARY 7.4 HIGH
AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N
vuln.today AI 7.4 HIGH

AC:H because a man-in-the-middle position must first be established; PR:N/UI:N as no auth or victim interaction is needed; C:H/I:H for full traffic read/tamper, A:N as availability is unaffected.

3.1 AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N
4.0 AV:N/AC:H/AT:N/PR:N/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N

Primary rating from NVD.

CVSS VectorNVD

Attack Vector
Network
Attack Complexity
High
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
None

Lifecycle Timeline

4
Analysis Updated
Sep 17, 2026 - 14:43 vuln.today
v1 - CVSS changed
Severity Changed
Sep 17, 2026 - 14:37 NVD
MEDIUM HIGH
CVSS changed
Sep 17, 2026 - 14:37 NVD
5.8 (MEDIUM) 7.4 (HIGH)
CVE Published
Nov 04, 2012 - 22:55 cve.org
MEDIUM 5.8

DescriptionNVD

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.

Executive ViewAI

Why It Matters

Tweepy, a Python library used to integrate applications with Twitter's API, can allow an attacker positioned on the network to intercept or alter API communications in affected releases. This exposes organizations relying on affected applications to potential unauthorized access, data disclosure, or manipulation of Twitter API actions, and publicly available exploit code exists. Leadership should ensure affected applications are inventoried and patched promptly because the issue affects confidentiality and integrity of integrated social-media workflows.

Business Impact: High
Compensating Controls

Apply vendor patch.

Threat Intelligence Overview

EPSS Score
0.1%
Top 65% exploitable
Prevalence
Medium
popular Python Twitter API client library, common but not ubiquitous
Exploit
POC
Public exploit code exists
Data Quality
3 sources
Confidence: Low

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC Yes
EPSS 0.1%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
Poc
System Exposure· derived
Open
Automatable· derived
No
Human Impact
High

Priority Score

57
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +37
PoC: +20
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.

Affected Products (CPE)NVD

cpe:2.3:a:tweepy:tweepy:-:*:*:*:*:*:*:*

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy