VAITP Dataset

← Back to the dataset

CVE-2015-3206

Python-kerberos' checkPassword function is vulnerable to man-in-the-middle attacks, causing denial of service and unspecified impacts

  • CVSS 8.1
  • CWE-287 Improper Authentication
  • Authentication, Authorization, and Session Management
  • Remote

The checkPassword function in python-kerberos does not authenticate the KDC it attempts to communicate with, which allows remote attackers to cause a denial of service (bad response), or have other unspecified impact by performing a man-in-the-middle attack.

CVSS base score
8.1
Published
2017-08-25
OWASP
A07 Identification and Authentication Failures
Orthogonal defect classification
Function
Code defect classification
Incorrect Functionality
Category
Authentication, Authorization, and Session Management
Subcategory
Insecure Authentication Mechanisms
Accessibility scope
Remote
Impact
Denial of Service (DoS)
Affected component
python-kerberos
Fixed by upgrading
Yes

Solution

Update python-kerberos to version with the fix for KDC authentication, if available.

Vulnerable code sample

import kerberos

def check_password(service, user, password):
    try:
        # Initialize the Kerberos context
        result, context = kerberos.authGSSClientInit(service)
        
        # Authenticate with the KDC without verifying its identity
        kerberos.authGSSClientStep(context, "")
        
        # Set the user and password
        kerberos.authGSSClientUser Name(context, user)
        kerberos.authGSSClientPassword(context, password)

        # Complete the authentication process
        kerberos.authGSSClientStep(context, "")
        
        return True
    except kerberos.GSSError as e:
        print(f"Kerberos authentication error: {e}")
        return False
    except Exception as e:
        print(f"Error: {e}")
        return False

Patched code sample

import kerberos

def check_password(service, user, password):
    try:
        # Initialize the Kerberos context
        result, context = kerberos.authGSSClientInit(service)
        
        # Authenticate with the KDC
        kerberos.authGSSClientStep(context, "")
        
        # Set the user and password
        kerberos.authGSSClientUser Name(context, user)
        kerberos.authGSSClientPassword(context, password)

        # Verify the KDC's response
        if kerberos.authGSSClientStep(context, "") != kerberos.AUTH_GSS_COMPLETE:
            raise Exception("KDC authentication failed or response invalid.")
        
        return True
    except kerberos.GSSError as e:
        print(f"Kerberos authentication error: {e}")
        return False
    except Exception as e:
        print(f"Error: {e}")
        return False

Published fix

Public sources link this CVE to the changes below. The code samples above were generated to illustrate the defect; these links lead to the code the project actually changed.

Cite this entry

@misc{vaitp:cve20153206,
  title        = {{Python-kerberos' checkPassword function is vulnerable to man-in-the-middle attacks, causing denial of service and unspecified impacts}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2017},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2015-3206},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2015-3206/}}
}

Download this entry as JSON Download the whole dataset

Introducing the "VAITP dataset": a specialized repository of Python vulnerabilities and patches, meticulously compiled for the use of the security research community. As Python's prominence grows, understanding and addressing potential security vulnerabilities become crucial. Crafted by and for the cybersecurity community, this dataset offers a valuable resource for researchers, analysts, and developers to analyze and mitigate the security risks associated with Python. Through the comprehensive exploration of vulnerabilities and corresponding patches, the VAITP dataset fosters a safer and more resilient Python ecosystem, encouraging collaborative advancements in programming security.

The supreme art of war is to subdue the enemy without fighting.

Sun Tzu – “The Art of War”

:: Shaping the future through research and ingenuity ::

Before you use the VAITP AI models

Please read and accept the following disclaimer:

By choosing "I understand and accept", you acknowledge that you understand and agree to these terms.