Skip to content

Conversation

@mataiodoxion
Copy link

Read about the exploit here (I know I'm publishing this before the PR is actually accepted, but there's a very small window of opportunity): https://mataiodoxion.github.io/blog/smashing-morts-server-1/

TL;DR Most notably, I could have escalated my permissions on the site to admin by exfiltrating .env secrets, logging into the admin server, and making some queries. I did, however, escalate my privileges with the RCE (through the code runner) a bit earlier.

Updated two files to use a safer version of os.path.join() with secure_filename() at both the fetch level and interal setter level. Main idea is that 1) inputs weren't properly sanitized and 2) os.path.join() will take an absolute path over a local path, meaning I could set that to any file I wanted on the Docker image (including .env, of course).

PS: My IDE's built in linter automatically formatted a bunch of the code, so some of the code format styling changed a bit.

Notable lines:

  • model/pfp.py: linter didn't mess with the additions too much here
  • model/user.py: 348-364

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant