Skip to content

Incorrect validation on keysend route hints #6143

Closed
@Evanfeenstra

Description

Issue and Steps to Reproduce

The param_routehint_array function here https://github.com/ElementsProject/lightning/blob/master/common/json_param.c#L953 checks if the RoutehintList is an array (JSMN_ARRAY). However the RoutehintList is actually an object that has the array of hints inside a hints field https://github.com/ElementsProject/lightning/blob/master/cln-grpc/proto/primitives.proto#L73. The param_routehint function looks like it has the same problem.

You can try it using a cln-grpc client, like in this example https://github.com/Evanfeenstra/cln-grpc-routehints-test/blob/master/src/cln.rs#L50. The exact error message is:

Routehint array routehints (\\"{\\"hints\\":[{\\"hops\\":[{\\"expirydelta\\":40,\\"feebase\\":\\"1000msat\\",\\"feeprop\\":1,\\"id\\":\\"02c7046d20f62012362ccf835fe5b4d4a1708e518592f216afeefabeadfc20154b\\",\\"scid\\":\\"1x5x1\\"}]}]}\\") is not an array

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions