Commit Graph
2 Commits
Author SHA1 Message Date
jmestwa-coder 0a5e2f1390 bound jump target within code section in yr_execute_code (#2236)
conditional-jump opcodes add an unchecked 4-byte offset from the compiled bytecode to the instruction pointer, so a crafted .yrc whose taken jump lands past the code section makes yr_execute_code fetch the next opcode out of bounds; reject any ip that leaves the code buffer.
2026-08-19 11:28:58 +02:00
jmestwa-coder 129cdc43fb bound rule table index in OP_PUSH_RULE and OP_INIT_RULE (#2230)
Rule index read from compiled bytecode is used to index rules_table without a bounds check:
- OP_PUSH_RULE dereferences rules_table[r1.i] and indexes rule_matches_flags with the same value, unchecked
- OP_INIT_RULE only had an assert, which is a no-op under NDEBUG
- OP_MATCH_RULE right below them already guards the index with ensure_within_rules_arena

Added the same YR_PARANOID_EXEC guard to both. A crafted .yrc with an out-of-range rule index reaches this through yr_rules_scan_mem and reads past the table; test-exec covers it.
2026-07-22 08:57:13 +02:00