Skip to content

Releases and upgrades

Docs for v0.11.1 · Go 1.27.0+ · Go API

These docs describe v0.11.1, released on 2026-11-19. It requires Go 1.27.0 or later.

v0.11.1 eliminates candidate-slice growth (#618), rejects non-empty fullword regex candidates before VM execution (#619), deduplicates shared hex atoms (#620), and adds atom-adjacent / 1-byte fanout discrimination (#622), raising 256 MB dense-root throughput from 28 → 144–145 MB/s (-83% peak RSS) and 100 MB Bitcoin/JWT regex throughput from 41–42 → 107–113 MB/s (see v0.11.1 performance changes). Compiled artifact format 20 and the Go 1.27.0 minimum toolchain requirement are unchanged.

v0.11.0 exposes pe.overlay.data_offset, pe.overlay.data_size, and pe.overlay.certificate_size (#595), updates go-pe to v0.1.0 (#574), and ships major compilation, deserialization, Aho–Corasick/Teddy, regex, hex, and PE performance improvements (see v0.11.0 performance changes). Compiled artifact format 20 and the Go 1.27.0 minimum toolchain requirement are unchanged from v0.10.0.

v0.10.1 fixes v0.10.0 high-EPS compact-prefilter, ruleResultsDense clear, and hot-path defer regressions on mixed literal/regex/hex corpora (see v0.10.1 performance changes), adds zero-allocation contracts and a CI benchstat regression gate (scripts/perf_gate.sh) (#536), and updates the module catalog generator probe for built-in functions (#534). Compiled artifact format 20 and the Go 1.27.0 minimum toolchain requirement are unchanged from v0.10.0.

v0.10.0 raises the minimum toolchain requirement to Go 1.27.0, adds a pure-Go pe module backed by go-pe, introduces borrowed evidence (WithBorrowedEvidence) and reflection-free streaming JSON encoders, adds WithStrictLibyaraCompatibility(true) and of/for expression quantifiers, makes MarshalBinary / WriteTo byte-deterministic, and adds compiled-artifact validation (ErrCorruptProgram) alongside prefilter and verification hotpath optimizations.

New compiled artifacts use format 20 (adding ModuleRegex / OpPushRegex in format 19 and deterministic sorted map encodings in format 20). The reader accepts formats 4–20, while v0.9.0 writes format 18 and cannot read format 20 artifacts. Recompile rules from source to gain deterministic serialization digests and artifact integrity checks, and keep separate caches during rollout and rollback.

Native elf, cuckoo, and dotnet modules and general cyclic combined-NFA execution remain outside this release. Rules matching pe.imphash() should guard with pe.number_of_imports > 0 when import-less binaries must not match on md5(""). See the v0.10.0 performance notes for scope and tradeoffs.

v0.9.0 focuses on regex occurrence correctness, streaming boundaries and read errors, lower evidence allocation, and faster compilation. Regex fixes cover greedy/lazy repetition, alternatives, anchors, wide/fullword matching, and verification bounds. Compare counts, offsets, lengths, and final rule outcomes when upgrading; a boolean-only check can miss a changed occurrence.

v0.9.0 compiled artifacts use format 18, compared with format 7 in v0.8.2; legacy unbounded regex artifacts without a finite verification horizon need recompilation or an explicit WithMaxMatchSpan for reader scans. Prebuilt CLI binaries use the default build; optional SIMD acceleration uses GOEXPERIMENT=simd. See the v0.9.0 performance changes for eligibility limits.

v0.8.2 upgrades ScanReader and ScanReaderWithContext to evaluate full rule conditions using a bounded sliding input window ($C + W$), replacing io.ReadAll on large streams (#352). It introduces MatchesReader for early-exit boolean matching. Retained occurrences, result data, and evidence can grow with matches.

v0.8.1 fills the scan phase timers and dispatches per-pattern profiles. Completion hooks now see final telemetry, and detailed, boolean, rule-list, and block scans use consistent accounting. PatternProfile.CandidateHitsKnown distinguishes unavailable candidate counts from zero hits. If you export these fields, review the metric definitions: loop steps count per-rule iterations, and candidate counts describe logical rule contexts rather than physical verifier calls.

The Go requirement and serialized program format are unchanged from v0.8.0.

In your application’s Go module:

Terminal window
go get github.com/cawalch/go-yara/compiler@v0.11.1
go test ./...

Run your rule corpus against known positive and negative samples as well as your Go tests. Review compatibility differences if you depend on native module behavior or move rules between engines.

The changelog at this release records behavior changes. Prebuilt binaries are listed on the installation page.

New serialized programs use format 20. This release reads formats 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20. A binary whose reader does not support format 20 cannot load new artifacts. Rebuild caches from rule source when the consuming binary cannot read their format.

Keep the library version with a stored cache and retain the original rule source. When rolling out multiple versions of a service, avoid overwriting a shared cache with an artifact that older instances cannot read.

This example compiles a rule, serializes it, reloads it, and prints true after scanning:

Serialize and restore a program
package main
import (
"context"
"fmt"
"log"
"github.com/cawalch/go-yara/compiler"
)
func main() {
program, err := compiler.NewCompiler().CompileSourceWithContext(context.Background(), `
rule small { condition: filesize < 1024 }`)
if err != nil {
log.Fatal(err)
}
encoded, err := program.MarshalBinary()
if err != nil {
log.Fatal(err)
}
loaded, err := compiler.UnmarshalCompiledProgram(encoded)
if err != nil {
log.Fatal(err)
}
matched, err := loaded.Matches([]byte("sample"))
if err != nil {
log.Fatal(err)
}
fmt.Println(matched)
}
Persisted artifact
  1. Compile rulesRule source and module definitions
  2. MarshalBinaryVersioned bytecode, schemas, and signatures
  3. LoadCheck format; supply compatible callbacks
Runtime setup after loading
  1. New scannerApply result options and limits
  2. Bind valuesExternal variables and host-module data
  3. Scan inputProduce new results
The artifact preserves the compiled rules, not a running scanner. Runtime values and Go callback implementations must come from the loading application.

Pass compatible custom module handlers to UnmarshalCompiledProgram(blob, modules...) when loading; missing or incompatible function signatures cause a load error. Bind external values and host data on the restored scanner. The custom-module example exercises this sequence, including the missing-handler failure.

Structured schemas are preserved, but callbacks, external values, scanner options, host data, and previous scan results are not an application-state snapshot. Keep the original rule source and runtime configuration alongside your cache policy. A compiled artifact is specific to go-yara; it is not a libyara compiled-rule file.

The site rebuilds when a release is published or main changes. Version details, module signatures, the serialized format number, and CLI help come from the latest stable release. The displayed Go and CLI examples run against that release and the current source tree before deployment.

Behavioral explanations still need review when code changes. Deployment waits for a recorded prose review of each release. The repository’s documentation maintenance guide maps code changes to pages, and its writing guide records the editorial standard.