High severityNVD Advisory· Published Jan 3, 2019· Updated Aug 5, 2024
CVE-2018-16876
CVE-2018-16876
Description
ansible before versions 2.5.14, 2.6.11, 2.7.5 is vulnerable to a information disclosure flaw in vvv+ mode with no_log on that can lead to leakage of sensible data.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
ansiblePyPI | < 2.5.14 | 2.5.14 |
ansiblePyPI | >= 2.6.0a1, < 2.6.11 | 2.6.11 |
ansiblePyPI | >= 2.7.0a1, < 2.7.5 | 2.7.5 |
Affected products
1Patches
3e0a81d133ffcensure ssh retry respects no log (#49569) (#49726)
2 files changed · +15 −4
changelogs/fragments/avoid_ssh_retry_discolsures.yml+2 −0 added@@ -0,0 +1,2 @@ +bugfixes: + - now no log is being respected on retry and high verbosity. CVE-2018-16876
lib/ansible/plugins/connection/ssh.py+13 −4 modified@@ -256,19 +256,28 @@ def wrapped(self, *args, **kwargs): try: try: return_tuple = func(self, *args, **kwargs) - display.vvv(return_tuple, host=self.host) + if self._play_context.no_log: + display.vvv('rc=%s, stdout & stderr censored due to no log' % return_tuple[0], host=self.host) + else: + display.vvv(return_tuple, host=self.host) # 0 = success # 1-254 = remote command return code - # 255 = failure from the ssh command itself - except (AnsibleControlPersistBrokenPipeError) as e: + # 255 could be a failure from the ssh command itself + except (AnsibleControlPersistBrokenPipeError): # Retry one more time because of the ControlPersist broken pipe (see #16731) display.vvv(u"RETRYING BECAUSE OF CONTROLPERSIST BROKEN PIPE") return_tuple = func(self, *args, **kwargs) if return_tuple[0] != 255: break else: - raise AnsibleConnectionFailure("Failed to connect to the host via ssh: %s" % to_native(return_tuple[2])) + msg = "Failed to connect to the host via ssh: " + if self._play_context.no_log: + msg += '<error censored due to no log>' + else: + msg += to_native(return_tuple[2]) + raise AnsibleConnectionFailure(msg) + except (AnsibleConnectionFailure, Exception) as e: if attempt == remaining_tries - 1: raise
424c68f15ad9ensure ssh retry respects no log (#49569) (#49725)
2 files changed · +15 −4
changelogs/fragments/avoid_ssh_retry_discolsures.yml+2 −0 added@@ -0,0 +1,2 @@ +bugfixes: + - now no log is being respected on retry and high verbosity. CVE-2018-16876
lib/ansible/plugins/connection/ssh.py+13 −4 modified@@ -273,11 +273,14 @@ def wrapped(self, *args, **kwargs): try: try: return_tuple = func(self, *args, **kwargs) - display.vvv(return_tuple, host=self.host) + if self._play_context.no_log: + display.vvv('rc=%s, stdout & stderr censored due to no log' % return_tuple[0], host=self.host) + else: + display.vvv(return_tuple, host=self.host) # 0 = success # 1-254 = remote command return code - # 255 = failure from the ssh command itself - except (AnsibleControlPersistBrokenPipeError) as e: + # 255 could be a failure from the ssh command itself + except (AnsibleControlPersistBrokenPipeError): # Retry one more time because of the ControlPersist broken pipe (see #16731) cmd = args[0] if self._play_context.password and isinstance(cmd, list): @@ -290,7 +293,13 @@ def wrapped(self, *args, **kwargs): if return_tuple[0] != 255: break else: - raise AnsibleConnectionFailure("Failed to connect to the host via ssh: %s" % to_native(return_tuple[2])) + msg = "Failed to connect to the host via ssh: " + if self._play_context.no_log: + msg += '<error censored due to no log>' + else: + msg += to_native(return_tuple[2]) + raise AnsibleConnectionFailure(msg) + except (AnsibleConnectionFailure, Exception) as e: if attempt == remaining_tries - 1: raise
0954942dfdc5ensure ssh retry respects no log (#49569) (#49724)
2 files changed · +13 −4
changelogs/fragments/avoid_ssh_retry_discolsures.yml+2 −0 added@@ -0,0 +1,2 @@ +bugfixes: + - Respect no_log on retry and high verbosity (CVE-2018-16876)
lib/ansible/plugins/connection/ssh.py+11 −4 modified@@ -335,11 +335,14 @@ def wrapped(self, *args, **kwargs): try: try: return_tuple = func(self, *args, **kwargs) - display.vvv(return_tuple, host=self.host) + if self._play_context.no_log: + display.vvv('rc=%s, stdout & stderr censored due to no log' % return_tuple[0], host=self.host) + else: + display.vvv(return_tuple, host=self.host) # 0 = success # 1-254 = remote command return code # 255 could be a failure from the ssh command itself - except (AnsibleControlPersistBrokenPipeError) as e: + except (AnsibleControlPersistBrokenPipeError): # Retry one more time because of the ControlPersist broken pipe (see #16731) cmd = args[0] if self._play_context.password and isinstance(cmd, list): @@ -357,8 +360,12 @@ def wrapped(self, *args, **kwargs): break if SSH_ERROR: - raise AnsibleConnectionFailure("Failed to connect to the host via ssh: %s" - % to_native(return_tuple[2])) + msg = "Failed to connect to the host via ssh: " + if self._play_context.no_log: + msg += '<error censored due to no log>' + else: + msg += to_native(return_tuple[2]) + raise AnsibleConnectionFailure(msg) break
Vulnerability mechanics
Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
23- lists.opensuse.org/opensuse-security-announce/2019-04/msg00021.htmlghsavendor-advisoryx_refsource_SUSEWEB
- lists.opensuse.org/opensuse-security-announce/2019-06/msg00077.htmlghsavendor-advisoryx_refsource_SUSEWEB
- lists.opensuse.org/opensuse-security-announce/2019-08/msg00020.htmlghsavendor-advisoryx_refsource_SUSEWEB
- access.redhat.com/errata/RHSA-2018:3835ghsavendor-advisoryx_refsource_REDHATWEB
- access.redhat.com/errata/RHSA-2018:3836ghsavendor-advisoryx_refsource_REDHATWEB
- access.redhat.com/errata/RHSA-2018:3837ghsavendor-advisoryx_refsource_REDHATWEB
- access.redhat.com/errata/RHSA-2018:3838ghsavendor-advisoryx_refsource_REDHATWEB
- access.redhat.com/errata/RHSA-2019:0564ghsavendor-advisoryx_refsource_REDHATWEB
- access.redhat.com/errata/RHSA-2019:0590ghsavendor-advisoryx_refsource_REDHATWEB
- github.com/advisories/GHSA-j569-fghw-f9rxghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2018-16876ghsaADVISORY
- usn.ubuntu.com/4072-1/mitrevendor-advisoryx_refsource_UBUNTU
- www.debian.org/security/2019/dsa-4396ghsavendor-advisoryx_refsource_DEBIANWEB
- www.securityfocus.com/bid/106225mitrevdb-entryx_refsource_BID
- bugzilla.redhat.com/show_bug.cgighsax_refsource_CONFIRMWEB
- github.com/ansible/ansible/commit/0954942dfdc563f80fd3e388f550aa165ec931daghsaWEB
- github.com/ansible/ansible/commit/424c68f15ad9f532d73e5afed33ff477f54281a7ghsaWEB
- github.com/ansible/ansible/commit/e0a81d133ffc8f7067182c53cf6a28c724dd1099ghsaWEB
- github.com/ansible/ansible/issues/51318ghsaWEB
- github.com/ansible/ansible/pull/49569ghsax_refsource_MISCWEB
- github.com/pypa/advisory-database/tree/main/vulns/ansible/PYSEC-2019-141.yamlghsaWEB
- usn.ubuntu.com/4072-1ghsaWEB
- web.archive.org/web/20200227100904/http://www.securityfocus.com/bid/106225ghsaWEB
News mentions
0No linked articles in our index yet.