{"record":{"id":"16b2d98d6e93142e","repo":"astrid-runtime/astrid","slug":"winfsp-service-mountpoint-is-public-or-overlaps-th","errorCode":null,"errorMessage":"WinFsp service mountpoint is public or overlaps the lease resource","messagePattern":"WinFsp service mountpoint is public or overlaps the lease resource","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/astrid-storage-provider-winfsp/src/win.rs","lineNumber":304,"sourceCode":"        serde_json::from_slice(&manifest).context(\"decode WinFsp lease manifest\")?;\n    if admitted != *lease {\n        bail!(\"WinFsp launch lease does not match the kernel manifest\");\n    }\n    if !launch.mountpoint.is_absolute()\n        || launch\n            .mountpoint\n            .components()\n            .any(|component| matches!(component, std::path::Component::ParentDir))\n    {\n        bail!(\"WinFsp service mountpoint is malformed\");\n    }\n    if is_public_mountpoint(&launch.mountpoint)\n        || launch.mountpoint.parent().is_none()\n        || launch.mountpoint == lease.resource_path\n        || launch.mountpoint.starts_with(&lease.resource_path)\n        || lease.resource_path.starts_with(&launch.mountpoint)\n    {\n        bail!(\"WinFsp service mountpoint is public or overlaps the lease resource\");\n    }\n    platform_fs::validate_private_directory(&launch.mountpoint)\n        .context(\"validate private WinFsp mountpoint\")?;\n    platform_fs::verify_no_redirects(&launch.mountpoint)\n        .context(\"reject redirected WinFsp mountpoint\")?;\n    if std::fs::read_dir(&launch.mountpoint)?.next().is_some() {\n        bail!(\"WinFsp service mountpoint is not empty\");\n    }\n    if !launch.control_path.is_absolute()\n        || launch\n            .control_path\n            .components()\n            .any(|component| matches!(component, std::path::Component::ParentDir))\n        || launch.control_path != lease.resource_path.join(\"process-control.sock\")\n    {\n        bail!(\"WinFsp service control path is malformed\");\n    }\n    let control_parent = launch","sourceCodeStart":286,"sourceCodeEnd":322,"githubUrl":"https://github.com/astrid-runtime/astrid/blob/affd8760f44190dbdfbec23403f4c4b642c33112/crates/astrid-storage-provider-winfsp/src/win.rs#L286-L322","documentation":"The mountpoint must be a private location that does not collide with anything sensitive. This error fires if the mountpoint is a public/well-known location (is_public_mountpoint), has no parent (a drive root), equals the lease resource_path, or nests inside it / contains it. Mounting into a public location or overlapping the provider's own private lease directory would expose or corrupt private state, so the launch is rejected.","triggerScenarios":"service_main -> validate_service_launch when is_public_mountpoint(&launch.mountpoint) is true, or mountpoint.parent() is None (e.g. \"C:\\\"), or mountpoint == lease.resource_path, or either path starts_with the other (ancestor/descendant overlap).","commonSituations":"Users configuring a mount at a drive root or a shared/public folder (C:\\Public, Desktop) for convenience; pointing the mountpoint at the provider's own state directory by copy-paste; deriving mountpoint from resource_path with a typo; relocation logic that nests mounts under the lease directory.","solutions":["Choose a dedicated private mountpoint directory (e.g. under the user's private app-data area) that is not a drive root, public folder, or inside the lease resource_path.","Keep resource_path and mountpoint in disjoint directory trees; assert non-overlap in the launcher before spawning.","If users pass custom mountpoints, validate them in your UI/config layer against is_public_mountpoint and the resource_path before launch.","Copy-paste check: ensure mountpoint was not accidentally set to (or derived from) lease.resource_path."],"exampleFix":"// before\nmountpoint: lease.resource_path.clone(),\n// after\nmountpoint: private_area.join(\"mounts\").join(&mount_id), // disjoint from resource_path","handlingStrategy":"validation","validationCode":"let mp = dunce::canonicalize(&mountpoint)?;\nlet rp = dunce::canonicalize(&lease.resource_path)?;\nif is_public_mountpoint(&mp)\n    || mp.parent().is_none()\n    || mp == rp\n    || mp.starts_with(&rp)\n    || rp.starts_with(&mp)\n{\n    return Err(anyhow!(\"choose a private mountpoint disjoint from the lease resource_path\"));\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Default mountpoints to a per-mount private directory named by mount_id","Never point mounts at drive roots, public folders, or the provider's own state tree","Enforce non-overlap of resource_path and mountpoint in the launcher","Screen user-supplied mountpoints with is_public_mountpoint in your config/UI layer"],"tags":["winfsp","mountpoint","security","validation"],"backgroundTag":"invalid-config-value","analyzedSha":"affd8760f44190dbdfbec23403f4c4b642c33112","analyzedAt":"2026-09-09T21:28:12.402Z","contentChangedAt":"2026-09-09T21:28:12.402Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}