Add "inside loop" feature to basic blocks in Binexport2 extractor.#3075
Add "inside loop" feature to basic blocks in Binexport2 extractor.#3075larchchen wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Please add bug fixes, new features, breaking changes and anything else you think is worthwhile mentioning to the master (unreleased) section of CHANGELOG.md. If no CHANGELOG update is needed add the following to the PR description: [x] No CHANGELOG update needed
CHANGELOG updated or no update needed, thanks! 😄
There was a problem hiding this comment.
Please add bug fixes, new features, breaking changes and anything else you think is worthwhile mentioning to the master (unreleased) section of CHANGELOG.md. If no CHANGELOG update is needed add the following to the PR description: [x] No CHANGELOG update needed
There was a problem hiding this comment.
Please add bug fixes, new features, breaking changes and anything else you think is worthwhile mentioning to the master (unreleased) section of CHANGELOG.md. If no CHANGELOG update is needed add the following to the PR description: [x] No CHANGELOG update needed
There was a problem hiding this comment.
Please add bug fixes, new features, breaking changes and anything else you think is worthwhile mentioning to the master (unreleased) section of CHANGELOG.md. If no CHANGELOG update is needed add the following to the PR description: [x] No CHANGELOG update needed
There was a problem hiding this comment.
Code Review
This pull request introduces the 'inside loop' characteristic for basic blocks in the BinExport2 extractor. It adds a new utility module, capa/features/extractors/loops.py, which uses networkx to identify vertices within cycles. Feedback identifies a structural issue in the new loops module where code precedes the license header and lacks necessary imports. Additionally, suggestions were made to move a local import to the top level for PEP 8 compliance and to simplify edge collection logic using a list comprehension.
CHANGELOG updated or no update needed, thanks! 😄
4c071eb to
66d9ff9
Compare
Detecting API happening in a loop is an effective approach for exploits leveraging racing conditions. A classic example is DirtyCow (CVE-2016-5195) By detecting madvise calls inside a loop with MADV_DONTNEED argument. ``` scopes: static: basic block features: - and: - api: madvise - number: 4 # Constant for MADV_DONTNEED - characteristic: inside loop ``` A more recent example CVE-2024-50066 can be covered by ``` - and: - api: madvise - number: 25 # MADV_COLLAPSE - characteristic: inside loop ```
66d9ff9 to
9b38843
Compare
|
Thank you for iterating on this! After reviewing the implementation and thinking about how to best align this with Here is the suggested implementation strategy: 1. Reuse the existing
|
Detecting API happening in a loop is an effective approach for exploits leveraging racing conditions.
A classic example is DirtyCow (CVE-2016-5195)
By detecting madvise calls inside a loop with MADV_DONTNEED argument.
A more recent example CVE-2024-50066 can be covered by
Checklist