-
Notifications
You must be signed in to change notification settings - Fork 3
Description
Hello,
in trying HTMLy a bit on my server (nginx), I noticed something that I feel is probably a security oversight. Since it concerns web server configuration, and not the program itself, I'm reporting it here.
While the basic configurations for web servers provided in this documentation (https://docs.htmly.com/web-servers) ensure configuration files for the program are properly protected against access from the Internet, I found out that content that should be private is, in fact, not kept as such.
Specifically, the entire /content/ directory of the website is allowed to be accessed from the Internet, when using the basic provided configuration. This includes all source Markdown files for posts and pages and, specifically, drafts and programmed posts, which in theory only admins and editors should be able to read.
To me this appears to be a security hole, since it means that effectively anyone can download and read posts that they shouldn't be able to. Provided they know the URL or are able to bruteforce it, which can happen in a number of situations, it's as simple as requesting http://<website>/content/<username>/blog/<category>/draft/<post-slug>.md.
As far as I can see, there's no technical reason for these files to be exposed to the public, so I believe a rule should be added to the sample server configurations, to take care of blocking access to the relevant files, inside /content/.
Given that posts are grouped in directories named as the users, however, it's kind of tricky to block folders, because we would need to block ALL subdirectories in there, EXCEPT those required to be accessible from the Internet, for example /content/images/. Luckily I think that just blocking access to .md files, instead of directories, like is already being done for .ini files, should solve the issue and cause no collateral problems.
Thanks!