You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
$result accepts a file: URI in the file parameter, bypassing the per-job owner check #2985
JobDirectoryFileSystem.resolveFile checks that the resolved path lies inside the jobs directory, not inside the directory of the job named in the request (server/src/main/java/au/csiro/pathling/io/JobDirectoryFileSystem.java:127-128):
finalPathresolved = fs.makeQualified(newPath(newPath(qualifiedJobsDir, jobId), filename));
if (!hasPathPrefix(resolved.toString(), qualifiedJobsDir.toString())) {
rejectInvalidComponent (:275-286) blocks .. and a leading /, but not a value with a scheme. Hadoop resolves new Path(parent, "file:/abs/path") to the absolute path. $result checks ownership of the job in the job parameter and then opens whatever file resolves to (server/src/main/java/au/csiro/pathling/operations/bulkexport/ExportResultProvider.java:102-119), so a caller can pass the owner check with a job of their own and read a file from another job's directory.
Reproduced on a build of release/server/3.2.0 (f70763af29) with authorisation enabled. A user with the subject alice had a completed export job. A user with the subject carol had pathling:export and a job of her own:
The containment to the jobs directory added for GHSA-8w85-f63v-3wh6 holds. The caller needs the other job's identifier and file name, and the warehouse path.
Suggested changes:
Check containment against jobDirectory(jobId) rather than the jobs root.
Reject any file value that contains : or /.
Acceptance: the second request in the table returns 404, covered by a test in JobDirectoryFileSystemTest.
Activity