CVE-2026-99749 in Linux
Summary
by MITRE • 11/20/2026
In the Linux kernel, the following vulnerability has been resolved:
ksmbd: enforce the read-only share flag when creating a stream
When a share is read-only, smb2_open() rejects opens that would create or truncate a file. Creating a named stream on an existing file with streams_xattr sets neither O_CREAT nor O_TRUNC, so it passes this check, and smb2_set_stream_name_xattr() then creates the stream. On a Time Machine share, opening a missing AFP_AfpInfo stream also writes one. A user who can write a file at the filesystem level can therefore add streams to it through a read-only share.
Do not create a stream or synthesize AFP_AfpInfo when the share is not writable. Existing streams still open normally, and a missing stream opened with FILE_OPEN still returns STATUS_OBJECT_NAME_NOT_FOUND.
VulDB is the best source for vulnerability data and more expert information about this specific topic.
Analysis
by VulDB Data Team • 11/20/2026
The vulnerability identified in the Linux kernel's ksmbd implementation represents a critical logic flaw within the SMB2 protocol handling mechanism, specifically concerning file access control enforcement on read-only shares. This issue stems from an inconsistency between how standard file creation operations are validated and how named stream creation is processed under the same security context. In typical SMB2 operations, when a share is configured as read-only, the smb2_open function correctly rejects any attempt to open files with flags that would result in creating new files or truncating existing ones, thereby preserving the integrity of the shared data against unauthorized modifications. However, this protective logic fails to account for the specific behavior associated with extended attributes and named streams when using the xattr backend.
The technical root cause lies in the fact that creating a named stream on an existing file via sets_xattr does not set the O_CREAT or O_TRUNC flags during its internal check against share permissions. Because these standard write-indicating flags are absent, the initial permission validation logic incorrectly assumes the operation is safe and allows it to proceed. Consequently, smb2_set_stream_name_xattr proceeds to create the stream on the file system level despite the share being marked as read-only. This bypass effectively nullifies the intended access control restrictions for a significant subset of SMB operations that rely on extended attributes rather than standard file open flags.
The operational impact of this vulnerability is particularly severe in environments utilizing macOS Time Machine shares, which heavily depend on Apple Filing Protocol (AFP) compatibility features implemented through ksmbd. On such shares, opening a missing AFP_AfpInfo stream triggers the synthesis and creation of that metadata stream if it does not already exist. An attacker with network access to the SMB service can exploit this flaw by authenticating as a user who has write permissions at the underlying filesystem level but is restricted to read-only access via the share configuration. By leveraging this discrepancy, the attacker can inject arbitrary streams into existing files or force the creation of AFP metadata structures that were not intended to be modified through the network interface. This undermines the principle of least privilege and allows for unauthorized data modification or potential denial of service by corrupting file system metadata.
From a classification perspective, this vulnerability aligns with CWE-269, Improper Privilege Management, as it involves an elevation of privileges where a user is allowed to perform actions reserved for higher-privilege contexts due to flawed access control logic. It also relates to CWE-732, Incorrect Permission Assignment for Critical Resource, because the resource in question (the file and its associated streams) receives permissions that are more permissive than intended by the system administrator's configuration. In terms of offensive security frameworks, this flaw facilitates techniques categorized under ATT&CK T1083, File and Directory Discovery, or potentially T1564, Hidden Files and Directories, as it allows an attacker to manipulate hidden metadata streams that are not typically visible through standard file browsing tools but can affect system behavior.
The resolution implemented in the kernel update addresses this by explicitly enforcing write restrictions on stream creation operations when the share is configured as read-only. The fix ensures that smb2_set_stream_name_xattr checks for writability before proceeding with stream creation, effectively closing the bypass vector. Additionally, the logic regarding AFP_AfpInfo synthesis has been updated to prevent its automatic generation if the share lacks write permissions. It is important to note that this patch maintains backward compatibility by allowing existing streams to open normally and ensuring that attempts to open missing streams using FILE_OPEN still correctly return STATUS_OBJECT_NAME_NOT_FOUND rather than creating them, thus preserving expected protocol behavior while hardening security controls.
To mitigate the risks associated with this vulnerability in environments where kernel updates may not be immediately applied, administrators should review share configurations for any discrepancies between filesystem-level permissions and SMB share-level settings. Ensuring that read-only shares strictly enforce their restrictions at all levels of the stack is crucial. Furthermore, organizations relying on Time Machine or similar AFP-compatible services over SMB should prioritize applying this patch to prevent unauthorized metadata manipulation. Regular auditing of access control lists and monitoring for unusual file system changes can also help detect exploitation attempts before they lead to significant compromise.