---
Hello,
Your email address used for HN Replies (hnreplies.com) notifications has likely been leaked.
I was notified today that a user of this site received a spam email at an email address used solely for hnreplies.com notifications. I investigated how this could have occurred. For a period of several days earlier this year, a .git directory on the VPS hosting this site was exposed to the internet by a configuration mistake, providing enough information to allow an attacker to access the site's database.
This website stores only two pieces of personal information: a username to follow, and an email address to notify of new comments for that username. This website does not require passwords, so you do not need to change any passwords.
If you'd like to unsubscribe from HNReplies.com, which will permanently remove your email address from the database, you may click here: http://www.hnreplies.com/?unsubscribe=[hash]
I'm sorry that this incident occurred. The configuration mistake was fixed and passwords changed. If you have any questions about this email, you can reply to this email to contact me.
Kind regards, Dan Grossman Creator of hnreplies.com
Maybe this is evidence of how low the bar is for incident reporting, or maybe its evidence of of "no publicity is bad publicity," but I just signed up for hnreplies.
Great service idea, and thanks for the honest and helpful disclosure!
Deleted Comment
-- Robert Mueller, 2012, when he was Director of the FBI [yes, that Robert Mueller]
https://archives.fbi.gov/archives/news/speeches/combating-th...
I had trouble figuring out how they got from point A to point B. My best guess is that a file containing database configuration settings had been committed to the Git repo at some point.
Lessons:
- Don't commit secrets to your Git repo. Store them in config files which are listed in .gitignore. Yes, this means you have to manually copy or write config files when you set up different servers, but those servers are likely to have different database credentials and the like anyway, right? If you've found that you've committed secrets by accident but haven't pushed anywhere yet, revert your branch to before the commit and redo or cherry-pick any subsequent commits safely. If it is too late, change the credentials to access the database or whatever other secrets you've revealed.
- Don't put web-accessible files in the root level of a Git repository. Instead, have a subdirectory contain the web-accessible files, and configure your web server to serve from that. That ensures that the .git directory won't be right next to web-accessible files, and has other benefits as well - you can also easily have subdirectories for docs, CLI scripts, and other things that shouldn't be web-accessible right there in the same repo. But if that isn't an option (or even if it is), configure your web daemon to not serve files from .git, or probably any other file or directory that starts with a dot.
- Edit to add one more: As much as possible, lock down access to your database server. An attacker having your database credentials is bad, but they still won't get far if the database server is configured to only listen to connections from the IP address that the web application server is hosted at, or, if they're on the same server, only over local sockets.
Of course, the same applies to other VCSes besides Git.
You can also separate your git repository from the working directory. I have my git repositories at ~/repositories, with a post-receive hook that checks out the working directories at ~/projects and then _actively_ copies only relevant files to ~/html. Basically a "poor man's CI/CD", with the bonus of having to opt-in to publish any files.
I set this up as a "poor man's version control" on a large client's server back in 2016-ish. I was lost for words when last year I saw my colleagues still using Ctrl-R to rerun that alias line.
No, you can use GitHub Secrets, AWS Secrets Manager, etc ... or encrypt your config files and add a decrypt step to your build. [1]
[1] https://docs.github.com/en/actions/reference/encrypted-secre...
It basically lets you encrypt your secrets and store them in your git how much you want. You then only need one password when decrypting the vault.
Best of luck with everything
I badly hope nobody is going to be offensive here. (Mind you, I’m watching!)
THANK YOU, Dan!
Storing credentials in git. Ahh a classic!
And if I REALLY don't want to be associated, I use a relay email address.
Deleted Comment
https://idioms.thefreedictionary.com/there+is+no+such+thing+...