core-lightning/contrib/pylightning/lightning
Christian Decker ac6d9b34cc pylightning: Correctly return the remainder of a message back
We read a JSON message from the buffer, after converting it from raw bytes to
UTF-8, and returning the remainder of the byte array back to the
caller. However the return value of `raw_decode` refers to symbols in the
UTF-8 decoded string, not the raw bytes underlying byte-array, which means
that if we have multi-byte encoded UTF-8 symbols in the byte-array we end up
with a misaligned offset and will return part of the message as
remainder. This would then end up being interpreted as the result of the next
call.

This could not be exploited currently since we use a socket only for a single
JSON-RPC call and will close the connection afterwards, but since we want to
eventually recycle connections for multiple calls, this could have been very
dangerous.

Signed-off-by: Christian Decker <decker.christian@gmail.com>
Reported-by: Corné Plooy <@bitonic-cjp>
2019-02-18 02:10:43 +00:00
..
__init__.py pylightning: Added a tiny library for python plugins 2018-12-15 15:04:32 +01:00
lightning.py pylightning: Correctly return the remainder of a message back 2019-02-18 02:10:43 +00:00
plugin.py pylightning: handle method introspection more generally. 2019-02-07 20:33:50 +00:00
test_plugin.py pylightning: Better inject arguments in plugin method calls 2019-01-08 17:37:00 +01:00