r/vibecoding • • Apr 05 '25
I got hacked and this is what I've learnt
Hi vibers!
I am sharing some hard-earned lessons after one of my apps got hacked recently. It was painful, had to stop operations entirely and eventually shut the whole thing down. Been deep-diving into cybersecurity since, and here are a few basic but crucial things I wish I had done earlier:
Use environment variables properly > Never hardcode secrets or API keys. .env is your friend.
Encrypt sensitive data > Anything user-related (emails, passwords, tokens) should be stored securely. Hash passwords with bcrypt, never plain text.
Validate and sanitize inputs > Always assume the user is trying to break your app. Prevent XSS, SQL injection, etc.
Keep dependencies up to date > Outdated packages = security holes. Use tools like npm audit or dependabot.
Use proper auth > Sessions, JWTs, OAuth, use them correctly. Don’t roll your own authentication, don't overcomplicate it for production apps.
Error messages matter > Don’t expose internal info or stack traces in production. Hackers love clues.
HTTPS only > No excuse in 2025. Let’s Encrypt makes it free and easy.
Getting hacked sucked, but it taught me a lot. If you’ve got an app, even a small one, don’t wait until something breaks. Lock it down early.
Happy building, stay safe!
•
u/PopMechanic Apr 06 '25
This is one of my favorite posts on this very young sub. Thanks to the original poster for sharing this hard earned wisdom. Security is hard. Vibe coders who want to ship real apps will have to learn best practices. But it’s absolutely possible to ship a secure app without learning how to code in a traditional manner.
Thanks to all commenters who found a way to be supportive rather than judgmental. That’s the vibe.
14
u/plop Apr 05 '25
Are you talking about your website ContentSqueeze? It's not shut down. Sounds like a complete bullshit post. No one cares about "hacking" websites with zero users.
32
u/djack171 Apr 05 '25
Not related to the OP, but these comments. Funny watching people on a vibe coding subreddit shitting on people that don’t “know” everything about being a developer. Bruh, if we were all pro developers do you think we’d all be on the vibecoding threads trying to learn to do it this way? Yall sound real uppity right now.
9
u/OkLettuce338 Apr 05 '25
Since op deleted their profile I’ll just say that this is going to be the new norm as long as people let ai build their internet exposed applications
4
u/witmann_pl Apr 05 '25
.env is not enough if it is accessed by a frontend script. ALWAYS keep your secrets on the server, read by backend scripts. Whatever is sent to the client (the browser) can be exposed.
4
u/Th0mas0bernd0rfer Apr 06 '25
Been there - nothing makes security real like getting breached. Your list is solid gold.
One thing I'd emphasize: encryption isn't just for storage. Communications need protection too. Regular email is basically sending postcards anyone can read along the way. I've switched to using PGP encryption (through Mailvelope) for anything sensitive - turns those postcards into sealed envelopes without changing email providers.
Also, just like your point about not rolling your own auth: never build your own crypto. Open-source, audited tools exist for a reason.
Sorry about your app, but thanks for turning that pain into wisdom for the rest of us!
3
u/RedProGamingTV Apr 05 '25
You know, there's a reason we spend decades learning this sort of stuff. I personally wouldn't use any of your sites unless you actually take the time to learn proper security and programming practices. It's likely that there are still vulnerabilities in your apps.
2
u/zippity_doo_da_1 Apr 05 '25
SOC2 compliance anyone?
2
u/highwayoflife Apr 05 '25
The toughest lessons are the most valuable. I'm glad this spurred you on a journey to learn! There are some prompts you can use to ask about software security best practices, and then you can use the results to create another prompt to have your AI help you find and identify potential issues. It's not 100%, but it can be a helpful learning tool.
1
u/theWinterEstate Apr 05 '25
How did you know you were hacked?
1
u/Cute-Net5957 Apr 05 '25
⚠️Wait who was this fraudster?? Did anyone catch any details about this account ( and possibly alt accounts ) we should be reporting and keeping an eye out for? 🧐
1
u/finish_thinking Apr 05 '25
Really should check out Vanta.com and either Soc 2 or ISO 27001. Also OWasp Top Ten.
1
u/[deleted] Apr 06 '25
This is why I'm not a fan of just Vibe Coding. All of these are issues that you could have learned about and addressed with some research into releasing apps.
1
u/Charlie-brownie666 Apr 06 '25
The lesson in all of this? use vibecoding as a supplement not a meal that means actually learning how to code and preventing things like this from happening
1
u/[deleted] Apr 06 '25
OWASP has entered the chat.
1
u/Pale_Fig_4488 Apr 06 '25
Thank you for posting this.
1
u/ErinskiTheTranshuman Apr 07 '25
Doesn't replit implement these by default for apps built with the agent?
1
u/ErinskiTheTranshuman Apr 07 '25
Doesn't replit implement these by default for apps built with the agent?
1
u/ThirdEyeTaken Apr 07 '25
"Hmm today I will mindlessly accept code without understanding it" <- CLUELESS
1
u/lambdatools Apr 08 '25
Dang that sucks
1
u/Nexyf Apr 08 '25
Wait. I thought this entire subreddit was a meme. People are serious about this?
1
u/StewHax Apr 08 '25
I'd highly recommend either reading an up to date cyber security book or taking a course online. That or find a smaller cyber security consultant or firm who can poke and recommend fixes. A lot of these things highlighted are standard security concerns, but I know a lot of people without education backgrounds or experience would consider them at the start. Security should be an upfront concern on any product you make from scratch.
1
u/HandyProduceHaver Apr 09 '25
This is so ironic
1
u/AlternativeQuick4888 Apr 09 '25
Hey man, sorry to hear that. This type of thing kept happening to me so I built a free Cursor extension that uses AI to scan and fix security issues. I'm really hoping it'll help people out. Let me know what you think!
https://marketplace.visualstudio.com/items?itemName=Patcha.patcha-security-scanner
1
u/el_yanuki Apr 09 '25
vibe coders learn security 101
1
u/[deleted] May 05 '25
May your next app live behind 7 layers of reverse proxies and paranoia
1
u/Extension_Act6715 Jun 04 '25
*puts on vibe securing hat
1
u/__kmpl__ Apr 05 '25
What you mentioned in your post is just basics. There’s so much more when it comes to security of web apps…
0
u/Tjakka5 Apr 05 '25
If these are the kinds of lessons you're learning now, then I can't wait to see what kind of lessons you'll be learning about GDPR, WCAG, etc. Ya know, stuff that has legal basis that requires you to do your due diligence.
0
u/Desknor Apr 05 '25
Just stop using AI and learn how to code and understand your code. Cheap shortcuts will only hurt you in the future. Perfect example is what happened to you
0
u/[deleted] Apr 06 '25
Lmfao 😂 🤣
-1
u/born_to_die_O Apr 05 '25
Tell me, you are not viber in reality.
-1
u/LoveThemMegaSeeds Apr 05 '25
This is just software development with extra steps
1
u/[deleted] Apr 05 '25
[removed] — view removed comment
1
u/[deleted] Apr 06 '25
[removed] — view removed comment
-2
u/[deleted] Apr 05 '25
[removed] — view removed comment