Brian Coca:
> Prefixing with trusted vars is still open to directory traversal.
oh that is true, thanks for pointing that out!
(example:
1.1.1.1/../foo-2.2.2.2)
> In
> most cases you can setup your systems so the variable data is set by
> the 'master' always and not derived from the target, which avoids this
> issue altogether.
I agree, but in my case I use the IP address as unique identifier and
only the target knows its IPs.
> This is only a problem if you rely on untrusted data to access
> secrets, there is not much Ansible can do in that case. I would advise
> creating assert/fail tasks to validate the data before using it.
I opened a github issue to validate all elements of
ansible_all_ipv4_addresses
by default against an IP address regex:
https://github.com/ansible/ansible/issues/14350