Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make invoice's s flag mandatory ? #809

Closed
ariard opened this issue Oct 20, 2020 · 13 comments
Closed

Make invoice's s flag mandatory ? #809

ariard opened this issue Oct 20, 2020 · 13 comments

Comments

@ariard
Copy link
Contributor

ariard commented Oct 20, 2020

See CVE 2020-26896 for context.

@cdecker
Copy link
Collaborator

cdecker commented Oct 26, 2020

While technically not possible without breaking backward compatibility (recipient has no idea whether the sender supports it) I think at this point it's unlikely to be a major issue, since all implementations support this feature by now.

@t-bast
Copy link
Collaborator

t-bast commented Oct 26, 2020

We could test the current network for nodes that don't advertise payment_secret and see what percentage of the network would be negatively impacted before we decide.

@t-bast
Copy link
Collaborator

t-bast commented Nov 3, 2020

I've run this against our current network DB.
I have 5667 node announcements, but only 3090 of those advertise support for payment_secret...

@Roasbeef
Copy link
Collaborator

Roasbeef commented Nov 7, 2020

Well the only nodes that matter are those sending nodes. Which are usually mobile phones, so they aren't counted in the public node feature bit count.

Tentatively, lnd plans to flip this to required in all our invoices for our next upcoming release (drops this month).

@t-bast
Copy link
Collaborator

t-bast commented Nov 9, 2020

It's a good point, node_announcements aren't a good measure, we don't really care whether intermediate routing nodes support it or not. Better would be to get in touch with wallets then, I'll try to contact some of them.

@cfromknecht
Copy link
Collaborator

While technically not possible without breaking backward compatibility (recipient has no idea whether the sender supports it)

IIRC the rationale behind invoice features was to skirt this issue so that it's now a soft error (feature bit incompatibility) rather finding out after making a payment attempt. As long as senders support invoice features they will at least be given a feature bit error rather than an ambiguous payment error after making an attempt.

I'd be very surprised to find folks running economically-relevant nodes that do not have sender-side payment secret support. Even if there are a few, I can't imagine a better use case for flipping a feature to required (slightly) prematurely than for a security-critical feature that prevents loss of funds in transit.

I personally wouldn't lose any sleep over choosing to protect all economically-active receivers at the expense of a handful of senders that haven't done a software update in over a year. After all, it's the receiver's money that continues to be at stake if we continue to delay for stragglers that otherwise have no real incentive to upgrade.

Better would be to get in touch with wallets then, I'll try to contact some of them.

Any updates on this? :)

@cfromknecht
Copy link
Collaborator

One question that came up while implementing this is what error to return when a legacy payment hits an invoice requiring payment secrets. My first thought was to continue overloading incorrect-payment-details, maybe there's a better approach?

@t-bast
Copy link
Collaborator

t-bast commented Nov 19, 2020

My first thought was to continue overloading incorrect-payment-details

That's what we do as well. As you stated before, it would only happen for very old senders who don't even understand the required feature bit in the invoice, so I think it's an ok behavior.

I personally wouldn't lose any sleep over choosing to protect all economically-active receivers at the expense of a handful of senders that haven't done a software update in over a year. After all, it's the receiver's money that continues to be at stake if we continue to delay for stragglers that otherwise have no real incentive to upgrade.

I completely agree, I would also be in favor of setting this to required.

Any updates on this? :)

It looks like Breez and BLW correctly support payment_secret, and I'd be surprised if zap didn't.
I don't know anyone at other wallets, maybe if someone can ping BlueWallet and WalletOfSatoshi, we'd have a pretty good percentage of wallet users covered?

@Roasbeef
Copy link
Collaborator

BlueWallet and WoS both use lnd, and assuming they observed the latest CVE they're running 0.11. So far we're planning on enabling it by default (to require the mpp payload) in 0.12. We're doing it in a manner that'll still l et any old invoices that are non-expired that only had the optional bit set be settled still.

@t-bast
Copy link
Collaborator

t-bast commented Aug 10, 2021

Most implementations have made this mandatory in their latest releases, so I think we can (finally) close this issue! 🎉

@t-bast t-bast closed this as completed Aug 10, 2021
@TheBlueMatt
Copy link
Collaborator

TheBlueMatt commented Aug 10, 2021 via email

@t-bast
Copy link
Collaborator

t-bast commented Aug 10, 2021

Don't you think having most nodes on the network advertise it as required is enough? It will prevent nodes that don't support it from even connecting to the network.

But we can also add it to the spec, maybe bundle it with this change #887 that updates the Bolt 11 test vectors to contain a payment_secret? I'll give that a go.

@t-bast
Copy link
Collaborator

t-bast commented Aug 10, 2021

@TheBlueMatt done in ec1d4dc, let me know if that sounds good

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants