-
Notifications
You must be signed in to change notification settings - Fork 58
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
br_table size is out of bounds #207
Comments
What's the condition in the rule? |
I was able to recreate this bug using a (poorly written) python script: #!/usr/bin/env python
import random
import string
def main():
file_content = ['rule big_rule : big_rule {\n', ' strings:\n']
for count in range(131533):
file_content.append(f' ${count} = "{''.join(random.sample(string.ascii_letters, 16))}" wide ascii nocase fullword\n')
file_content.extend([' condition:\n', ' any of them\n', '}'])
with open('big_rule.yar', 'w') as rule_handle:
rule_handle.writelines(file_content)
if __name__=="__main__":
main() |
I'm afraid there's little I can do about this, except limiting the number of patterns per rule to a reasonable number in order to prevent the crash. YARA and YARA-X have different constraints, and their own set of advantages and disadvantages. This is an extreme edge case that hits a limit that is hard or impossible to circumvent. |
I have a yara rule file with 131,517 strings and when using the
yr compile
command, it is crashing with the following error:I am building
yr
using the main branch on the latest commit (e7f6363)I understand that this is a ridiculous amount of strings to have in a single rule, but in yara 4, I was able to set
--max-strings-per-rule
and compile the file successfully.The text was updated successfully, but these errors were encountered: