{"record":{"id":"64f251eefb6b6775","repo":"rustdesk/rustdesk","slug":"invalid-file-name-component","errorCode":null,"errorMessage":"invalid file name component","messagePattern":"invalid file name component","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"libs/base/src/fs.rs","lineNumber":552,"sourceCode":"                        if meta.file_type().is_symlink() {\n                            bail!(\"symlink path component is not allowed\");\n                        }\n                    }\n                    Err(err) if err.kind() == std::io::ErrorKind::NotFound => {\n                        // Component does not exist yet, continue best-effort validation.\n                    }\n                    Err(err) => {\n                        bail!(\n                            \"failed to validate path component '{}': {}\",\n                            current.display(),\n                            err\n                        );\n                    }\n                }\n            }\n            std::path::Component::CurDir => {}\n            _ => {\n                bail!(\"invalid file name component\");\n            }\n        }\n    }\n    Ok(())\n}\n\n/// Validate an untrusted relative file name and existing path components before joining it.\npub fn join_validated_path(base: &PathBuf, name: &str) -> ResultType<PathBuf> {\n    validate_file_name_no_traversal(name)?;\n    validate_no_symlink_components(base, name)?;\n    Ok(TransferJob::join(base, name))\n}\n\nimpl TransferJob {\n    #[allow(clippy::too_many_arguments)]\n    pub fn new_write(\n        id: i32,\n        r#type: JobType,","sourceCodeStart":534,"sourceCodeEnd":570,"githubUrl":"https://github.com/rustdesk/rustdesk/blob/91c9fccbb0f7bfe5f11644d5fbdec9b23fa10540/libs/base/src/fs.rs#L534-L570","documentation":"Generic guard in validate_no_symlink_components's component loop: a path component of the relative name is not a Normal component (e.g. it is a RootDir, Prefix, ParentDir, or CurDir). Since the function only accepts plain normal segments joined under the base, any such component means the name is not a simple relative path and is rejected. The input at fault is the relative name containing a non-normal path component.","triggerScenarios":"Thrown at libs/base/src/fs.rs:552 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Send only plain relative file names without '.', '..', roots, or Windows prefixes","Normalize the path client-side and strip leading separators before submitting","Reject the request that carried the malformed name"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"91c9fccbb0f7bfe5f11644d5fbdec9b23fa10540","analyzedAt":"2026-09-10T19:53:44.083Z","contentChangedAt":"2026-09-10T19:53:44.083Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}