fix(scoring): apply 1.3x multiplier only to findings from executable files#122
Open
tcconnally wants to merge 1 commit into
Open
fix(scoring): apply 1.3x multiplier only to findings from executable files#122tcconnally wants to merge 1 commit into
tcconnally wants to merge 1 commit into
Conversation
…files Previously the risk score multiplied ALL findings by 1.3x if any executable script existed in the skill, punishing documentation and teaching content that mentions attack patterns for educational or deny-list purposes. This change: - Builds a file-executable lookup from component_metadata - Applies 1.3x only to findings from executable files (.py, .sh, .js, etc.) - Leaves non-executable-file findings at base severity weight - No change when component_metadata is unavailable (backward compatible) Added test: doc_findings_no_multiplier verifies markdown findings are not inflated by the executable multiplier. Addresses the scoring concern in NVIDIA#103 Signed-off-by: Perseus Computing <51974392+tcconnally@users.noreply.github.com>
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.
Summary
Addresses the scoring concern in #103: the 1.3x executable-script multiplier was applied globally to ALL findings when any executable file existed. This meant documentation, teaching content, deny-lists, and anti-examples in .md files received the same score inflation as actual executable code — making thoroughly documented security skills appear MORE dangerous.
Fix
_compute_risk_score()now accepts optionalcomponent_metadataand builds a file-path lookup. The 1.3x multiplier is applied only to findings whose file is marked as executable in the component metadata. Findings from markdown, text, json, yaml, and toml files receive base severity weight (no multiplier).Before
After
Testing
test_report_doc_findings_no_multiplier)component_metadatais None, behavior is unchanged