Summary
Boost Serialization up to version 1.91 contains an improper input validation flaw that allows specially crafted serialized data to bypass expected type checks.
When applications deserialize untrusted or remote data using the vulnerable Boost Serialization components, an attacker may be able to trigger unintended behavior, potentially leading to data corruption, process crashes, or further logic abuse.
Affected context
This vulnerability affects C++ applications that:
- Use Boost Serialization (≤ 1.91) to deserialize data
- Accept serialized input from remote or otherwise untrusted sources (e.g., over network protocols, IPC channels, or user-supplied files)
- Rely on Boost Serialization's internal type and format validation to enforce safety and correctness
The flaw stems from insufficient validation of the specified type or structure of the serialized input before it is processed by the library.
Exploit preconditions
- Attack surface: Any interface that accepts serialized data processed by Boost Serialization (≤ 1.91), including network endpoints, APIs, or file-based import mechanisms.
- Required access: Ability to provide or modify serialized payloads consumed by the application (e.g., sending network requests, uploading files, or influencing inter-process messages).
- Trigger point: Deserialization of a crafted Boost-serialized payload by vulnerable code paths.
- Why exploitation is possible: Boost Serialization performs incomplete or improper validation of input types and structure, allowing malformed or unexpected type information to reach sensitive logic. This condition aligns with CWE-20 and CWE-1287, where type and format checks are insufficient for security.
Why this happens
The root cause lies in the library's reliance on input that is assumed to be well-formed and type-consistent, without enforcing strict validation or rejection of malformed or unexpected type encodings.
Conceptually, this is an instance of CWE-20: Improper Input Validation combined with CWE-1287: Improper Validation of Specified Type of Input, where:
- Deserialization logic trusts metadata and type specifications embedded in the serialized stream.
- The library does not fully verify that the provided type, structure, or size information is consistent and safe before using it.
- As a result, attackers can craft payloads that navigate code paths not intended for untrusted input, potentially affecting control flow, memory layout expectations, or integrity of reconstructed objects.
Potential impact
- Remote denial of service through crafted payloads that cause crashes, exceptions, or excessive resource consumption during deserialization.
- Corruption or manipulation of in-memory object state leading to data integrity issues.
- Bypassing application-level assumptions about object types or structures after deserialization.
- Expansion of attack surface for secondary vulnerabilities (e.g., logic flaws, unsafe assumptions about object invariants).
- In some application-specific contexts, contributing to more severe outcomes if combined with other weaknesses (e.g., authorization bypass or insecure object usage).
General mitigation guidance
Because no vendor patch is currently available, mitigation should focus on hardening deserialization boundaries and reducing trust in serialized data:
- Prefer treating all externally supplied serialized data as untrusted and subject it to strict validation before invoking Boost Serialization.
- Introduce an explicit validation layer or schema that checks types, ranges, and structural constraints on data before deserialization.
- Restrict accepted message formats to a small, well-defined set of types, avoiding polymorphic or highly dynamic type graphs where possible.
- Apply input size limits, depth limits, and timeouts around deserialization operations to reduce denial-of-service risk.
- Run components that must deserialize untrusted data with least privilege, in separate processes or sandboxes to contain potential impact.
- Where feasible, consider using more restrictive or security-focused serialization formats (e.g., schema-based or JSON with strict validation) at external boundaries, keeping Boost Serialization for trusted, internal-only usage.
How teams detect issues like this
Organizations looking to detect exposure to this vulnerability can:
- Use static analysis or code search to identify:
- Includes of Boost Serialization headers (e.g.,
<boost/serialization/...>). - Calls to Boost serialization archives with data originating from network sockets, files, or other untrusted inputs.
- Review architectural diagrams and data flow to locate services where serialized data crosses trust boundaries and is handled by Boost.
- Implement code review checklists that flag:
- Deserialization of data from remote clients or user-controlled files.
- Use of polymorphic serialization and unbounded object graphs without explicit validation.
- Employ application-layer logging and anomaly detection for:
- Unexpected deserialization errors.
- Spikes in malformed serialization inputs or repeated failures around the same endpoints.
- Integrate SAST/IAST tools with rules targeting deserialization of untrusted Boost payloads and alert when such patterns are introduced in new code.

