{"record":{"id":"617c402aadb3d52c","repo":"astrid-runtime/astrid","slug":"fuse-lease-manifest-exceeds-the-bounded-size","errorCode":null,"errorMessage":"FUSE lease manifest exceeds the bounded size","messagePattern":"FUSE lease manifest exceeds the bounded size","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/astrid-storage-provider-fuse/src/service.rs","lineNumber":233,"sourceCode":"    if lease.expires_at_epoch_secs < now {\n        bail!(\"FUSE lease is expired\");\n    }\n    if !lease.resource_path.is_absolute() || !lease.callback_path.is_absolute() {\n        bail!(\"FUSE lease paths must be absolute\");\n    }\n    if lease.callback_path != lease.resource_path.join(\"control.sock\") {\n        bail!(\"FUSE callback path is not the kernel lease endpoint\");\n    }\n    platform_fs::validate_private_directory(&lease.resource_path)\n        .context(\"validate private FUSE lease resource\")?;\n    platform_fs::verify_no_redirects(&lease.resource_path)\n        .context(\"reject redirected FUSE lease resource\")?;\n    let manifest_path = lease.resource_path.join(\"lease.json\");\n    platform_fs::validate_private_file(&manifest_path)\n        .context(\"validate private FUSE lease manifest\")?;\n    let manifest = std::fs::read(&manifest_path).context(\"read FUSE lease manifest\")?;\n    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    }","sourceCodeStart":215,"sourceCodeEnd":251,"githubUrl":"https://github.com/astrid-runtime/astrid/blob/affd8760f44190dbdfbec23403f4c4b642c33112/crates/astrid-storage-provider-fuse/src/service.rs#L215-L251","documentation":"validate_lease reads the lease.json manifest from the FUSE lease resource directory and enforces a hard 64 KiB size cap before deserializing it into StorageMountLeaseV1. The library throws this to avoid allocating unbounded memory on a hostile or corrupted manifest file. It is a security bound, not a format error: the file exists and is readable but is simply too large to be a legitimate kernel-issued lease manifest.","triggerScenarios":"Calling validate_launch when the lease.json file under lease.resource_path is larger than 64 * 1024 bytes (65536 bytes) at the moment of validation.","commonSituations":"A stale or corrupted lease.json left behind by a crashed previous launch; a user or misconfigured kernel writing extra metadata into the manifest; an attacker tampering with the private lease directory; accidental duplication of manifest content by tooling that merges JSON files.","solutions":["Delete the oversized lease.json and re-run the launch so the kernel regenerates a fresh, correctly sized manifest","Inspect lease.json for unexpected or duplicated content (e.g. embedded blobs, concatenated JSON) and remove whatever inflated it","Ensure nothing else writes into the lease resource_path directory; it must be managed exclusively by the kernel","Check permissions so unprivileged processes cannot modify files under resource_path"],"exampleFix":"// before: manually editing/merging into lease.json grew it past 64 KiB\ncat extra-metadata.json >> leases/abc/lease.json\n\n// after: never hand-edit the manifest; regenerate it\nrm leases/abc/lease.json\n# re-run the launch so the kernel writes a fresh manifest","handlingStrategy":"validation","validationCode":"let md = std::fs::metadata(manifest_path)?;\nif md.len() > 64 * 1024 { /* regenerate manifest before launch */ }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never hand-edit or append to lease.json","Regenerate the manifest from the kernel after any launch failure","Restrict write access to the lease resource directory"],"tags":["fuse","file-size-limit","lease-manifest","security-bound"],"backgroundTag":"file-size-limit-exceeded","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"}