mirror of https://github.com/ansible/ansible.git
Wrap CLI Passwords with AnsibleUnsafeText, ensure unsafe context is not lost during encode/decode (#63351)
* Wrap .encode and .decode on AnsibleUnsafe objects * runme.sh needs to be executable * ci_complete * Update changelog with CVEpull/63398/head
parent
73febd4ea6
commit
7f4befdea7
@ -0,0 +1,12 @@
|
||||
bugfixes:
|
||||
- >
|
||||
**security issue** - Convert CLI provided passwords to text initially, to
|
||||
prevent unsafe context being lost when converting from bytes->text during
|
||||
post processing of PlayContext. This prevents CLI provided passwords from
|
||||
being incorrectly templated (CVE-2019-14856)
|
||||
- >
|
||||
**security issue** - Update ``AnsibleUnsafeText`` and ``AnsibleUnsafeBytes``
|
||||
to maintain unsafe context by overriding ``.encode`` and ``.decode``. This
|
||||
prevents future issues with ``to_text``, ``to_bytes``, or ``to_native``
|
||||
removing the unsafe wrapper when converting between string types
|
||||
(CVE-2019-14856)
|
@ -0,0 +1,2 @@
|
||||
needs/target/setup_pexpect
|
||||
shippable/posix/group3
|
@ -0,0 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -eux
|
||||
|
||||
ANSIBLE_ROLES_PATH=../ ansible-playbook setup.yml
|
||||
|
||||
python test-cli.py
|
@ -0,0 +1,4 @@
|
||||
- hosts: localhost
|
||||
gather_facts: no
|
||||
roles:
|
||||
- setup_pexpect
|
@ -0,0 +1,21 @@
|
||||
#!/usr/bin/env python
|
||||
# Copyright (c) 2019 Matt Martz <matt@sivel.net>
|
||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
|
||||
# Make coding more python3-ish
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
import os
|
||||
|
||||
import pexpect
|
||||
|
||||
os.environ['ANSIBLE_NOCOLOR'] = '1'
|
||||
out = pexpect.run(
|
||||
'ansible localhost -m debug -a msg="{{ ansible_password }}" -k',
|
||||
events={
|
||||
'SSH password:': '{{ 1 + 2 }}\n'
|
||||
}
|
||||
)
|
||||
|
||||
assert b'{{ 1 + 2 }}' in out
|
Loading…
Reference in New Issue