[
https://issues.apache.org/jira/browse/PROTON-2954?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18104246#comment-18104246
]
ASF subversion and git services commented on PROTON-2954:
---------------------------------------------------------
Commit 70c1c58da2f348030f5f4ea9ace476d0f6b30fa6 in qpid-proton's branch
refs/heads/main from Andrew Stitcher
[ https://gitbox.apache.org/repos/asf?p=qpid-proton.git;h=70c1c58da ]
PROTON-2954: Limit memory use in decoding performative properties
* Introduce a new pn_data_set_decode_limits API which limits the number
of nodes and the amount of buffer memory that can be used for decoding
an AMQP value.
* The default on making a new pn_data directly is not to limit the memory use.
This is because the users application has full control of any pn_data
made like this and is in full control of its value. If this pn_data is
going to be used for values coming from an unknown source then its
memory use can be limited explicitly.
* When the API itself creates pn_data instances to decode protocol
fields and pass them to the user then it will impose memory limits to
ensure application robustness:
- The amount of buffer memory that can be used when decoding property values
in performatives to the size of the raw memory in the property list. The
number of nodes is limited to 1024
- For a value read directly from a message again the buffer memory is
limited by the raw data size being decoded, but there is no limit to
the number of nodes.
> Decoding AMQP value into pn_data_t instances can use a lot of memory
> --------------------------------------------------------------------
>
> Key: PROTON-2954
> URL: https://issues.apache.org/jira/browse/PROTON-2954
> Project: Qpid Proton
> Issue Type: Bug
> Components: proton-c
> Affects Versions: proton-c-0.40.0
> Reporter: Andrew Stitcher
> Assignee: Andrew Stitcher
> Priority: Major
> Fix For: proton-c-0.41.0
>
>
> Proton has limited ways to bound the amount of memory used when decoding peer
> controlled AMQP values into a pn_data_t structure.
> There are 2 parts to the structure that use space: A list of nodes which
> represent the structure of the data and a backing buffer for some of the
> types of value which are variable length or long like strings or binary data.
> There *is* a limit to the number of nodes which is 65535 in the current code,
> but that still equates to a lot of memory used for he nodes; but there
> currently is no limit to the memory used for the backing data.
> This could cause problems with malformed or malicious input data.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]