Debian Codegraph @

mitigations/CVE-2026-43284

raw
1 #!/bin/sh
2
3 # Linux Vulnerability Mitigation
4 # Copyright (C) 2026 Daniel Baumann <[email protected]>
5 #
6 # SPDX-License-Identifier: PD
7 #
8 # This program is free software: you have unlimited permission
9 # to copy, distribute and modify it.
10 #
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14
15 set -e
16
17 CVE="CVE-2026-43284"
18 DATE="2026-05-07"
19 NAME="Dirty Frag (Part 1) / Copy Fail 2"
20 URL="https://github.com/V4bel/dirtyfrag / https://github.com/0xdeadbeefnetwork/Copy_Fail2-Electric_Boogaloo"
21
22 case "${1}" in
23 check)
24 if [ -e "/etc/modprobe.d/${CVE}.conf" ]
25 then
26 # installed
27 exit 0
28 else
29 # removed
30 exit 1
31 fi
32 ;;
33
34 status)
35 LINUX_CURRENT="$(uname -r | grep -Eo '^[0-9.]+')"
36 LINUX_FIXED="7.0.6"
37
38 if [ "$(printf '%s\n%s' "${LINUX_CURRENT}" "${LINUX_FIXED}" | sort -V | head -n1)" = "${LINUX_FIXED}" ]
39 then
40 # fixed
41 exit 0
42 fi
43
44 if lsmod | grep -qs esp4 || lsmod | grep -qs esp6 || lsmod | grep -qs xfrm_user || lsmod | grep -qs xfrm_algo
45 then
46 # vulnerable
47 exit 2
48 else
49 # mitigated
50 exit 1
51 fi
52 ;;
53
54 install)
55 mkdir -p /etc/modprobe.d
56
57 cat > "/etc/modprobe.d/${CVE}.conf" << EOF
58 # /etc/modprobe.d/${CVE}.conf
59
60 # Name: ${NAME}
61 # Date: ${DATE}
62 # URL: ${URL}
63
64 blacklist esp4
65 install esp4 /bin/false
66
67 blacklist esp6
68 install esp6 /bin/false
69
70 blacklist xfrm_user
71 install xfrm_user /bin/false
72
73 blacklist xfrm_algo
74 install xfrm_algo /bin/false
75 EOF
76
77 rmmod esp4 > /dev/null 2>&1 || true
78 rmmod esp6 > /dev/null 2>&1 || true
79
80 rmmod xfrm_user > /dev/null 2>&1 || true
81 rmmod xfrm_algo > /dev/null 2>&1 || true
82
83 echo 3 > /proc/sys/vm/drop_caches
84 ;;
85
86 remove)
87 rm -f /etc/modprobe.d/${CVE}.conf
88 rmdir /etc/modprobe.d > /dev/null 2>&1 || true
89 ;;
90 esac