Skip to content

$result accepts a file: URI in the file parameter, bypassing the per-job owner check #2985

Backlog

Description

@johngrimes

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):

final Path resolved = fs.makeQualified(new Path(new Path(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:

Request with carol's token Result
$result?job=<alice's job>&file=patients.00000.csv 403, "not owned by the current user 'carol'"
$result?job=<carol's job>&file=file:/<warehouse>/default/jobs/<alice's job>/patients.00000.csv 200, with the content of alice's file
$result?job=<carol's job>&file=file:/etc/passwd 404
$result?job=<carol's job>&file=../<alice's job>/patients.00000.csv 404

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

  1. added
    security
    server
    on Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    securityserver

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions