From 9f270c12b485e7ea4a4478fde379406910fbc661 Mon Sep 17 00:00:00 2001 From: W13R <9070224-W13R@users.noreply.gitlab.com> Date: Wed, 2 Nov 2022 21:55:36 +0100 Subject: [PATCH] Profile pictures are now handled by the application to mitigate possible directory traversals to other sub-directories of the static directory (Admins/Staff with the right to edit user accounts were able to set a path like ../static/favicon.png for the profile picture - this isn't a "i'm in, now i have root access and can hack your mom"-vulnerability, but better fix it before it evolves to one. or a dragon. it's too late for this crap.) --- .gitignore | 4 +++- .../app/templates/registration/login.html | 2 +- application/app/templates/userPanel.html | 2 +- application/app/urls.py | 3 ++- application/app/views.py | 24 +++++++++++++++++++ application/drinks_manager/settings.py | 2 ++ lib/env.sh | 1 + .../default.svg | 0 8 files changed, 34 insertions(+), 4 deletions(-) rename {static/profilepictures => profilepictures}/default.svg (100%) diff --git a/.gitignore b/.gitignore index 8db7fca..4f97b84 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ /archive/* /logs/* /packages/* +/profilepictures/* /temp /tmp __pycache__ @@ -12,4 +13,5 @@ __pycache__ !/config/config.sample.sh !/config/Caddyfile !/config/tls/ -!.gitkeep \ No newline at end of file +!/profilepictures/default.svg +!.gitkeep diff --git a/application/app/templates/registration/login.html b/application/app/templates/registration/login.html index af1f25c..765172e 100644 --- a/application/app/templates/registration/login.html +++ b/application/app/templates/registration/login.html @@ -69,7 +69,7 @@