{"id":"GHSA-73qj-mxx8-4q9v","aliases":[],"summary":"puppet-openssl insecurely uses OpenSSL's -passin/-passout options","published_at":"2024-10-01T13:51:33Z","modified_at":"2024-10-01T13:51:33Z","products":[{"slug":"puppet","name":"Puppet / OpenVox","category":"iac"}],"rating":{"severity":"high","score":7.1,"vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N","attack_path":"local","user_interaction":false,"malicious":false},"fix_available":false,"kev":{"listed":false,"ransomware":false},"public_exploit":false,"exploits":[],"priority":6.6,"record_count":1,"vendors":["GitHub"],"details":"### Summary\r\n\r\nWhile 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).\r\n\r\nOpenSSL documentation [1] also states this is insecure.\r\nI think we should either use a (properly secured) tempfile for this, or stdin.\r\n\r\n[1] https://www.openssl.org/docs/man3.3/man1/openssl-passphrase-options.html\r\n\r\n\r\n### Details\r\n\r\n```\r\n% git grep pass:\r\nlib/puppet/provider/x509_cert/openssl.rb:    options << ['-passin', \"pass:#{resource[:password]}\"] if resource[:password]\r\nlib/puppet/provider/x509_request/openssl.rb:    options << ['-passin', \"pass:#{resource[:password]}\"] if resource[:password]\r\nmanifests/export/pem_cert.pp:    default => \"-nokeys -passin pass:'${in_pass}'\",\r\nmanifests/export/pem_key.pp:      default => \"-passin pass:'${in_pass}'\",\r\nmanifests/export/pem_key.pp:      default => \"-passout pass:'${out_pass}'\",\r\nmanifests/export/pkcs12.pp:      default => \"-passin pass:${in_pass}\",\r\nmanifests/export/pkcs12.pp:      default => \"-passout pass:${out_pass}\",\r\n```\r\n\r\n### PoC\r\n\r\nWatch `ps aux |grep passin` while Puppet is running.\r\n\r\n### Impact\r\n\r\nLocal users can obtain cert passwords and thus take over the cert if they can access the keys (which they usually should not, hopefully).","affected_stack":[{"ecosystem":"GitHub","package":"voxpupuli/puppet-openssl/puppet/openssl","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"last_affected":"3.1.0"}]}],"provider":"github-repo-advisories","source":"GHSA-73qj-mxx8-4q9v","relation":"self"}],"affected_other":[],"product_status":[],"records":[{"provider":"github-repo-advisories","source_id":"GHSA-73qj-mxx8-4q9v","relation":"self","url":"https://github.com/voxpupuli/puppet-openssl/security/advisories/GHSA-73qj-mxx8-4q9v","license":"GitHub Terms of Service","published_at":"2024-10-01T13:51:33Z","modified_at":"2024-10-01T13:51:33Z","summary":"puppet-openssl insecurely uses OpenSSL's -passin/-passout options","details":"### Summary\r\n\r\nWhile 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).\r\n\r\nOpenSSL documentation [1] also states this is insecure.\r\nI think we should either use a (properly secured) tempfile for this, or stdin.\r\n\r\n[1] https://www.openssl.org/docs/man3.3/man1/openssl-passphrase-options.html\r\n\r\n\r\n### Details\r\n\r\n```\r\n% git grep pass:\r\nlib/puppet/provider/x509_cert/openssl.rb:    options << ['-passin', \"pass:#{resource[:password]}\"] if resource[:password]\r\nlib/puppet/provider/x509_request/openssl.rb:    options << ['-passin', \"pass:#{resource[:password]}\"] if resource[:password]\r\nmanifests/export/pem_cert.pp:    default => \"-nokeys -passin pass:'${in_pass}'\",\r\nmanifests/export/pem_key.pp:      default => \"-passin pass:'${in_pass}'\",\r\nmanifests/export/pem_key.pp:      default => \"-passout pass:'${out_pass}'\",\r\nmanifests/export/pkcs12.pp:      default => \"-passin pass:${in_pass}\",\r\nmanifests/export/pkcs12.pp:      default => \"-passout pass:${out_pass}\",\r\n```\r\n\r\n### PoC\r\n\r\nWatch `ps aux |grep passin` while Puppet is running.\r\n\r\n### Impact\r\n\r\nLocal users can obtain cert passwords and thus take over the cert if they can access the keys (which they usually should not, hopefully).","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N","source":"GHSA-73qj-mxx8-4q9v"}],"affected":[{"ecosystem":"GitHub","package":"voxpupuli/puppet-openssl/puppet/openssl","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"last_affected":"3.1.0"}]}],"provider":"github-repo-advisories","source":"GHSA-73qj-mxx8-4q9v","relation":"self"}],"product_status":[],"references":[{"type":"ADVISORY","url":"https://github.com/voxpupuli/puppet-openssl/security/advisories/GHSA-73qj-mxx8-4q9v"}]}],"references":[{"type":"ADVISORY","url":"https://github.com/voxpupuli/puppet-openssl/security/advisories/GHSA-73qj-mxx8-4q9v"}],"sources":[{"provider":"github-repo-advisories","source_id":"GHSA-73qj-mxx8-4q9v","url":"https://github.com/voxpupuli/puppet-openssl/security/advisories/GHSA-73qj-mxx8-4q9v","license":"GitHub Terms of Service","modified_at":"2024-10-01T13:51:33Z","relation":"self"}]}
