fix(micromate): the opcode gate is an allowlist -- unknown SUBs refused; tables read-only
READ_SUBS catalogues every read; a SUB in neither table is refused, and allowed_writes may only name catalogued writes. Tables are MappingProxyType, _send checks the exact bytes it writes, check_transmit documents precedence. Tests cover unknown opcodes, concatenation smuggling and table immutability. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
This commit is contained in:
1 parent
a3e4e85dfd
commit
9c1c7cec76
4 files changed
+108
-7
No files matched your search
@@ -476,6 +476,7 @@ def _noncanonical_frames():
|
||||
"lone DLE before ETX": good[:-1] + b"\x10" + good[-1:],
|
||||
"double 41 02 prefix": good[:2] + good,
|
||||
"first byte not 0x10": good[:2] + bytes([0x11]) + good[3:],
|
||||
"two frames concatenated": build_request(0x5B, 0x0030) + good,
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user