Exp. 01shipped
One Security Scanner for All Code
How do you add a new language to Vanir without writing a parser from scratch?
Worked for Google's Android Security team, as part of my UW iSchool capstone, on Vanir: Google's open-source scanner that reads source code to find security patches that never made it in. It only understood C/C++ and Java, and every new language meant weeks of hand-writing a fragile parser from scratch.
- problem
- each language needed its own hand-built grammar: weeks of work, unreliable community versions, nothing reusable for the next one
- solution
- I plugged in tree-sitter, the parser behind GitHub and Neovim, through one shared layer. Python is now a
pip install; any new language is three short methods - proof
- caught a critical (CVSS 9.0) unpatched vulnerability in a real Python project, and parsed Django, Ansible and Scrapy, 5,000+ files, with zero errors