The documented contract in the provided material does not explicitly state that OBJECT_ATTRIBUTES.SecurityDescriptor for NtCreateFile accepts only absolute security descriptors, only self-relative security descriptors, or both for user-mode directory creation.
Supported facts from the documentation are:
-
NtCreateFilehas aPSECURITY_DESCRIPTOR SecurityDescriptorparameter that optionally specifies a security descriptor to be applied to a file, and ACLs from that descriptor are applied only when the file is created. - If that value is
NULLwhen a file is created, the ACL placed on the file is file-system-dependent; most file systems propagate some part of the ACL from the parent directory combined with the caller's default ACL. - More generally for securable objects, when a security descriptor is supplied at creation time, it is assigned to the new object; if no security descriptor is supplied, the system uses inherited or default security information.
- For files and directories created through
CreateFile,CreateDirectory, orCreateDirectoryEx, specifyingNULLcauses a default security descriptor to be assigned, and the ACLs in that default descriptor are inherited from the parent directory.
On security-descriptor representation, the provided documentation states:
- A security descriptor can be in absolute or self-relative format.
- Except for
MakeAbsoluteSD, functions that return a security descriptor do so in self-relative format. - Security descriptors passed as arguments to a function can be either self-relative or absolute form, and the documentation for the specific function must be consulted for more information.
- Low-level functions for initializing and setting components of a security descriptor work only with absolute-format security descriptors.
That last point applies to the low-level security-descriptor construction APIs such as InitializeSecurityDescriptor and related setter functions. It does not establish the accepted representation for NtCreateFile's SecurityDescriptor parameter.
Therefore, from the provided documentation:
- The representation accepted by
NtCreateFileforOBJECT_ATTRIBUTES.SecurityDescriptoris not explicitly specified. - No supported Windows-version, filesystem, or
OBJ_DONT_REPARSEqualification for descriptor representation is established. - No explicit statement is provided here that object-relative creation through
RootDirectorychanges the accepted descriptor format. - No explicit statement is provided here that
OBJ_DONT_REPARSEchanges the accepted descriptor format.
On creation-time application versus intermediate default-DACL exposure, the documented contract does support this narrower conclusion:
- When a security descriptor is supplied during object creation, that descriptor is the one applied to the new object at creation.
- The default or inherited descriptor path is described for the case where no security descriptor is supplied (
NULL).
So the provided documentation supports that supplying a security descriptor at creation is the documented mechanism for applying the intended ACL at creation time rather than relying on the default descriptor path. However, it does not provide an explicit object-creation sequencing guarantee phrased as "no intermediate default-DACL exposure."
In short:
-
NtCreateFilecreation-time application of a supplied security descriptor: documented. - Exact accepted representation for
OBJECT_ATTRIBUTES.SecurityDescriptorin this call: not documented in the provided material. - Version/filesystem/
RootDirectory/OBJ_DONT_REPARSElimitations for descriptor representation: not documented in the provided material. - An official specification explicitly establishing absolute-only, self-relative-only, or both for this
NtCreateFilescenario: not present in the provided material.