* Create a file in patterns/en/medium/ where there is one pattern per line
* If needed append .suffix and .prefix to prepend or append those chars to the regex (exactly those chars, don't add a newline char in the end!)
* Replicate the actual behavior, for now, only medium is being used, but later, we will add more severities and add them into the output information
If one of more CVE id(s) are found in a commit message, those are added
in the finding output.
Example:
"8c6f86c7c5350fadf22d32d6cd4712e2ad4447ba": {
"message": "Fix an overflow bug in rsaz_512_sqr\n\nThere is an overflow bug in the x64_64 Montgomery squaring procedure used in\nexponentiation with 512-bit moduli. No EC algorithms are affected. Analysis\nsuggests that attacks against 2-prime RSA1024, 3-prime RSA1536, and DSA1024 as a\nresult of this defect would be very difficult to perform and are not believed\nlikely. Attacks against DH512 are considered just feasible. However, for an\nattack the target would have to re-use the DH512 private key, which is not\nrecommended anyway. Also applications directly using the low level API\nBN_mod_exp may be affected if they use BN_FLG_CONSTTIME.\n\nCVE-2019-1551\n\nReviewed-by: Paul Dale <paul.dale@oracle.com>\nReviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>\n(Merged from https://github.com/openssl/openssl/pull/10574)\n",
"commit-id": "8c6f86c7c5350fadf22d32d6cd4712e2ad4447ba",
"summary": "Fix an overflow bug in rsaz_512_sqr",
"stats": {
"insertions": 197,
"deletions": 184,
"lines": 381,
"files": 1
},
"author": "Andy Polyakov",
"author-email": "appro@openssl.org",
"authored_date": 1575460101,
"committed_date": 1575635491,
"branches": [
"master"
],
"pattern-selected": "(?i)(denial of service |\bXXE\b|remote code execution|\bopen redirect|OSVDB|\bvuln|\bCVE\b |\bXSS\b|\bReDoS\b|\bNVD\b|malicious|x−frame−options|attack|cross site |exploit|malicious|directory traversal |\bRCE\b|\bdos\b|\bXSRF \b|\bXSS\b|clickjack|session.fixation|hijack|\badvisory|\binsecure |security |\bcross−origin\b|unauthori[z|s]ed |infinite loop)",
"pattern-matches": [
"attack"
],
"cve": [
"CVE-2019-1551"
],
"state": "cve-assigned"
}
The state is also updated to cve-assigned if one or more CVE are present
in the commit message.
A new option -p has been added to select the pattern to use.
-p P Matching pattern to use: [vulnpatterns, cryptopatterns,
cpatterns]
The 3 default patterns are the following:
- A generic "vulnpatterns" which contain mainly web vulnerability and
common vulnerability messages including CVE numbers.
- A specific "cryptopatterns" to match potential vulnerabilities
matching cryptographic functionalities
- A specific "cpatterns" to match common vulnerabilities in C/C++-like
language.
cryptopatterns and cpatterns still need some more work.