Repository navigation
This release replaces the Aho-Corasick automaton used to scan for atoms with a new,
ad-hoc scanner built specifically for boreal's needs. This brings significant improvements
to both scan durations and memory usage. See the benchmarks for the
new values, where boreal now beats yara and yara-x significantly on all but one tested rulesets.
Since this new scanner is always used regardless of the compiler profile selected, the speed
and memory profiles are now unified, and CompilerProfile is deprecated.
This release also fixes a few rare matching bugs, including one where some strings could fail
to match. See the complete changelog for details.
Note that the serialization version is bumped, so rules serialized in previous versions cannot
be loaded and must be compiled and serialized again.
boreal
Changed
Scan speed and memory optimizations:
- Replace the Aho-Corasick automaton used to scan for atoms with a new, custom made scanner.
This greatly reduces scan durations as well as the memory used by compiled rules #282. - Use an allocation-free type for atoms #279.
- Use case sensitive atoms rather than depending on the atom scanner being case insensitive #280.
- Reject false positive atom matches cheaply, without loading the details of the related literal #284.
- Skip the evaluation of rules that cannot match when none of their strings matched #285.
- Avoid allocating matches for every rule during evaluation #287.
Deprecated
CompilerProfileandCompilerBuilder::profileare deprecated: both profiles are now unified, and the profile
no longer has any impact #290.
This also means the--profileoption ofboreal-cliand theprofileparameter ofboreal-pyno longer
have any effect.
Fixed
- Fix matching bug on strings whose literals share the same atom: only the first of those literals was matched.
For example, the string{ b? 01 02 03 04 }would only match onb0 01 02 03 04#292. - Ensure matches are always sorted. In rare cases involving alternations, matches could end up unsorted, resulting
in wrong results for conditions using offsets or lengths of specific matches #293. - Some functions of the
pemodule, such aspe.exports,pe.importsorpe.locale, did not return undefined
when the scanned data is not a PE, unlike YARA #291.