Ubuntu 20.04 LTS / 22.04 LTS / 23.04 : Samba vulnerabilities (USN-6425-1)

medium Nessus Plugin ID 182845

Synopsis

The remote Ubuntu host is missing one or more security updates.

Description

The remote Ubuntu 20.04 LTS / 22.04 LTS / 23.04 host has packages installed that are affected by multiple vulnerabilities as referenced in the USN-6425-1 advisory.

- The SMB protocol allows opening files where the client requests read-only access, but then implicitly truncating the opened file if the client specifies a separate OVERWRITE create disposition. This operation requires write access to the file, and in the default Samba configuration the operating system kernel will deny access to open a read-only file for read/write (which the truncate operation requires). However, when Samba has been configured to ignore kernel file system permissions, Samba will truncate a file when the underlying operating system kernel would deny the operation. Affected Samba configurations are the ones where kernel file-system permission checks are bypassed, relying on Samba's own permission enforcement.
The error is that this check is done against the client request for read-only access, and not the implicitly requested read-write (for truncate) one. The widely used Samba VFS module acl_xattr when configured with the module configuration parameter acl_xattr:ignore system acls = yes is the only upstream Samba module that allows this behavior and is the only known method of reproducing this security flaw. If (as is the default) the module configuration parameter acl_xattr:ignore system acls=no, then the Samba server is not vulnerable to this attack. (CVE-2023-4091)

- In normal operation, passwords and (most) secrets are never disclosed over LDAP in Active Directory.
However, due to a design flaw in Samba's implementation of the DirSync control, Active Directory accounts authorized to do some replication, but not to replicate sensitive attributes, can instead replicate critical domain passwords and secrets. In a default installation, this means that RODC DC accounts (which should only be permitted to replicate some passwords) can instead obtain all domain secrets, including the core AD secret: the krbtgt password. RODCs are given this permission as part of their installation for DRS replication. This vulnerability removes the RODC / DC distinction. Secondly, and just as problematically, the access check for this functionality did not account for error conditions - errors like out of memory were regarded as success. This is sometimes described as fail open. In these error conditions, some of which (eg out of memory) may be influenced by a low-privileged attacker, access to the secret attributes could be obtained! (CVE-2023-4154)

- Samba developers have built a non-Windows RPC server known as rpcecho to test elements of the Samba DCE/RPC stack under their full control. One RPC function provided by rpcecho can block, essentially indefinitely, and because the rpcecho service is provided from the main RPC task, which has only one worker, this denies essentially all service on the AD DC. To address this problem, the rpcecho server is removed from our production binaries and is restricted to selftest builds only. (CVE-2023-42669)

- Samba as an Active Directory DC operates RPC services from two distinct parts of the codebase. Those services focused on the AD DC are started in the main samba process, while services focused on the fileserver and NT4-like DC are started from the new samba-dcerpcd, which is launched on-demand from the fileserver (smbd) tasks. When starting, samba-dcerpcd must first confirm which services not to provide, so as to avoid duplicate listeners. The issue in this advisory is that, when Samba's RPC server is under load, or otherwise not responding, the servers NOT built for the AD DC (eg build instead for the NT4-emulation classic DCs) can be incorrectly started, and compete to listen on the same unix domain sockets. This then results in some queries being answered by the AD DC, and some not. This has been seen in production at multiple sites, as The procedure number is out of range when starting Active Directory Users and Computers tool, however it can also be triggered maliciously, to prevent service on the AD DC.
(CVE-2023-42670)

Note that Nessus has not tested for these issues but has instead relied only on the application's self-reported version number.

Solution

Update the affected packages.

See Also

https://ubuntu.com/security/notices/USN-6425-1

Plugin Details

Severity: Medium

ID: 182845

File Name: ubuntu_USN-6425-1.nasl

Version: 1.6

Type: local

Agent: unix

Published: 10/10/2023

Updated: 11/16/2023

Supported Sensors: Frictionless Assessment AWS, Frictionless Assessment Azure, Frictionless Assessment Agent, Nessus Agent, Agentless Assessment, Nessus

Risk Information

VPR

Risk Factor: Medium

Score: 4.4

CVSS v2

Risk Factor: Medium

Base Score: 6.8

Temporal Score: 5

Vector: CVSS2#AV:N/AC:L/Au:S/C:C/I:N/A:N

CVSS Score Source: CVE-2023-4154

CVSS v3

Risk Factor: Medium

Base Score: 6.5

Temporal Score: 5.7

Vector: CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N

Temporal Vector: CVSS:3.0/E:U/RL:O/RC:C

Vulnerability Information

CPE: cpe:/o:canonical:ubuntu_linux:22.04:-:lts, p-cpe:/a:canonical:ubuntu_linux:libldb-dev, p-cpe:/a:canonical:ubuntu_linux:python3-samba, p-cpe:/a:canonical:ubuntu_linux:samba-ad-dc, p-cpe:/a:canonical:ubuntu_linux:libsmbclient, p-cpe:/a:canonical:ubuntu_linux:libsmbclient-dev, p-cpe:/a:canonical:ubuntu_linux:registry-tools, p-cpe:/a:canonical:ubuntu_linux:smbclient, cpe:/o:canonical:ubuntu_linux:23.04, p-cpe:/a:canonical:ubuntu_linux:winbind, p-cpe:/a:canonical:ubuntu_linux:libnss-winbind, p-cpe:/a:canonical:ubuntu_linux:python3-ldb, p-cpe:/a:canonical:ubuntu_linux:libldb2, p-cpe:/a:canonical:ubuntu_linux:libwbclient-dev, p-cpe:/a:canonical:ubuntu_linux:samba-vfs-modules, p-cpe:/a:canonical:ubuntu_linux:ldb-tools, p-cpe:/a:canonical:ubuntu_linux:samba-testsuite, p-cpe:/a:canonical:ubuntu_linux:samba-common, p-cpe:/a:canonical:ubuntu_linux:samba-common-bin, p-cpe:/a:canonical:ubuntu_linux:libwbclient0, p-cpe:/a:canonical:ubuntu_linux:ctdb, p-cpe:/a:canonical:ubuntu_linux:libpam-winbind, p-cpe:/a:canonical:ubuntu_linux:samba, p-cpe:/a:canonical:ubuntu_linux:samba-ad-provision, p-cpe:/a:canonical:ubuntu_linux:samba-dev, p-cpe:/a:canonical:ubuntu_linux:samba-libs, p-cpe:/a:canonical:ubuntu_linux:python3-ldb-dev, p-cpe:/a:canonical:ubuntu_linux:samba-dsdb-modules, cpe:/o:canonical:ubuntu_linux:20.04:-:lts

Required KB Items: Host/cpu, Host/Debian/dpkg-l, Host/Ubuntu, Host/Ubuntu/release

Exploit Ease: No known exploits are available

Patch Publication Date: 10/10/2023

Vulnerability Publication Date: 10/10/2023

Reference Information

CVE: CVE-2023-4091, CVE-2023-4154, CVE-2023-42669, CVE-2023-42670

IAVA: 2023-A-0535

USN: 6425-1