tetragon/example: Add a blocking policy to mitigate CVE-2026-31431#4944
tetragon/example: Add a blocking policy to mitigate CVE-2026-31431#4944alcastronic wants to merge 3 commits into
Conversation
Adding a policy that mitigates the exploitation of CVE-2026-31431. This is done by blocking the creation of the AF_ALG socket. The policy overrides the syscall sys_socket with -1 when AF_ALG is passed as the communication domain. Signed-off-by: alcastronic <tronic@alcastronic.eu>
Change the value for the matchArgs to be of type string. Was type int. Signed-off-by: alcastronic <tronic@alcastronic.eu>
|
/label release-note/misc |
|
Hi maintainers, could you please add the |
kkourt
left a comment
There was a problem hiding this comment.
Thanks for the PR!
I don't have any specific objections to the policy itself (from a cursory look it seems reasonable to me), but I'm not sure if we want to have CVE mitigations as examples in the Tetragon repository.
My concern is that CVE mitigation policies are very difficult to get right, and adding a CVE mitigation as an example sets certain expectations that are challenging to be met by the Tetragon project. IMO, this content seems better suited for a blog post or, even, a different repository.
|
Thanks for your feedback! A blogpost on CVE mitigations using Tetragon would allow to also detail on challenges in such policies in general. Which is an interesting topic that will stay important. As observed with this CVE patches have not been immediately available and mitigating a CVE with Tetragon has immediate effect. So I agree with you, a blogpost would provide better value. Regarding the addition of CVE mitigation policies. There are two of those in ˋexamples/tracingpolicy/cvesˋ. To understand your concerns here a bit better, do you think it would make sense to rather add a monitoring policy instead of an enforce policy? That is, implications such as unhandled errors in software that uses e.g. ˋAF_ALGˋ are not as drastic. Id be fine with either way, merging this PR, changing the policy to monitor mode or closing the PR. |
Adding a policy that mitigates the exploitation of CVE-2026-31431. This is done by blocking the creation of the AF_ALG socket. The policy overrides the syscall
sys_socketwith-1whenAF_ALGis passed as the communication domain.Description
This adds an example policy that mitigates the exploitation of the privilege escalation bug CVE-2026-31431.
The exploit requires the creation of a socket with the communication domain
AF_ALGto copy bytes.According to the team who discovered the vulnerability, the communication domain is not widely used.
Mitigations published by distributions, e.g., RHEL, recommend disabling the kernel module for
algif_aeadentirely by blocklisting it in GRUB, which requires a reboot.Adding this policy allows users of Tetragon to directly prevent the exploitation of this CVE.
By setting the policy to monitor mode, it is possible to detect exploitation attempts on patched systems.
Coverage
This policy works on different versions of the exploit that may use several vectors, including patching
/usr/bin/suin memory or overwriting/etc/passwd.Xint Code Team
Tetragon output
🚀 process host /usr/bin/python3 copy-fail.py ❓ syscall host /usr/bin/python3 __x64_sys_socket 💥 exit host /usr/bin/python3 copy-fail.py 1C version
Tetragon output
Arbitrary patches
/etc/passwdor patch arbitrary binaries https://github.com/Sndav/CVE-2026-31431-Advanced-ExploitTetragon output
🚀 process host /usr/bin/python3 advanced-exploit.py escalate ❓ syscall host /usr/bin/python3 __x64_sys_socket 💥 exit host /usr/bin/python3 advanced-exploit.py escalate 1