Security researchers from SentinelLabs have discovered a new heap overflow vulnerability in the Linux Kernel’s Transparent Inter Process Communication (TIPC) module. The vulnerability being tracked as CVE-2021-43267 can be exploited either locally or remotely within the network to execute arbitrary code within the kernel and compromise the entire machine. Let’s know more about the Transparent Inter Process Communication (TIPC) module in Linux and see how to fix CVE-2021-43267, A heap overflow vulnerability in Linux Kernel’s TIPC Module.
In short, TIPC is an Inter-process communication (IPC) service in Linux that operates between nodes across the cluster. If you want to learn in detail about the TIPC, you can visit its official TIPC page.
TIPM protocol is part of all major Linux distribution kernel modules. When a user loads a TIPC module, the kernel uses the TIPC as a socket and configures it on a network interface to work in a low-privileged mode on top of ethernet protocol. Host communicate with each other by exchanging the TIPC messages between their kernels.
The TIPC protocol operates in a way transparent to the user. Each TIPC packet is composed of a header and a payload. Each header will have two variables: Header Size and Message Size. Header Size denotes the size of the header, whereas Message Size denotes the total size of the packet.
TIPC protocol has a function ‘tipc_msg_validate‘ to validate the Header and Message Size. This function performs three validations: 1. Message Size is greater than Header Size, 2. The TIPC packet payload size is validated against the maximum user message size, and 3. The Message Size is validated against the actual received packet length.
The vulnerability begins with the introduction of a new user message, ‘MSG_CRYPTO,’ which allows peers to send cryptographic keys. When the MSG_CRYPTO message is received, the TIPC kernel module should copy this information (the name of the key algorithm along with the key) into the storage for that node.
The most important part of this vulnerability is lice in the Header Size calculation. As mentioned above, both Header Size and Message Size are validated against the actual packet size. Total Message Size should not exceed the range of the actual packet. The problem is, that there are no checks implemented to calculate the size of the MSG_CRYPTO message against the total Message Size. This improper validation allows an attacker to create a packet with a small body size to allocate heap memory. For instance, an attacker can create a 20-byte packet and set the message size to 10 bytes without failing the check. Please check the detailed technical analysis from the original report published by Sentinal Labs.
This heap overflow vulnerability can be exploited either locally or remotely within the network to execute arbitrary code within the kernel and compromise the entire machine.
Description: The Transparent Inter-Process Communication (TIPC) functionality allows remote attackers to exploit insufficient validation of user-supplied sizes for the MSG_CRYPTO message type.
Overall CVSS Score | 9.8 |
Base Score | 9.8 |
impact SubScore | 5.9 |
Exploitabality Sub Score | 3.9 |
Attack Vector | Network |
Privileges Required | None |
Scope | Unchanged |
Integrity Impact | High |
Environmental Score | 9.8 |
Temporal Score | 9.8 |
Attack Complexity | Low |
User Interaction | None |
Confidentiality Impact | High |
Availability Impact | High |
Since this Heap Overflow Vulnerability (CVE-2021-43267) affects only TIPC users, they should ensure that their Linux kernel version is not between 5.10-rc1 and 5.14.16. Ubuntu published an advisory on Nov 02, 2021; look at the advisory from here.
between 5.10-rc1 and 5.14.16
5.15
5.4.0-9.124.13.0-16.194.4.0-2.163.11.0-12.19
This vulnerability has been patched in kernel v5.15 with two changes: 1. A validation function has been moved before the copy process takes place instead of after it, 2. A size overflow check has been added along with additional checks for the minimum packet size and the supplied key size. It is recommended to upgrade your kernel to v5.15 as soon as possible.
There are multiple ways to update the kernel on Linux. The best and the native way is to download and install the tested kernel package. Please contact your support to choose the best way that works for you. Just for the demonstration, we are going to show you how to upgrade the kernel on Ubuntu or Debian servers in a native way.
kernel.ubuntu.com/~kernel-ppa/mainline/(opens in a new tab)
Note: Before you download and install it on your production server, we recommend testing this on a test machine. Don’t forget to take the full VM snapshot if are upgrading the kernel on a Virtual Image. Or, take the filesystem back up if you have a physical server.
Before you start upgradation, check the version of the kernel your server has. What if the kernel version is not in the list of affected versions, If so, you can schedule this later as per your time.
Run this command to check the kernel version.
$ uname -rs
Download the kernel packages directly from the kernel.ubuntu.com website. Download the latest version available (At the bottom) from the website to a dedicated directory. Change the permission of the files to execute.
Create a directory in your path:
$ mkdir /home/arunkl/kernel-5.15
Change the directory:
$ cd /home/arunkl/kernel-5.15/
Download these two files (where X.Y.Z is the highest version):
1. linux-image-*X.Y.Z*-generic-*.deb
2. linux-modules-X.Y.Z*-generic-*.deb
Commands to download the kernel v5.15
$ wget https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.15/amd64/linux-image-unsigned-5.15.0-051500-generic_5.15.0-051500.202110312130_amd64.deb
$ wget https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.15/amd64/linux-modules-5.15.0-051500-generic_5.15.0-051500.202110312130_amd64.deb
Run this command to set the file permission to execution mode:
$ chmod +x *.deb
Install the downloaded packages using the default dpkg utility then reboot the server.
$ sudo dpkg –install *.deb
$ reboot
Use the same command used in the first step. You will see upgraded kernel version if everything goes well.
$ uname -rs
RedHat didn’t release patches to this vulnerability as the latest version of the kernel module RedHat supports is 4.18.0-305, which comes in the not affected version category.
RedHat didn’t release patches to this vulnerability as the latest version of the kernel module RedHat supports is 4.18.0-305, which comes in the not affected version category.
Release | General Availability Date | redhat-release Errata Date* | Kernel Version |
---|---|---|---|
RHEL 8.4 | 2021-05-18 | 2021-05-18 RHSA-2021:1578 | 4.18.0-305 |
RHEL 8.3 | 2020-11-03 | 2020-11-03 RHBA-2020:4495 | 4.18.0-240 |
RHEL 8.2 | 2020-04-28 | 2020-04-28 RHBA-2020:1758 | 4.18.0-193 |
RHEL 8.1 | 2019-11-05 | 2019-11-05 RHBA-2019:3543 | 4.18.0-147 |
RHEL 8 | 2019-05-07 | – | 4.18.0-80 |
Release | General Availability Date | redhat-release Errata Date* | Kernel Version |
---|---|---|---|
RHEL 7.9 | 2020-09-29 | 2020-09-29 RHBA-2020:3849 | 3.10.0-1160 |
RHEL 7.8 | 2020-03-31 | 2020-03-31 RHBA-2020:1033 | 3.10.0-1127 |
RHEL 7.7 | 2019-08-06 | 2019-08-06 RHBA-2019:2351 | 3.10.0-1062 |
RHEL 7.6 | 2018-10-30 | 2018-10-30 RHBA-2018:3014 | 3.10.0-957 |
RHEL 7.5 | 2018-04-10 | 2018-04-10 RHEA-2018:0700 | 3.10.0-862 |
RHEL 7.4 | 2017-07-31 | 2017-07-31 RHBA-2017:1850 | 3.10.0-693 |
RHEL 7.3 | 2016-11-03 | 2016-11-03 RHEA-2016-2544 | 3.10.0-514 |
RHEL 7.2 | 2015-11-19 | 2015-11-19 RHEA-2015:2461 | 3.10.0-327 |
RHEL 7.1 | 2015-03-05 | 2015-03-05 RHEA-2015:0524 | 3.10.0-229 |
RHEL 7.0 GA | 2014-06-09 | – | 3.10.0-123 |
RHEL 7.0 Beta | 2013-12-11 | – | 3.10.0-54.0.1 |
Check the latest kernel versions for older RHEL here.
We hope this post helps you learn How to Fix CVE-2021-43267- A Heap Overflow Vulnerability in Linux Kernel’s TIPC Module. Thanks for reading this threat post. Please share this post and help to secure the digital world. Visit our social media page on Facebook, LinkedIn, Twitter, Telegram, Tumblr, & Medium and subscribe to receive updates like this.
You may also like these articles:
How To Fix The Dirty Pipe Vulnerability In Linux Kernel- CVE-2022-0847
How To Fix CVE-2022-25636- A Heap Out Of Bounds Write Vulnerability In Netfilter
How to Fix CVE-2022-2959- A Privilege Escalation Vulnerability in Linux Kernel
How To Fix CVE-2022-23088- A Heap-Based Buffer Overflow Vulnerability In FreeBSD
Arun KL is a cybersecurity professional with 15+ years of experience in IT infrastructure, cloud security, vulnerability management, Penetration Testing, security operations, and incident response. He is adept at designing and implementing robust security solutions to safeguard systems and data. Arun holds multiple industry certifications including CCNA, CCNA Security, RHCE, CEH, and AWS Security.
“Knowledge Arsenal: Empowering Your Security Journey through Continuous Learning”
"Cybersecurity All-in-One For Dummies" offers a comprehensive guide to securing personal and business digital assets from cyber threats, with actionable insights from industry experts.
BurpGPT is a cutting-edge Burp Suite extension that harnesses the power of OpenAI's language models to revolutionize web application security testing. With customizable prompts and advanced AI capabilities, BurpGPT enables security professionals to uncover bespoke vulnerabilities, streamline assessments, and stay ahead of evolving threats.
PentestGPT, developed by Gelei Deng and team, revolutionizes penetration testing by harnessing AI power. Leveraging OpenAI's GPT-4, it automates and streamlines the process, making it efficient and accessible. With advanced features and interactive guidance, PentestGPT empowers testers to identify vulnerabilities effectively, representing a significant leap in cybersecurity.
Tenable BurpGPT is a powerful Burp Suite extension that leverages OpenAI's advanced language models to analyze HTTP traffic and identify potential security risks. By automating vulnerability detection and providing AI-generated insights, BurpGPT dramatically reduces manual testing efforts for security researchers, developers, and pentesters.
Microsoft Security Copilot is a revolutionary AI-powered security solution that empowers cybersecurity professionals to identify and address potential breaches effectively. By harnessing advanced technologies like OpenAI's GPT-4 and Microsoft's extensive threat intelligence, Security Copilot streamlines threat detection and response, enabling defenders to operate at machine speed and scale.