v4.1.0
Release Notes: v4.1.0
This release focuses on memory efficiency, protocol parsing robustness, CPU architecture compatibility, and protection against Denial-of-Service (DoS) vectors when processing IPP messages.
🚀 Key Improvements & Features
1. Memory Efficiency & Streaming Output
- Zero-Buffer HTTP Content Streaming: Introduced
IppRequestContent, a customHttpContentimplementation that serializes IPP requests directly into the network stream. This avoids buffering the entire serialized payload in memory before transmission, significantly lowering memory consumption when sending large print jobs. - Document Stream Size Limits: Added a configurable limit (
MaxDocumentStreamBytes, defaulting to 128 MB) to cap incoming document payloads and prevent out-of-memory errors on large print jobs. Exceeding this limit returns aClientErrorRequestEntityTooLargeIPP error.
2. Robustness & Security (DoS Protections)
- Attribute Parsing Constraints: To protect against malformed or hostile payloads, new configurable boundaries have been introduced on
IIppProtocol:MaxMessageAttributesCount(defaults to5,000attributes) caps the maximum number of attributes parsed in a single message.MaxMessageAttributesBytes(defaults to10 MB) caps the total byte size of the attributes section.
- Parser Validation Enhancements:
- Enforced collection tag matching: the parser now throws an error if an
EndCollectiontag is encountered without a matchingBegCollectiontag. - Added validation for length parameters during parsing to safeguard against negative or truncated values.
- Internal parser failures (such as
EndOfStreamException) are now gracefully wrapped and returned as structuredIppRequestExceptionexceptions withClientErrorBadRequeststatus codes.
- Enforced collection tag matching: the parser now throws an error if an
3. Compatibility & Bug Fixes
- Non-Seekable Stream Compatibility: Removed all dependencies on
Stream.LengthandStream.Positionwhen parsing extended or unknown values. The IPP parser can now safely parse incoming data directly from forward-only, non-seekable streams (like network/socket streams) without throwingNotSupportedException. - Platform Endianness Fix: Fixed a platform-dependent bug in
IppVersionconversion. Previously, the converter relied onBitConverter, which is CPU-endianness dependent. It now uses explicit bitwise operations to guarantee consistent big-endian layout on all processor architectures.
Full Changelog:
v4.0.2...v4.1.0