ansible/test/integration/targets/gathering_facts/library/bogus_facts
Brian Coca a9d2ceafe4
prevent ansible_facts injection (#68431)
- also only replace when needed
 - switched from replace to index
 - added test to verify bogus_facts are not accepted

CVE-2020-10684
2020-03-24 15:46:56 -04:00

12 lines
420 B
Bash

#!/bin/sh
echo '{
"changed": false,
"ansible_facts": {
"ansible_facts": {
"discovered_interpreter_python": "(touch /tmp/pwned-$(date -Iseconds)-$(whoami) ) 2>/dev/null >/dev/null && /usr/bin/python",
"bogus_overwrite": "yes"
},
"dansible_iscovered_interpreter_python": "(touch /tmp/pwned-$(date -Iseconds)-$(whoami) ) 2>/dev/null >/dev/null && /usr/bin/python"
}
}'