{"record":{"id":"135fd09d960e2fd6","repo":"astrid-runtime/astrid","slug":"fuse-service-mountpoint-is-malformed","errorCode":null,"errorMessage":"FUSE service mountpoint is malformed","messagePattern":"FUSE service mountpoint is malformed","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/astrid-storage-provider-fuse/src/service.rs","lineNumber":250,"sourceCode":"    if manifest.len() > 64 * 1024 {\n        bail!(\"FUSE lease manifest exceeds the bounded size\");\n    }\n    let admitted: StorageMountLeaseV1 =\n        serde_json::from_slice(&manifest).context(\"decode FUSE lease manifest\")?;\n    if admitted != *lease {\n        bail!(\"FUSE launch lease does not match the kernel manifest\");\n    }\n    Ok(())\n}\n\nfn validate_mountpoint(mountpoint: &Path, resource_path: &Path) -> Result<()> {\n    if !mountpoint.is_absolute()\n        || mountpoint\n            .components()\n            .any(|component| matches!(component, std::path::Component::ParentDir))\n        || mountpoint.parent().is_none()\n    {\n        bail!(\"FUSE service mountpoint is malformed\");\n    }\n    if mountpoint == resource_path\n        || mountpoint.starts_with(resource_path)\n        || resource_path.starts_with(mountpoint)\n    {\n        bail!(\"FUSE service mountpoint overlaps the lease resource\");\n    }\n    platform_fs::validate_private_directory(mountpoint)\n        .context(\"validate private FUSE service mountpoint\")?;\n    platform_fs::verify_no_redirects(mountpoint)\n        .context(\"reject redirected FUSE service mountpoint\")?;\n    if std::fs::read_dir(mountpoint)?.next().is_some() {\n        bail!(\"FUSE service mountpoint is not empty\");\n    }\n    if mountpoint::mountinfo_contains(mountpoint)? {\n        bail!(\"FUSE service mountpoint is already mounted\");\n    }\n    Ok(())","sourceCodeStart":232,"sourceCodeEnd":268,"githubUrl":"https://github.com/astrid-runtime/astrid/blob/affd8760f44190dbdfbec23403f4c4b642c33112/crates/astrid-storage-provider-fuse/src/service.rs#L232-L268","documentation":"validate_mountpoint checks that the requested mountpoint is an absolute path, contains no ParentDir (\"..\") components, and has a parent directory. If any of these path-safety conditions fail, the launch is rejected because a relative or traversal-containing mountpoint cannot be safely resolved inside the private mount namespace.","triggerScenarios":"Calling validate_launch with a lease/service mountpoint that is relative, contains a \"..\" component, or has no parent (e.g. \"/\").","commonSituations":"Configuration substituting a relative path or environment-variable placeholder that expands with \"..\"; programmatic path joining producing \"a/../b\" style paths; passing the filesystem root; typos like a leading missing slash in config files.","solutions":["Make the mountpoint an absolute path (e.g. /run/astrid/mounts/<resource>) before calling validate_launch","Normalize the path and remove any \"..\" components (use std::path::absolute / components-based normalization) prior to launch","Never mount at \"/\" or another parentless path; pick a dedicated subdirectory","Fix the config/env source of the mountpoint so it cannot contain relative segments"],"exampleFix":"// before\nlet mountpoint = \"../run/mount\";\n\n// after\nlet mountpoint = std::path::absolute(\"/run/astrid/mounts/demo\")?;","handlingStrategy":"validation","validationCode":"let p = std::path::absolute(mountpoint)?;\nassert!(p.is_absolute());\nassert!(!p.components().any(|c| matches!(c, std::path::Component::ParentDir)));\nassert!(p.parent().is_some());","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always normalize to absolute paths before configuring mountpoints","Reject \"..\" in any user-supplied path config","Never use \"/\" as a mountpoint"],"tags":["fuse","path-validation","path-traversal","mountpoint"],"backgroundTag":"invalid-argument-format","analyzedSha":"affd8760f44190dbdfbec23403f4c4b642c33112","analyzedAt":"2026-09-09T21:28:12.402Z","contentChangedAt":"2026-09-09T21:28:12.402Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}