Commit 6027fb5 1 parent 876b0ef commit 6027fb5 Copy full SHA for 6027fb5
File tree 1 file changed +21
-1
lines changed
1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,27 @@ We suggest you read this page along with the `Ansible 10 Changelog <https://gith
18
18
Playbook
19
19
========
20
20
21
- No notable changes
21
+ * Conditionals - due to mitigation of security issue CVE-2023-5764 in ansible-core 2.16.1,
22
+ conditional expressions with embedded template blocks can fail with the message
23
+ "``Conditional is marked as unsafe, and cannot be evaluated. ``" when an embedded template
24
+ consults data from untrusted sources like module results or vars marked ``!unsafe ``.
25
+ Conditionals with embedded templates can be a source of malicious template injection when
26
+ referencing untrusted data, and can nearly always be rewritten without embedded
27
+ templates. Playbook task conditional keywords such as ``when `` and ``until `` have long
28
+ displayed warnings discouraging use of embedded templates in conditionals; this warning
29
+ has been expanded to non-task conditionals as well, such as the ``assert `` action.
30
+
31
+ .. code-block :: yaml
32
+ - name : task with a module result (always untrusted by Ansible)
33
+ shell : echo "hi mom"
34
+ register : untrusted_result
35
+ # don't do it this way...
36
+ # - name: insecure conditional with embedded template consulting untrusted data
37
+ # assert:
38
+ # that: '"hi mom" is in {{ untrusted_result.stdout }}'
39
+ - name : securely access untrusted values directly as Jinja variables instead
40
+ assert :
41
+ that : ' "hi mom" is in untrusted_result.stdout'
22
42
23
43
24
44
Command Line
You can’t perform that action at this time.
0 commit comments