Skip to content

Conversation

Mritunjay09
Copy link
Contributor

Closes #4159
Introduces the attachCWEs
function to extract CWE IDs from both CNA and ADP problem-types in CVE5 records and store them in the Vulnerability's DatabaseSpecific field. Also updates the ProblemTypes struct to include a CWEID field for more accurate parsing.

  • Updated ProblemTypes struct to include CweID field to match CVE5 JSON schema.
  • Updated attachCWEs() function to store both CWE ID and human-readable description.

Closes google#4159
Introduces the attachCWEs
 function to extract CWE IDs from both CNA and ADP problem-types in CVE5 records and store them in the Vulnerability's DatabaseSpecific field. Also updates the ProblemTypes struct to include a CWEID field for more accurate parsing.

- Updated ProblemTypes struct to include `CweID` field to match CVE5 JSON schema.
- Updated attachCWEs() function to store both CWE ID and human-readable description.
Copy link

google-cla bot commented Oct 15, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@jess-lowe jess-lowe self-requested a review October 15, 2025 23:35
Copy link
Contributor

@jess-lowe jess-lowe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the contribution and the work you put into this PR! It’s awesome to have you contributing.

I’ve left a few inline suggestions. If you could revise based on the comments to reduce the overall complexity, that would be perfect. We look forward to merging your work soon!

@Mritunjay09
Copy link
Contributor Author

Updated attachCWEs function per review feedback. Now uses only the CWEID field and removes regex/description parsing. The PR is ready for another review.

@jess-lowe
Copy link
Contributor

Awesome thanks for that improvement! It looks like the tests are failing as they will need to be updated with the additional data. To run the tests to check, use make vulnfeed-tests.

To check for linting errors, run make lint

@Mritunjay09 Mritunjay09 marked this pull request as draft October 17, 2025 07:02
@Mritunjay09 Mritunjay09 marked this pull request as draft October 17, 2025 07:02
@Mritunjay09 Mritunjay09 marked this pull request as ready for review October 17, 2025 07:34
@Mritunjay09
Copy link
Contributor Author

@jess-lowe made all the necessary changes and also checked that lint and vulnfeed-tests return no error

@Mritunjay09 Mritunjay09 requested a review from jess-lowe October 18, 2025 19:54
@jess-lowe
Copy link
Contributor

/gcbrun

Copy link
Contributor

@jess-lowe jess-lowe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jess-lowe jess-lowe merged commit bde844c into google:master Oct 20, 2025
17 checks passed
@Mritunjay09
Copy link
Contributor Author

Let me know if there's anything else I can contribute to.

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.

Support CWE in CVE5 conversion.

2 participants