-
Notifications
You must be signed in to change notification settings - Fork 47
LABSCon 2022 Techniques #24
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added metadata to few rules. All rules need similar fields. (We will make CONTRIBUTING file soon with all requirements for new rules).
Left a few comments - some rules can be merged; some have invalid tests.
All tests need improvements:
- add
# ruleid: <name of rule>
where the semgrep should find the issue - add
# ok: <name of rule>
where semgrep should not find issue
I am a bit worried about number of false positives - is using all these methods always insecure, or can we filter-out some common false positives (e.g., using hardcoded paths)?
If possible, we can enhance messages with guidance on how to fix the issues - propose more secure alternatives or e.g., sanitizing inputs.
Rules like these can be simplified:
patterns:
- pattern-either:
- pattern: |
tensorflow.load_op_library($PATH)
with
patterns:
- pattern: |
tensorflow.load_op_library($PATH)
Once everything is fixed, run semgrep --test ./
Co-authored-by: Paweł Płatek <e2.8a.95@gmail.com>
To limit false positive, removed detection of hardcoded strings. This is in accordance with similar, official semgrep rules. Removed:
|
Thanks a lot @moohax ! Finally merged the rules. |
New PR for CLA.
Changes:
tf -> tensorflow
np -> numpy