Table of Contents
  • Home
  • /
  • Blog
  • /
  • How To Fix The Out-Of-Bounds Write Vulnerability In Samba vfs_fruit Module (CVE-2021-44142)
February 1, 2022
|
5m

How To Fix The Out-Of-Bounds Write Vulnerability In Samba vfs_fruit Module (CVE-2021-44142)


Vulnerability In Samba Vfs_fruit Module

A security researcher from DEVCORE, Orange Tsai disclosed a critical out-of-bounds write vulnerability in Samba vfs_fruit module along with a medium and low vulnerability. The out-of-bound read/write vulnerability is tracked under CVE-2021-44142 has a base score of 9.9 out of 10. The successful exploitation of the flaw allows remote attackers to execute arbitrary code on the affected machine with the highest root privileges. Since Samba is one of the most common services being used in multiple platforms, we can say that millions of servers are vulnerable to the flaw. It is important to learn how to fix the CVE-2021-44142 vulnerability in Samba. So, let’s see How to Fix the Out-of-Bounds Write Vulnerability In Samba vfs_fruit module (CVE-2021-44142) along with the other two CVE-2021-44141 and CVE-2022-0336 vulnerabilities in this post.

What Is Samba?

As the front page at samba.org says: Samba is a software package that gives network administrators flexibility and freedom in terms of setup, configuration, and choice of systems and equipment. 

Samba is free software used to implement the Server Message Block (SMB) protocol. It’s used to share files over the network. It is also referred to as the Common Internet File System, in short, CIFS. If you ask what platforms support this protocol. The answer is pretty much all. It supports Windows, Linux, and Mac. We have shown how to build a personal cross-platform file-sharing server using Samba on a small computer like Raspberry Pi in a different post. 

What Is Out-Of-Bounds Write Vulnerability?

A simple explanation for this is if a service or a program writes data outside of the boundaries of the buffer. That could be either the beginning or after the end of the allocated buffer.

This could lead to many negative implications, which may include:

  1. Data corruption

  2. Crash of service or the program

  3. Arbitrary code execution vulnerability

Summary Of The Samba vfs_fruit Vulnerability (CVE-2021-44142)?

There are other three vulnerabilities that Samba addressed:

  1. CVE-2021-44141

  2. CVE-2021-44142

  3. CVE-2022-0336

Summary Of CVE-2021-44142:

The out-of-bound heap read/write vulnerability actually lice in the Samba vfs_fruit module, which provides enhanced compatibility with Apple SMB clients and interoperability with a Netatalk 3 AFP fileserver. Attackers can exploit the vulnerability using a specially crafted extended file attribute.

All versions of Samba prior to 4.13.17 are vulnerable to an out-of-bounds heap read/write vulnerability that allows remote attackers to execute arbitrary code as root on affected Samba installations that use the VFS module vfs_fruit.

Associated CVE IDCVE-2021-44142
DescriptionOut-of-bounds heap read/write vulnerability in Samba’S VFS module
Associated ZDI ID
CVSS Score9.9 Critical
VectorCVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H/E:F/RL:O/RC:C
Impact Score
Exploitability Score
Attack Vector (AV)Network
Attack Complexity (AC)Low
Privilege Required (PR)Low
User Interaction (UI)None
ScopeChanged
Confidentiality (C)High
Integrity (I)High
availability (a)High

Summary Of CVE-2021-44141:

Associated CVE IDCVE-2021-44141
DescriptionInformation leak via symlinks of existance of files or directories outside of the exported share
Associated ZDI ID
CVSS Score4.2 Medium
VectorCVSS:AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N/E:P/RL:O/RC:C/CR:L/IR:L/AR:L/MAV:N/MAC:L/MPR:L/MUI:N/MS:U/MC:H/MI:N/MA:N
Impact Score
Exploitability Score
Attack Vector (AV)Network
Attack Complexity (AC)Low
Privilege Required (PR)Low
User Interaction (UI)None
ScopeUnchanged
Confidentiality (C)High
Integrity (I)None
availability (a)None

Summary Of CVE-2022-0336:

Associated CVE IDCVE-2022-0336
DescriptionSamba AD users with permission to write to an account can impersonate arbitrary services.
Associated ZDI ID
CVSS Score3.1 Low
VectorCVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Impact Score
Exploitability Score
Attack Vector (AV)Network
Attack Complexity (AC)Low
Privilege Required (PR)Low
User Interaction (UI)None
ScopeChanged
Confidentiality (C)High
Integrity (I)High
availability (a)High

Samba Versions Affected To The Vulnerabilities:

his table helps you learn versions affected by the respective vulnerabilities.

VulnerabilitySeverityAffected Samba Versions
CVE-2021-441419.9 CriticalVersions Prior to 4.15.5
CVE-2021-441424.2 MediumVersions Prior to 4.13.17
CVE-2022-03363.1 LowVersions 4.0.0 and Later

Operating Systems Affected By The Samba Out-Of-Bounds Write Vulnerability:

The most popular Linux distributions RedHat, SUSE, and Ubuntu are affected by the vulnerabilities. All the Distributors have released security updates to fix the vulnerabilities. Please visit their website for more information.

How to Fix the Out-of-Bounds Write Vulnerability In Samba vfs_fruit Module (CVE-2021-44142)?

Samba has fixed all three vulnerabilities in their latest versions 4.13.17, 4.14.12, and 4.15.5. Samba users are urged to update to the recommended versions to fix the vulnerabilities. 


However, there is a workaround for those who can’t immoderately apply the patch. You just need to remove ‘fruit’ VFS module from the list of configured VFS objects in any “vfs objects” line in the Samba configuration smb.conf. 


Please visit the respective Linux distribution website or contact support.

How To Fix The Samba vfs_fruit Vulnerability?

Step 1. Check the Samba version on Linux

$ sudo smbstatus
OR
$ sudo smbd -V
OR
$ sudo smbd –version

Step 2. Add Samba PPA to your system

Use this PPA repo to upgrade or install Samba on Ubuntu Linux.


$ sudo add-apt-repository ppa:linux-schools/samba-latest

Step 3. Update repository

$ sudo apt-get update

Step 4. Upgrade or Install Samba from PPA

$ sudo apt install samba
OR
$ sudo apt install samba

Step 5. Check the Samba version on Linux upon upgrade

$ sudo smbstatus
OR
$ sudo smbd -V
OR
$ sudo smbd –version

We hope this post helps you know How to Fix the Out-of-Bounds Write Vulnerability In Samba vfs_fruit Module (CVE-2021-44142) along with the other two CVE-2021-44141 and CVE-2022-0336 vulnerabilities in Linus machines. Thanks for reading this threat post. Please share this post and help to secure the digital world. Visit our social media page on FacebookLinkedInTwitterTelegramTumblr, & Medium and subscribe to receive updates like this. 

Arun KL

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.

Recently added

Application Security

View All

Learn More About Cyber Security Security & Technology

“Knowledge Arsenal: Empowering Your Security Journey through Continuous Learning”

Cybersecurity All-in-One For Dummies - 1st Edition

"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.

Tools

Featured

View All

Learn Something New with Free Email subscription

Subscribe

Subscribe