Skip to content

v4.1.0

Choose a tag to compare

@github-actions github-actions released this 21 Jun 20:28

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 custom HttpContent implementation 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 a ClientErrorRequestEntityTooLarge IPP 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 to 5,000 attributes) caps the maximum number of attributes parsed in a single message.
    • MaxMessageAttributesBytes (defaults to 10 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 EndCollection tag is encountered without a matching BegCollection tag.
    • 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 structured IppRequestException exceptions with ClientErrorBadRequest status codes.

3. Compatibility & Bug Fixes

  • Non-Seekable Stream Compatibility: Removed all dependencies on Stream.Length and Stream.Position when 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 throwing NotSupportedException.
  • Platform Endianness Fix: Fixed a platform-dependent bug in IppVersion conversion. Previously, the converter relied on BitConverter, 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