Skip to content

Race condition when reading symlinks can expose unrelated parts of the file system in reverse mode #165

Closed
@slackner

Description

@slackner

Assume user A has access to a machine, and root has mounted an encrypted version of the user home directory with -allow_other. Further assume that the user knows the master key. By quickly exchanging directories with symlinks in the original data, it is possible trick GoCryptFS into exposing unwanted parts of the file system.

Steps to reproduce:

  1. Create a regular reverse mount point
  2. Create a directory "test" in the original directory
  3. Access the corresponding encrypted directory in the mount point (ls <encrypted dir>)
  4. Quickly delete the directory in the original data, and instead create a symlink pointing somewhere else, for example to /root
  5. Access the encrypted directory again, it will now blindly follow the symlink and reveal the content of the target directory

I used a small script to reproduce this issue, manual execution is probably too slow. Even without -allow_other this could be a security issue and could, for example, backup unwanted data instead of just the symbolic link.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions