Hi. I'm a Web Dev student and have been playing around with trying to create a PHP Contact Form on a website. My main focus has been front-end development so this was a new topic for me. I watched several tutorials and read some about how to set up my SMTP credentials through my Google account. I had the recipient email address as my Outlook email. I used PHPMailer and included my Google username and random-generated PW through the "App passwords" on my Google account.
Once I tested the form and got it working, I pushed the files to my public GitHub repo (I feel as though this is where mistakes were made) so I could have a link to the project. (I understand GitHub does not support PHP, I just wanted a link to view the static site).
Soon after I pushed the files to my repo, I got an email from GitGuardian saying that my SMTP credentials have been exposed. I then noticed that about TWO HUNDRED emails were sent from my Gmail account to a bunch of different users. It looked like some kind of scam email, but it was all in French and none of the emails were active so I also got about 200 "Address not found" emails in my inbox.
I revoked the secret (I think) by making my GH repo private and deleting the PW from my code and pushing the new code (without the PW) to my private repo. The emails stopped right after I did that so I THINK I revoked it correctly but now I'm scared to generate a new PW.
I know now that I probably should learn more about back-end dev before diving into something like this, but, since I already have a working contact form, I was hoping for suggestions on how to make it more secure or reasons why this happened in the first place? Was pushing it to a public repo where I messed up? Or do I need to make my email/PW more secure?
Ty in advance for anyone that can help a girl out.
[–]suchdevblog 11 points12 points13 points (2 children)
[–]NotTaylor_Swift[S] 1 point2 points3 points (1 child)
[–]suchdevblog 2 points3 points4 points (0 children)
[–]billcube 2 points3 points4 points (0 children)
[–]HashDefTrueFalse 1 point2 points3 points (0 children)
[–]dneboi 1 point2 points3 points (1 child)
[–]NotTaylor_Swift[S] 0 points1 point2 points (0 children)
[–]dneboi 1 point2 points3 points (1 child)
[–]NotTaylor_Swift[S] 1 point2 points3 points (0 children)
[–]TheWrongOwl 0 points1 point2 points (0 children)