darconeous / libnyoci

A flexible CoAP stack for embedded devices and computers. RFC7252 compatible.
Other
27 stars 10 forks source link

SECURITY: Address issues discovered by fuzzing #12

Closed darconeous closed 6 years ago

darconeous commented 6 years ago

Bruno Menlo was doing some independent security research and discovered several reproducible crashes and one hang on the nyoci-plugtest-server program. One of the bugs was a buffer overflow due to the misuse of the nyoci_inbound_get_path() API by nyoci-plugtest-server, which is likely exploitable.

These changes address these bugs. However, I've determined that it is way too easy to misuse the nyoci_inbound_get_path() API, so I have changed it to include a maxlen parameter. Since this is an API change, I've incremented the configuration index. Any program which uses the NYOCI_LIBRARY_VERSION_CHECK() or nyoci_inbound_get_path() will need to be recompiled after this change.

Thanks Bruno for reporting this!