[
https://issues.apache.org/jira/browse/THRIFT-6032?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Jens Geyer resolved THRIFT-6032.
--------------------------------
Fix Version/s: 0.24.0
Assignee: Jens Geyer
Resolution: Fixed
> Harden OCaml protocol negative sizes
> ------------------------------------
>
> Key: THRIFT-6032
> URL: https://issues.apache.org/jira/browse/THRIFT-6032
> Project: Thrift
> Issue Type: Bug
> Components: OCaml - Library
> Reporter: Jens Geyer
> Assignee: Jens Geyer
> Priority: Major
> Fix For: 0.24.0
>
> Time Spent: 20m
> Remaining Estimate: 0h
>
> The OCaml library does not validate negative sizes when reading Thrift
> payloads.
> Size values appear in binary/string fields and in map/list/set headers. Those
> values must be non-negative. In {{TBinaryProtocol.ml}}, the {{readString}},
> {{readMapBegin}}, {{readListBegin}}, and {{readSetBegin}} methods read a size
> via {{readI32}} and use it without any negative check.
> This is a protocol hardening gap compared with other runtimes such as C++,
> Java, Python, Go, and Node.js, which all raise a NEGATIVE_SIZE exception.
> The fix should add negative-size checks that raise a TProtocolException in
> all container and string/binary read paths.
> See THRIFT-6025 for the equivalent Ruby fix.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)