Skip to content

feat(rules): salvage and promote taxonomy_webp from notworking to full ruleset - #1551

Closed
reyammer wants to merge 1 commit into
mainfrom
rules-webp-full
Closed

reyammer wants to merge 1 commit into
mainfrom
rules-webp-full

Conversation

@reyammer

Copy link
Copy Markdown
Collaborator

Summary

  • Root Cause: In rust/rules/rulesets/notworking/formats.yar, rule taxonomy_webp was quarantined (enforced = false, class = "not-working", fp_rate = 0.010196) because a translated puremagic multi-part header check joined $p0_0 = { 52 49 46 46 ?? ?? ?? ?? 57 45 42 50 } with or ($p1_0 at 0) where $p1_0 = "RIFF", causing it to match every RIFF container (wav, avi, ani, etc.).
  • Fix: Remove the bogus $p1_0 = "RIFF" disjunct, require the 16-byte Google WebP Container Specification header at offset 0 ("RIFF" at 0..4, "WEBP" at 8..12, and initial chunk FourCC "VP8 ", "VP8L", or "VP8X" at 12..16), and promote taxonomy_webp to rust/rules/rulesets/full/formats.yar (enforced = true, class = "full", fp_rate = 0, fn_rate = 0).
  • Codegen: Regenerate rust/rules/src/bundled.rs, rust/gen/rules/content_types, assets/content_types_kb.min.json (scripts/sync_kb.py), and rust/lib/src/content.rs (rust/gen).

Verification

  • Full-corpus scan (44,781 exported files): 100 / 100 (100.00%) recall on webp and 0 false positives across all 44,681 negative files.
  • cargo test in rust/rules (75 tests) and cargo test --lib in rust/lib (9 tests) pass.
  • scripts/sync_kb.py --check and --self-test (33/33) pass.

…l ruleset

- Remove the bogus unconditional $p1_0 = "RIFF" disjunct in taxonomy_webp
  that caused it to match every RIFF container (wav, avi, ani).
- Require the 16-byte Google WebP Container Specification header at offset 0
  ("RIFF" + 4-byte size + "WEBP" + initial chunk FourCC "VP8 ", "VP8L", or "VP8X").
- Promote taxonomy_webp from notworking/formats.yar to full/formats.yar
  (100/100 = 100.0% recall on webp, 0 false positives across 44,681 negative files).
- Regenerate rust/rules/src/bundled.rs, rust/gen/rules/content_types,
  assets/content_types_kb.min.json, and rust/lib/src/content.rs.

@ia0 ia0 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay, the email got lost.

I'll send a PR to make you owner of the YARA files too (in addition to files generated from them).

@ia0

ia0 commented Oct 21, 2026

Copy link
Copy Markdown
Member

I've sent #1554

@reyammer

Copy link
Copy Markdown
Collaborator Author

closing, rules are going away.

@reyammer reyammer closed this Oct 28, 2026
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

Successfully merging this pull request may close these issues.

2 participants