Skip to content

bug: cln-plugin cannot properly parse IP addresses #6795

@sr-gi

Description

@sr-gi

Looks like IP addresses passed to lightning-cli through cln-plugin are interpreted as numbers instead of strings, making the plugin manager fail to parse them and, therefore, crashing the plugin.

This applies to all possible ways to pass the argument as long it is passed by itself, that is, by position and by key, but not formatted in a string with other values such as "id@ip:port".

Notice this does not only apply to IPs, but also to any value formatted like x.y.z where {x, y, z} $\in N$. The reason seems to be that the backend interprets x. as a number, no matter what comes after.

How to reproduce

This can be easily tested by passing an IP to lightning-cli using a plugin that uses the rustlang plugin library. You can find a minimal reproducible example at: https://github.com/sr-gi/cln-passip.

In order to reproduce this you simply need to add cln-passip as a plugin and call:

lightning-cli passip 1.2.3.4

Or any other combination of dotted values provided the expression has more than one dot.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type::BugAn error, flaw, or fault that produces an incorrect or unexpected result

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions