Skip to content
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

lint or check invalid scope/match combinations when generating rule set #2130

Closed
mr-tz opened this issue Jun 6, 2024 · 2 comments
Closed

Comments

@mr-tz
Copy link
Collaborator

mr-tz commented Jun 6, 2024

          An example of when this can happen today is here:

https://github.com/mandiant/capa-rules/blob/9e0ffdf7c51af31bb668c8ffbbe7c8f6fd9199cb/lib/allocate-or-change-rw-memory.yml#L24

allocate or change rw memory is a static: basic block/dynamic: call rule that has a instruction subscope block. This subscope block gets translated into a derived rule with static: instruction scope. When capa tries to score the match: <derived rule> in dynamic mode, it can't find it, because static: instruction scoped rules won't ever run/be matched. So, we'd need a default score for this case (that will never be matched, so maybe it should be score = 1).

The most correct thing to do is to prune this impossible match in dynamic mode, but this requires some partial evaluation infrastructure that we don't have yet. That should be done in another issue.

Originally posted by @williballenthin in #2080 (comment)

@williballenthin
Copy link
Collaborator

dup of #2124

@mr-tz
Copy link
Collaborator Author

mr-tz commented Jun 6, 2024

🙈

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants