{"record":{"id":"6cac8aebd1b2ff2c","repo":"peass-ng/PEASS-ng","slug":"value-cannot-be-null-parameter-name-path-6cac8a","errorCode":null,"errorMessage":"Value cannot be null.\r\nParameter name: path","messagePattern":"Value cannot be null\\.\r\nParameter name: path","errorType":"exception","errorClass":"ArgumentNullException","httpStatus":null,"severity":"error","filePath":"winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory.HasInheritedPermissions.cs","lineNumber":45,"sourceCode":"   public static partial class Directory\n   {\n      /// <summary>[AlphaFS] Checks if the directory has permission inheritance enabled.</summary>\n      /// <param name=\"path\">The full path to the directory to check.</param>\n      /// <returns><c>true</c> if permission inheritance is enabled, <c>false</c> if permission inheritance is disabled.</returns>\n      public static bool HasInheritedPermissions(string path)\n      {\n         return HasInheritedPermissions(path, PathFormat.RelativePath);\n      }\n\n\n      /// <summary>[AlphaFS] Checks if the directory has permission inheritance enabled.</summary>\n      /// <returns><c>true</c> if permission inheritance is enabled, <c>false</c> if permission inheritance is disabled.</returns>\n      /// <param name=\"path\">The full path to the directory to check.</param>\n      /// <param name=\"pathFormat\">Indicates the format of the path parameter(s).</param>\n      public static bool HasInheritedPermissions(string path, PathFormat pathFormat)\n      {\n         if (Utils.IsNullOrWhiteSpace(path))\n            throw new ArgumentNullException(\"path\");\n\n\n         var acl = File.GetAccessControlCore<DirectorySecurity>(true, path, AccessControlSections.Access | AccessControlSections.Group | AccessControlSections.Owner, pathFormat);\n\n         var rawBytes = acl.GetSecurityDescriptorBinaryForm();\n\n         var rsd = new RawSecurityDescriptor(rawBytes, 0);\n\n\n         // \"Include inheritable permissions from this object's parent\" is unchecked.\n         var inheritanceDisabled = (rsd.ControlFlags & ControlFlags.DiscretionaryAclProtected) == ControlFlags.DiscretionaryAclProtected;\n\n         return !inheritanceDisabled;\n      }\n   }\n}\n","sourceCodeStart":27,"sourceCodeEnd":62,"githubUrl":"https://github.com/peass-ng/PEASS-ng/blob/53fb989abc2219826385683a6fee826bd6cd38d6/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory.HasInheritedPermissions.cs#L27-L62","documentation":"An ArgumentNullException guard on the sole 'path' parameter: HasInheritedPermissions delegates to the overload with PathFormat.RelativePath, and the .NET argument validation rejects a null path before any filesystem access occurs. It fires only when the caller passes null instead of a directory path string.","triggerScenarios":"Thrown at winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory.HasInheritedPermissions.cs:45 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a non-null full path string to HasInheritedPermissions","Guard the call site: check string.IsNullOrWhiteSpace(path) before invoking and skip or report","Resolve paths from a verified source (e.g. Directory.EnumerateDirectories output) rather than possibly-null variables"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"53fb989abc2219826385683a6fee826bd6cd38d6","analyzedAt":"2026-09-02T04:25:09.259Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T11:17:12.671Z"}