ugorji / go

idiomatic codec and rpc lib for msgpack, cbor, json, etc. msgpack.org[Go]
MIT License
1.83k stars 294 forks source link

CBOR: Reject malformed and invalid indefinite-length strings #405

Closed benluddy closed 8 months ago

benluddy commented 9 months ago

Tests and potential fix for https://github.com/ugorji/go/issues/403 and https://github.com/ugorji/go/issues/404.

Makes decode return a error if a byte string is nested within an indefinite-length text string, or a text string is nested within an indefinite-length byte string. Separately, if the decode option ValidateUnicode is enabled, it will also apply to text strings that are nested within an indefinite-length text string.