Implementation Note: The byte value 0xFF may also occur within an
option length or value, so simple byte-wise scanning for 0xFF is
not a viable technique for finding the payload marker. The byte
0xFF has the meaning of a payload marker only where the beginning
of another option could occur.
But the uoscore-uedhoc lib uses this technic to calculate size of options buffer:
This is a bug and may can be exploited for to attack the device (I am not a security expert - just a hunch). The only valid option to calculate size of all COAP options is to parse them properly.
Hi,
COAP RFC, in the chapter 3. Message Format says:
But the uoscore-uedhoc lib uses this technic to calculate size of options buffer:
https://github.com/Fraunhofer-AISEC/uoscore-uedhoc/blob/0b31e1618dadfdbcc81eb81ed7e10b811e2543ba/modules/oscore/src/coap.c#L253
This is a bug and may can be exploited for to attack the device (I am not a security expert - just a hunch). The only valid option to calculate size of all COAP options is to parse them properly.