DEV Community

Cover image for What actually gets exploited in penetration tests
Parth Upadhyay
Parth Upadhyay

Posted on

What actually gets exploited in penetration tests

I break into apps for a living. I'm a penetration tester at Fortica Cyberguard, which means companies pay me to find their security holes before the bad guys do.

After a few years of this, it's not some zero-day exploit that gets me in. It's usually the same handful of basic mistakes, over and over.

Access control
This one feels like cheating. You see a URL like /api/orders/12345? I change it to 12346 and suddenly I'm looking at someone else's order. That's it. Change a number and I can see data I shouldn't have access to.
I've downloaded entire customer databases by just looping through IDs.

The fix: Check if the logged-in user actually owns the data before you send it back. Include the user ID in your database query.

SQL injection
It's 2026 and I still find this everywhere. If you're building SQL queries by smashing strings together with user input, I will get into your database in about 5 minutes.

The fix: Use parameterized queries. Every database library has them. Or use an ORM - they handle it automatically.

Broken authentication
JWT secrets that are literally "secret123". Tokens that never expire. Session tokens in URLs. Secrets in public GitHub repos.
Once I get a valid token, I am that user. I've taken over admin accounts because someone left their JWT secret in a public repo.

The fix: Use strong random secrets (32+ characters, in environment variables). Make tokens expire. Hash passwords with bcrypt. Rate limit your login endpoint.

Exposed secrets
Hardcoded API keys. .env files committed to git. AWS credentials in public repos.
Once I have your keys, I don't need to find vulnerabilities. I just use your credentials to walk right in.

The fix: Add .env to .gitignore now. Use environment variables. Run trufflehog on your repos. If you already committed secrets, rotate them - they're in git history forever.

The mindset
These aren't sophisticated attacks. They're basic mistakes that are completely preventable.

The apps that give me the hardest time? The ones where developers thought about security while building. They questioned every input, verified every permission, assumed everything could be exploited.

That's the shift. Start thinking like someone trying to break your app, and you'll catch this stuff before it becomes a problem.

Questions? Drop them below.

Top comments (0)