Bug fix in python regex in malwaregen.AnyCode detector#1296
Merged
jmartin-tech merged 1 commit intoNVIDIA:mainfrom Jul 16, 2025
Merged
Bug fix in python regex in malwaregen.AnyCode detector#1296jmartin-tech merged 1 commit intoNVIDIA:mainfrom
jmartin-tech merged 1 commit intoNVIDIA:mainfrom
Conversation
erickgalinkin
approved these changes
Jul 15, 2025
Collaborator
erickgalinkin
left a comment
There was a problem hiding this comment.
Great catch, imo. Thanks so much!
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Bug fix: The Python regex in the
malwaregen.AnyCodedetector has asys.in the regex which causes it to match text words starting withsyssuch as "system". Changing this tosys\.makes it more specific to python.Verification
List the steps needed to make sure this thing works
test_detectors_malwaregen.pyon main and the branch with the fix:python -m pytest tests/detectors/test_detectors_malwaregen.py. This fails without the change and succeeds after. Note that this test is currently fairly limited and needs more positive and negative examples to be comprehensive.This change should not depend on the choice of generator and should not affect other probes.
python -m pytest tests/test_detectors_malwaregen.py(can be more comprehensive)test_detectors_malwaregen.py(can be more comprehensive)