Repository navigation
v0.3.1
IronFix 0.3.1
Security/robustness patch. Closes #4.
Unchecked arithmetic on attacker-controlled framing bytes
Three sibling sites folded untrusted BodyLength (9) / CheckSum (10) bytes without bounds. Each panicked under overflow-checks (dev/test/CI profiles, and hardened release builds) and wrapped silently under stock --release. All were reachable from the default public paths — Decoder::new(bytes).decode() and FixCodec::decode() — with no opt-out of checksum validation needed.
ironfix-tagvalue— decode path.body_start + body_lengthis nowchecked_add, mapping overflow toDecodeError::InvalidBodyLength. The decoder additionally validates the declared length against reality:body_endmust land exactly on the first byte of theCheckSumfield.ironfix-transport— framing path.body_len_soh + 1 + body_length + 7folded withchecked_add→CodecError::InvalidBodyLength.ironfix-tagvalue— checksum parse.parse_checksumfoldedd0 * 100inu8, overflowing for any hundreds digit >= 3 (e.g. an injected mid-body10=624, whichdecode()reaches for any tag-10 occurrence, not only the trailing one). It now folds inu16and range-checks the result, so999/624/300/256are rejected.
Zero-padded tag handling
The CheckSum field offset is now tracked during the field scan instead of being derived as value_ptr - 3. That derivation assumed a literal 10= and mis-located zero-padded tags such as 010=, which parse_tag folds numerically — the same blind spot that defeated hand-mirrored downstream guards, and which also mis-computed the checksummed byte span.
Behaviour change
Decoder::decode() now rejects a BodyLength that does not match the actual body length; previously any value was accepted. A mismatch is a malformed frame per FIX, but callers that fed hand-written messages with a placeholder 9= value will now get DecodeError::InvalidBodyLength.
Tests
Seven regression tests: usize::MAX BodyLength via 9= and 009=, length mismatch, valid frame still decodes, trailing 010= checksum, mid-body 10=624, codec overflow and MessageTooLarge, and parse_checksum out-of-range.
All 11 crates published to crates.io at 0.3.1.
Full changelog: v0.3.0...v0.3.1