Advisory Database
  • Advisories
  • Dependency Scanning
  1. pypi
  2. ›
  3. ops
  4. ›
  5. CVE-2024-41129

CVE-2024-41129: ops leaking secrets if `subprocess.CalledProcessError` happens with a `secret-*` CLI command

July 22, 2024

The issue here is that we pass the secret content as one of the args via CLI. This issue may affect any of our charms that are using: Juju (>=3.0), Juju secrets and not correctly capturing and processing subprocess.CalledProcessError.

There are two points that may log this command, in different files:

First, if there is an error during a secret handling, there will be a subprocess.CalledProcessError, which will contain the CLI comand + all its args. This is going to be logged in any logging level. This exception, if not caught by the charm, will bubble up to the /var/log/juju/ logs and syslog journal. Now, on Ubuntu 22.04, these logs are protected with:

$ juju ssh -m controller 0 -- ls -la /var/log/juju/
total 224
drwxr-xr-x 2 syslog adm      4096 Jul 14 10:59 .
drwxrwxr-x 9 root   syslog   4096 Jul 14 10:58 ..
-rw-r----- 1 syslog adm     20124 Jul 14 11:10 audit.log
-rw-r----- 1 syslog adm    110432 Jul 14 11:10 logsink.log
-rw-r----- 1 syslog adm     80783 Jul 14 11:06 machine-0.log
-rw-r----- 1 syslog adm       766 Jul 14 11:10 machine-lock.log
-rw-r--r-- 1 root   root        0 Jul 14 10:59 slow-query.log
-rw-r----- 1 syslog adm      3732 Jul 14 11:10 unit-controller-0.log

Second, certain audit setups may log terminal commands, which would result in this command being logged with its secrets. It is unknown if this is done on ubuntu security benchmarks, such as CIS hardening.

Keep in mind these logs may be copied or even backed up. Which exposes it to more services in the user’s environment (e.g. CI runs in GH - although these are dummy password generated per test only).

References

  • github.com/advisories/GHSA-hcmv-jmqh-fjgm
  • github.com/canonical/operator
  • github.com/canonical/operator/commit/fea6d2072435a62170d4c01272572f1a7e916e61
  • github.com/canonical/operator/security/advisories/GHSA-hcmv-jmqh-fjgm
  • nvd.nist.gov/vuln/detail/CVE-2024-41129

Code Behaviors & Features

Detect and mitigate CVE-2024-41129 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions starting from 2.0.0 before 2.15.0

Fixed versions

  • 2.15.0

Solution

Upgrade to version 2.15.0 or above.

Impact 4.4 MEDIUM

CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:H/I:N/A:N

Learn more about CVSS

Weakness

  • CWE-532: Insertion of Sensitive Information into Log File

Source file

pypi/ops/CVE-2024-41129.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 14 May 2025 12:15:49 +0000.