Skip to content

CBOR-to-JSON: Limit how deep we process nested containers#273

Merged
thiagomacieira merged 1 commit intointel:mainfrom
thiagomacieira:CBOR_to_JSON_Limit_how_deep_we_process_nested_containers
Mar 11, 2025
Merged

CBOR-to-JSON: Limit how deep we process nested containers#273
thiagomacieira merged 1 commit intointel:mainfrom
thiagomacieira:CBOR_to_JSON_Limit_how_deep_we_process_nested_containers

Conversation

@thiagomacieira
Copy link
Member

1024 levels will probably be good enough for everyone, like cborparser.c. For those for whom it isn't, they can set the limit during the build.

We already had this for the plain parser, so TinyCBOR wouldn't cause a stack overflow in case of a malformed stream (intentionally or not) when simply parsing and advancing over the stream. This same protection wasn't applied to the content converting from CBOR to JSON.

@thiagomacieira thiagomacieira removed the request for review from dangelog March 11, 2025 17:51
1024 levels will probably be good enough for everyone, like
cborparser.c. For those for whom it isn't, they can set the limit during
the build.

We already had this for the plain parser, so TinyCBOR wouldn't cause a
stack overflow in case of a malformed stream (intentionally or not) when
simply parsing and advancing over the stream. This same protection
wasn't applied to the content converting from CBOR to JSON.

Signed-off-by: Thiago Macieira <thiago.macieira@intel.com>
@thiagomacieira thiagomacieira force-pushed the CBOR_to_JSON_Limit_how_deep_we_process_nested_containers branch from 6e8c36a to 5945ac8 Compare March 11, 2025 17:51
@thiagomacieira thiagomacieira merged commit e692445 into intel:main Mar 11, 2025
6 checks passed
@thiagomacieira thiagomacieira deleted the CBOR_to_JSON_Limit_how_deep_we_process_nested_containers branch March 11, 2025 21:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants