Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trim-cache can delete arbitrary files by accident #56

Closed
DennisMitchell opened this issue Mar 26, 2019 · 1 comment
Closed

trim-cache can delete arbitrary files by accident #56

DennisMitchell opened this issue Mar 26, 2019 · 1 comment
Labels

Comments

@DennisMitchell
Copy link
Member

There was a serious bug in older versions of the trim-cache script that could delete arbitrary files by accident. To trigger it, you had to install TIO at least partially. If you just cloned the repo, you're safe.

Note that triggering the bug requiring executing commands on a machine you control. It's not possible to trigger it from the sandbox.

Realistically, I think it could only be triggered in two scenarios. Do NOT perform these steps.

  1. In a manual install, the following would trigger the bug.

    • Clone the tryitonline repo to /srv (that exact path).
    • Create a valid trim-cache configuration file in /srv/etc.
    • Fail to create a /srv/cache directory.
    • Run the trim-cache script in a directory where you have write access to sub-directories, either manually or via the systemd unit files in the tryitonline repo.
  2. With tiosetup, the following would trigger the bug.

    • Perform a full install or at least run the scripts in the stage directory.
    • Delete the /srv/cache directory.
    • Leave the tio-web service running or start/install the tio-trim-cache service/timer manually.

    In this case, the trim-cache script would be run as root in /, deleting most system files.

As of commit b1967d1, aside from fixing the faulty script, the systemd unit file now runs it with write access to /srv/cache and nothing else.

If you know anyone who might be running a TIO server, please point them to this issue.

@DennisMitchell
Copy link
Member Author

This is already fixed, but I'll leave the issue open for better visibility.

If applicable, please run git pull in /srv to update your TIO install to the latest version, then systemctl daemon-reload to load the new unit files.

@DennisMitchell DennisMitchell pinned this issue Mar 26, 2019
@DennisMitchell DennisMitchell unpinned this issue Aug 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant