Samba File Truncation Vulnerability: CVE-2023-4091

samba Updated 02 Oct 2025

Summary

03/11/2023
N/A
Yes i
Medium
6.5

ALPINE-CVE-2023-4091: A vulnerability was discovered in Samba, where the flaw allows SMB clients to truncate files, even with read-only permissions when the Samba VFS module "acl_xattr" is configured with "acl_xattr:ignore system acls = yes". Affects samba versions < 4.18.8-r0. Fixed in 4.18.8-r0. How to fix ↓

Free scan

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.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

Samba is an open-source software suite that provides seamless file and print services to SMB/CIFS clients. It allows for interoperability between Linux/Unix servers and Windows-based clients. Samba is widely used for sharing files and printers across different operating systems. However, it has been found to have a critical vulnerability that can lead to unintended file truncation, affecting data integrity and security.

Vulnerability Detail

A vulnerability was discovered in Samba, where SMB clients can truncate files even with read-only permissions. This occurs when the Samba VFS module 'acl_xattr' is configured with 'acl_xattr:ignore system acls = yes'. The flaw allows clients to open files with read-only access but then truncate them to 0 bytes if a separate OVERWRITE create disposition request is specified. This issue arises in configurations that bypass kernel file system permissions checks, relying solely on Samba's permissions, potentially leading to data loss and unauthorized modifications.

How To Fix

Minimum fixed version

4.18.8-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

As a temporary workaround, you can disable the 'acl_xattr:ignore system acls' configuration in your Samba settings. This will enforce stricter permission checks and prevent unauthorized file truncation. Modify your Samba configuration file (usually located at /etc/samba/smb.conf) and ensure the following line is set to 'no':

acl_xattr:ignore system acls = no

Conclusion

The Samba vulnerability CVE-2023-4091 poses a significant risk by allowing file truncation under specific configurations. It is crucial to update to the patched version to mitigate this risk and ensure data integrity. Additionally, implementing the suggested workaround can provide immediate relief until the update is applied.

See every vulnerability recorded for samba →

Share this vulnerability

FAQ

CVE-2023-4091 is a vulnerability in Samba that allows SMB clients to truncate files with read-only permissions under certain configurations.

This vulnerability can lead to data loss as it allows unauthorized truncation of files, potentially compromising data integrity.

Samba versions prior to 4.18.8-r0 on Alpine Linux are affected by this vulnerability.

Yes, the patch is available in Samba version 4.18.8-r0 and later. Updating to this version will resolve the issue.

You can use Vulert, which monitors and alerts for open-source vulnerabilities in real-time. Visit Vulert Scanner to check if your application is affected without needing to sign up.

Related vulnerabilities

Recent vulnerabilities recorded for samba.

How To Fix

Minimum fixed version

4.18.8-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 →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback