today I was testing something on my VPS and realized the "www-data" user has read access into Home folders and into System internal folders as well which would give an possible Attacker, the ability to gather Information outside of the /var/www directory e.g. RSA_Keys or batch Files in Home Directory's.
First I thought I faulted my File Permissions or something but I could reproduce this behavior on an fresh installed Virtual Machine.
OS: Ubuntu 20.04 LTS, with all Updates applied Webserver: Apache2 with standard config
How did I test: sudo -u www-data bash
--> nano /home/user/stuff.txt
or nano /folder/rsa.pem
Is this an expected Behavior? Do I miss something? And how can I deny the www-data User access to specific folders?
Thanks in advance!
$HOME
directories. – pLumo Jan 10 '22 at 15:10