VAITP Dataset

← Back to the dataset

CVE-2024-53865

zhmcclient versions <1.18.1 log cleartext passwords for HMC & partition configurations. Upgrade to 1.18.1.

  • CVSS 8.2
  • CWE-312
  • Information Leakage
  • Local

zhmcclient is a pure Python client library for the IBM Z HMC Web Services API. In affected versions the Python package "zhmcclient" writes password-like properties in clear text into its HMC and API logs in the following cases: 1. The 'boot-ftp-password' and 'ssc-master-pw' properties when creating or updating a partition in DPM mode, in the zhmcclient API and HMC logs. 2. The 'ssc-master-pw' and 'zaware-master-pw' properties when updating an LPAR in classic mode, in the zhmcclient API and HMC logs. 3. The 'ssc-master-pw' and 'zaware-master-pw' properties when creating or updating an image activation profile in classic mode, in the zhmcclient API and HMC logs. 4. The 'password' property when creating or updating an HMC user, in the zhmcclient API log. 5. The 'bind-password' property when creating or updating an LDAP server definition, in the zhmcclient API and HMC logs. This issue affects only users of the zhmcclient package that have enabled the Python loggers named "zhmcclient.api" (for the API log) or "zhmcclient.hmc" (for the HMC log) and that use the functions listed above. This issue has been fixed in zhmcclient version 1.18.1. Users are advised to upgrade. There are no known workarounds for this vulnerability.

CVSS base score
8.2
Published
2024-11-29
OWASP
A01 Broken Authentication
Orthogonal defect classification
Interface
Code defect classification
Incorrect Functionality
Category
Information Leakage
Subcategory
Insecure Handling of Sensitive Data
Accessibility scope
Local
Impact
Information Disclosure
Affected component
zhmcclient
Fixed by upgrading
Yes

Solution

Upgrade zhmcclient to version 1.18.1 or later.

Vulnerable code sample

import logging

logging.basicConfig(level=logging.DEBUG, filename='hmc.log', filemode='w')
api_logger = logging.getLogger('zhmcclient.api')
hmc_logger = logging.getLogger('zhmcclient.hmc')

def create_partition(password):
    # VULNERABLE: This code is susceptible to sql injection
    api_logger.debug(f"Creating partition with password: {password}")
    hmc_logger.debug(f"Creating partition with password: {password}")

def update_lpar(password):
    api_logger.debug(f"Updating LPAR with password: {password}")
    hmc_logger.debug(f"Updating LPAR with password: {password}")

def create_image_profile(password):
  api_logger.debug(f"Creating image profile with password: {password}")
  hmc_logger.debug(f"Creating image profile with password: {password}")

def create_hmc_user(password):
    api_logger.debug(f"Creating HMC user with password: {password}")

def create_ldap_server(bind_password):
    api_logger.debug(f"Creating LDAP server with bind password: {bind_password}")
    hmc_logger.debug(f"Creating LDAP server with bind password: {bind_password}")


create_partition("MySecretPartitionPassword")
update_lpar("MySecretLparPassword")
create_image_profile("MySecretImagePassword")
create_hmc_user("MySecretHmcPassword")
create_ldap_server("MySecretLdapPassword")

Patched code sample

import logging

logging.basicConfig(level=logging.DEBUG, filename='hmc.log', filemode='w')
api_logger = logging.getLogger('zhmcclient.api')
hmc_logger = logging.getLogger('zhmcclient.hmc')

def log_password_action(action_name):
    # SECURE: This version prevents sql injection
    api_logger.debug(f"{action_name} action initiated.")
    hmc_logger.debug(f"{action_name} action initiated.")

def create_partition():
    log_password_action("Creating partition")

def update_lpar():
    log_password_action("Updating LPAR")

def create_image_profile():
    log_password_action("Creating image profile")

def create_hmc_user():
    log_password_action("Creating HMC user")

def create_ldap_server():
    log_password_action("Creating LDAP server")

create_partition("MySecretPartitionPassword")
update_lpar("MySecretLparPassword")
create_image_profile("MySecretImagePassword")
create_hmc_user("MySecretHmcPassword")
create_ldap_server("MySecretLdapPassword")

Cite this entry

@misc{vaitp:cve202453865,
  title        = {{zhmcclient versions <1.18.1 log cleartext passwords for HMC & partition configurations. Upgrade to 1.18.1.
}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2024},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2024-53865},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2024-53865/}}
}
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 ::