Add curated CWE fallback mappings and coverage for issue #472#823
Open
Bornunique911 wants to merge 4 commits intoOWASP:mainfrom
Open
Add curated CWE fallback mappings and coverage for issue #472#823Bornunique911 wants to merge 4 commits intoOWASP:mainfrom
Bornunique911 wants to merge 4 commits intoOWASP:mainfrom
Conversation
Bornunique911
commented
Mar 24, 2026
Author
Bornunique911
left a comment
There was a problem hiding this comment.
Requesting kind reviews and feedback for this feature from : @northdpole , @Pa04rth , @robvanderveer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Issue #472 asks how OpenCRE can map more of CWE in a way that is practical and maintainable.
The current gap is twofold:
Solution
This branch narrows the implementation to CWE-only behavior and introduces a deterministic mapping strategy with two parts.
1. Related-CWE inheritance
The importer now:
This allows a newly imported CWE to inherit mappings from another newly imported related CWE in the same run.
2. Curated fallback mappings
This branch adds a curated fallback mapping file:
application/utils/external_project_parsers/data/cwe_fallback_mappings.jsonThe importer loads this file and applies fallback CRE mappings only when a CWE still has no CRE link after normal and inherited linking.
This keeps the behavior:
3. Local refresh support
This branch also adds:
scripts/update-cwe.shThis is a local helper for refreshing CWE data from the latest MITRE feed into an existing OpenCRE SQLite cache.
Scope
In scope
Files Changed
application/utils/external_project_parsers/parsers/cwe.pyapplication/utils/external_project_parsers/data/cwe_fallback_mappings.jsonapplication/tests/cwe_parser_test.pyscripts/update-cwe.shTesting
Executed: