3 ms·
Ask HN: Most comprehensive CVE database?
The official https://cve.mitre.org/ database seems like it is lacking a lot of information. There is a lot of useful data around CVEs that is not in any centralized source (e.g. referenced changesets, PoC scripts, github projects, etc) that could be collated into a master database of CVEs that would be very useful.
Has there been any attempt at making the most comprehensive CVE database possible?
Specifically, data I would be interested in for each CVE, where available:
1) The source diff of the patch applied to fix the vulnerability, i.e. the "before/after" of the critical section of code
2) The bindiff of the binary before and after patching the vulnerability
Is this available anywhere?
The reason I ask is because I think this could lend itself to a really cool machine learning system for identifying unknown vulnerabilities. The trick would be to use the code from previous vulnerabilities to determine what "vulnerable" code looks like, and then find code similar to it.
rough idea:
DATA COLLECTION PHASE:
1) Collect the before/after code of all previous vulnerabilities
2) Use the before/after code to identify the "critical section" that caused the vulnerability
3) Convert the "critical section" to its AST representation
TRAINING PHASE:
1) Determine the best ML algorithms to use for comparing AST representations
2) Using labeled inputs of "vulnerable" and "safe" AST representations, train the ML system to recognize a "vulnerable" AST
IDENTIFICATION OF NEW VULNERABILITIES PHASE:
1) Download open source code bases
2) Somehow prioritize which code to convert to AST
3) Convert code to AST and feed to ML system to determine likelihood of "vulnerability"
4) Apply some combination of static and manual analysis to verify the vulnerability
5) Use results as further feedback to train the ML system
Is anyone familiar with something like this existing?
- chatmasta 11y agoI'm curious to hear people's thoughts on this. It's an idea I've been playing with in my head for a while, but most of it falls way outside my expertise. There are definitely a lot of challenges with it, mainly false positives (e.g. maybe a double nested for-loop with a dozen conditionals looks like a vulnerable AST, but it's in a non-critical portion of code). But I think the central idea of training ML algorithms based on existing vulnerabilities would lead to a very efficient way of finding NEW vulnerabilities. At the very least, it could provide an efficiency boost to tools like fuzzers, by directing them to the critical portions of code. Also, it does not necessarily have to work on only open source code. It could also disassemble the vulnerable binary and the patched binary, and compare their ASM instructions. In fact this might even lead to higher signal than the AST method.
- pboutros 11y agoThis is really interesting - and extremely ambitious. Having played with the CVE database, I'd caution you that it was surprisingly difficult (for me) to parse. The content is mildly unstructured, so that would be one of the first things I would look to figure out before building the retrieval system for the affected code.