thrift is vulnerable to Heap-based Buffer Overflow
92
CVE Score
Critical
Heap-based Buffer Overflow
THeaderTransport::transform() compresses outgoing frames when the ZLIB transform is enabled. resizeTransformBuffer() allocates only wBufSize_ plus a fixed DEFAULT_BUFFER_SIZE margin and does not grow further once that size is reached, so the retry loop cannot enlarge the buffer. The method then copies stream.total_out bytes from the transform buffer back into the write buffer without checking that the compressed length fits. A frame that does not compress well, including data a remote peer supplied, can make the compressed output exceed that margin. The copy writes past the end of the heap write buffer, and for a large frame it also reads past the end of the transform buffer. The fix sizes the transform buffer with deflateBound() plus the existing headroom, compresses in a single pass, and grows the write buffer to the compressed length before copying the result back.
Upgrade the thrift library to the patch version.
You are affected if you are using a version that falls within the vulnerable range and a C++ client or server enables the THeaderTransport ZLIB transform for frames that contain attacker-influenced or incompressible data.
0.10.0 - 0.24.0
Fixed in 0.25.0thrift is vulnerable to Heap-based Buffer Overflow in versions 0.10.0 - 0.24.0.
Secure your code, cloud, and runtime in one central system. Connect a repo to discover what the reasoning agents find in your codebase.
No credit card required | Scan results in 32 seconds.
I consent to receiving marketing communications based on Aikido’s Privacy Policy.
SOC 2Compliant
ISO 27001Compliant
ISO 42001Compliant© All Intel data is openly available and commercially licensed.