Skip to content

puppet-openssl insecurely uses OpenSSL's -passin/-passout options

High
ekohl published GHSA-73qj-mxx8-4q9v Oct 1, 2024

Package

puppet/openssl (Puppet)

Affected versions

<= 3.1.0

Patched versions

>= 4.1.0

Description

Summary

While looking at puppet-openssl, I realized it uses OpenSSL's -passin/-passout options with "pass:" prefix, which leads to leakage of the password in the process list (and thus to all users of a system).

OpenSSL documentation [1] also states this is insecure.
I think we should either use a (properly secured) tempfile for this, or stdin.

[1] https://www.openssl.org/docs/man3.3/man1/openssl-passphrase-options.html

Details

% git grep pass:
lib/puppet/provider/x509_cert/openssl.rb:    options << ['-passin', "pass:#{resource[:password]}"] if resource[:password]
lib/puppet/provider/x509_request/openssl.rb:    options << ['-passin', "pass:#{resource[:password]}"] if resource[:password]
manifests/export/pem_cert.pp:    default => "-nokeys -passin pass:'${in_pass}'",
manifests/export/pem_key.pp:      default => "-passin pass:'${in_pass}'",
manifests/export/pem_key.pp:      default => "-passout pass:'${out_pass}'",
manifests/export/pkcs12.pp:      default => "-passin pass:${in_pass}",
manifests/export/pkcs12.pp:      default => "-passout pass:${out_pass}",

PoC

Watch ps aux |grep passin while Puppet is running.

Impact

Local users can obtain cert passwords and thus take over the cert if they can access the keys (which they usually should not, hopefully).

Severity

High

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Local
Attack complexity
Low
Privileges required
Low
User interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
None

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N

CVE ID

No known CVE

Weaknesses

Credits