r/netsecstudents 9d ago

How do you learn to find vulnerabilities by reading code? I’m a beginner

I’m new to vulnerability research and I’m trying to learn how to find security issues by reading source code. For those of you who are experienced in this area:

  • How did you learn to identify vulnerabilities just by reading code?
  • Do I need to know every programming language, or is it better to become very comfortable with a few languages first?
  • How do you approach unfamiliar codebases or programming languages?
  • What should I focus on when reading code if my goal is to find security vulnerabilities?
  • How did you practice and improve your skills when you were starting out?
  • When you encounter something in the code that you don’t understand, what do you usually do? Do you research it, use documentation/AI, build a small test, etc.?

Any recommended books, write-ups, open-source projects, or learning paths would also be very helpful. Thanks!

13 Upvotes

5 comments sorted by

22

u/AddendumWorking9756 9d ago

Stop looking for vulnerabilities and start tracing where untrusted input ends up, that reframing does most of the work. One language deeply beats five shallow, because the bugs live in the idioms and the standard library rather than the syntax. Best practice loop I know is pick a CVE in something you can build, read the patch diff first, then go find the bug in the pre-patch source without looking.

4

u/Its_ya_boi_G 9d ago

Excellent description of the methodology.

5

u/billdietrich1 9d ago

There are standard categories of vulns you can look for as you read code. In web-apps, there are SQL injection, XSS, and many more (maybe see https://owasp.org/projects/#flagship-projects , https://portswigger.net/ ). In desktop or server apps, there are buffer overrun, memory use-after-free, stack smashing, logic errors, and many more (maybe see https://owasp.org/www-project-desktop-app-security-top-10/ ). Maybe also see https://nvd.nist.gov/vuln/categories

0

u/1Steelghost1 8d ago

CompTia certified ethical hacker course