{"record":{"id":"0c4bc47f1e3d80ac","repo":"shadow1ng/fscan","slug":"s-invalid-file-type","errorCode":null,"errorMessage":"%s [invalid_file_type]","messagePattern":"(.+?) \\[invalid_file_type\\]","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"plugins/local/ldpreload.go","lineNumber":76,"sourceCode":"\t}\n\n\t// 检查目标文件是否存在\n\tif _, err := os.Stat(targetFile); os.IsNotExist(err) {\n\t\toutput.WriteString(i18n.Tr(\"target_file_not_exist\", targetFile) + \"\\n\")\n\t\treturn &plugins.Result{\n\t\t\tSuccess: false,\n\t\t\tOutput:  output.String(),\n\t\t\tError:   err,\n\t\t}\n\t}\n\n\t// 检查文件类型\n\tif !p.isValidFile(targetFile) {\n\t\toutput.WriteString(i18n.Tr(\"ldpreload_so_required\", targetFile) + \"\\n\")\n\t\treturn &plugins.Result{\n\t\t\tSuccess: false,\n\t\t\tOutput:  output.String(),\n\t\t\tError:   fmt.Errorf(\"%s\", i18n.GetText(\"invalid_file_type\")),\n\t\t}\n\t}\n\n\toutput.WriteString(i18n.GetText(\"ldpreload_header\") + \"\\n\")\n\toutput.WriteString(i18n.Tr(\"local_target_file\", targetFile) + \"\\n\")\n\toutput.WriteString(i18n.Tr(\"local_platform\", runtime.GOOS) + \"\\n\\n\")\n\n\tvar successCount int\n\n\t// 1. 复制文件到系统目录\n\tsystemPath, err := p.copyToSystemPath(targetFile)\n\tif err != nil {\n\t\toutput.WriteString(i18n.Tr(\"ldpreload_copy_system_failed\", err) + \"\\n\")\n\t} else {\n\t\toutput.WriteString(i18n.Tr(\"file_copied_to\", systemPath) + \"\\n\")\n\t\tsuccessCount++\n\t}\n","sourceCodeStart":58,"sourceCodeEnd":94,"githubUrl":"https://github.com/shadow1ng/fscan/blob/95cc12e753bf43de7004e5aef42a9ffba3934303/plugins/local/ldpreload.go#L58-L94","documentation":"File-type guard in ldpreload Scan: the configured target file exists but fails p.isValidFile, i.e. it is not a valid shared object (.so) file, so it cannot be used for LD_PRELOAD persistence. The plugin returns a failed Result carrying the i18n invalid_file_type message, with ldpreload_so_required printed to the output buffer.","triggerScenarios":"Thrown at plugins/local/ldpreload.go:76 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide a correctly built ELF shared library compiled for the target arch","Re-upload the payload if it was corrupted in transit","Verify with 'file' that the artifact is a shared object"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"95cc12e753bf43de7004e5aef42a9ffba3934303","analyzedAt":"2026-09-06T17:07:30.094Z","contentChangedAt":"2026-09-06T17:07:30.094Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}