Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a CWE array to the support #309 #310

Merged
merged 2 commits into from
Feb 21, 2025
Merged

Conversation

SashaTail
Copy link
Contributor

@SashaTail SashaTail commented Feb 7, 2025

Add a CWE array to the support #309

@SashaTail
Copy link
Contributor Author

I have been looking at the nvd 2.0 API, and I noticed that they have CWEs of the form NVD-CWE-{noinf\other} in addition to CWE-{num},
My implementation prioritizes CWEs of the normal kind, and if there are CWEs with number and NVD-CWE-{noinf\other}, the one with number will be selected.
I also noticed that multiple CWE sources have the same number, and they may be duplicated. I have also solved this problem.
In cases where only NVD-CWE-{noinf\other} has a vulnerability, we leave it alone.
I kept the further logic as it was.
Below I will give examples with the API and how it is now stored in mongo

@SashaTail
Copy link
Contributor Author

NVD-API:
https://services.nvd.nist.gov/rest/json/cves/2.0?cveId=CVE-2016-9160

Mongo:
"cwe": ["CWE-111", "CWE-254"],

NVD-API:
https://services.nvd.nist.gov/rest/json/cves/2.0?cveId=CVE-2010-1428

Mongo:
"cwe": ["CWE-749"],

@SashaTail
Copy link
Contributor Author

When merge please post the new version of the package on pypi.
I plan to support this in the near future for cve-search

@P-T-I P-T-I linked an issue Feb 21, 2025 that may be closed by this pull request
@P-T-I P-T-I merged commit 0ac3a0a into cve-search:master Feb 21, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a CWE array to the support
2 participants