{"record":{"id":"be45f433b6b45ee9","repo":"apache/dolphinscheduler","slug":"invalid-resource-path-resourceabsolutepath","errorCode":null,"errorMessage":"Invalid resource path: ${resourceAbsolutePath}","messagePattern":"Invalid resource path: (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"dolphinscheduler-storage-plugin/dolphinscheduler-storage-api/src/main/java/org/apache/dolphinscheduler/plugin/storage/api/AbstractStorageOperator.java","lineNumber":45,"sourceCode":"import com.google.common.base.Preconditions;\nimport com.google.common.io.Files;\n\npublic abstract class AbstractStorageOperator implements StorageOperator {\n\n    protected final String resourceBaseAbsolutePath;\n\n    public AbstractStorageOperator(String resourceBaseAbsolutePath) {\n        Preconditions.checkNotNull(resourceBaseAbsolutePath, \"Resource upload path should not be null\");\n        this.resourceBaseAbsolutePath = resourceBaseAbsolutePath;\n    }\n\n    @Override\n    public ResourceMetadata getResourceMetaData(String resourceAbsolutePath) {\n        String storageBaseDirectory = getStorageBaseDirectory();\n        String resourceSegment = StringUtils.substringAfter(resourceAbsolutePath, storageBaseDirectory);\n        String[] segments = StringUtils.split(resourceSegment, File.separator, 3);\n        if (segments.length == 0) {\n            throw new IllegalArgumentException(\"Invalid resource path: \" + resourceAbsolutePath);\n        }\n        return ResourceMetadata.builder()\n                .resourceAbsolutePath(resourceAbsolutePath)\n                .resourceBaseDirectory(storageBaseDirectory)\n                .isDirectory(Files.getFileExtension(resourceAbsolutePath).isEmpty())\n                .tenant(segments[0])\n                .resourceType(ResourceType.FILE)\n                .resourceRelativePath(segments.length == 2 ? \"/\" : segments[2])\n                .resourceParentAbsolutePath(StringUtils.substringBeforeLast(resourceAbsolutePath, File.separator))\n                .build();\n    }\n\n    @Override\n    public String getStorageBaseDirectory() {\n        // All directory should end with File.separator\n        return resourceBaseAbsolutePath;\n    }\n","sourceCodeStart":27,"sourceCodeEnd":63,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-storage-plugin/dolphinscheduler-storage-api/src/main/java/org/apache/dolphinscheduler/plugin/storage/api/AbstractStorageOperator.java#L27-L63","documentation":"A path-safety guard in getResourceMetaData: the supplied resourceAbsolutePath failed the base-directory containment check (or empty check) — meaning the path does not start with the configured storage base directory, so metadata lookup is refused to prevent arbitrary path access. The faulty input is the resource absolute path; the message interpolates resourceAbsolutePath.","triggerScenarios":"Thrown at dolphinscheduler-storage-plugin/dolphinscheduler-storage-api/src/main/java/org/apache/dolphinscheduler/plugin/storage/api/AbstractStorageOperator.java:45 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Normalize the resource path and ensure it is constructed from getStorageBaseDirectory(tenantCode, resourceType)","Verify the resource upload path configuration matches the path stored in the resource records (a changed resource.storage.upload.base.path invalidates old paths)","Reject user-supplied paths containing '..' or leading '/' before they reach storage APIs"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"02eac45a1b6676e639fcbfb4be2243de5771b05d","analyzedAt":"2026-09-06T17:43:00.555Z","contentChangedAt":"2026-09-06T17:43:00.555Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}