Out-of-Bounds Memory Write in Samba's libldb
Summary
CVE-2021-20277: A flaw was found in Samba's libldb. Affects samba across 2 version ranges.
< 4.12.14-r0
>= df33344d8eb40221d60c99931690703a11d91bc2, < bb2f64babf1a2bfb780d0325e859f796d0ce1647
Fixed in 4.12.14-r0. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
Samba is an open-source software suite that provides file and print services for various operating systems, including Windows. It includes the libldb library, which is used for LDAP (Lightweight Directory Access Protocol) operations. LDAP attributes are key-value pairs used to store information in directory services. However, a vulnerability has been discovered in Samba's libldb that allows for an out-of-bounds memory write when multiple consecutive leading spaces are present in an LDAP attribute. This flaw can lead to a crash of the LDAP server process handling the request, impacting system availability.
Vulnerability Detail
The vulnerability (CVE-2021-20277) originates from a lack of proper input validation in Samba's libldb. When an LDAP attribute contains multiple consecutive leading spaces, it triggers an out-of-bounds memory write. An attacker can exploit this by sending a specially crafted LDAP request, causing the LDAP server process to crash. The highest threat from this vulnerability is to system availability, as it can lead to denial of service. The CVSS score for this vulnerability is 7.5 (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H).
How To Fix
Minimum fixed version
4.12.14-r0
This is the first release that contains the fix.
sudo apk add --upgrade samba
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
There is no known workaround for this vulnerability. It is recommended to apply the fix by updating the Samba package to a version that includes the fix.
Conclusion
In conclusion, the out-of-bounds memory write vulnerability in Samba's libldb can be exploited by sending a specially crafted LDAP request. This can lead to a crash of the LDAP server process and impact system availability. It is recommended to update the Samba package to a fixed version to mitigate this vulnerability. For further support on vulnerability remediation, you can contact DevNack.com.
See every vulnerability recorded for samba →
FAQ
Samba is an open-source software suite that provides file and print services for various operating systems, including Windows.
libldb is a library used by Samba for LDAP (Lightweight Directory Access Protocol) operations.
An LDAP attribute is a key-value pair used to store information in directory services.
An attacker can exploit this vulnerability by sending a specially crafted LDAP request containing multiple consecutive leading spaces in an attribute value.
The vulnerability can lead to a crash of the LDAP server process handling the request, resulting in denial of service.
Related vulnerabilities
Recent vulnerabilities recorded for samba.