-
-
Notifications
You must be signed in to change notification settings - Fork 28
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
no more possible to force accepting a transfer #211
Comments
This was not intentional. Can you provide a specific information which function signature is not there anymore? |
During this commit range
the |
Ok, I see now: the new methods take |
I have looked into the code but couldn't find the |
Sorry, when answering to the issue I was on BTC Prague and answered from the phone with no ability to check. I recall I had an intention to do such method, but I was not able to find it in the standard library. So I just made one: #221 |
I tried to use the new To me this means that |
I've tried the After using |
I had a discussion with @nicbus in chat where I explained to him why accepting unverified consignment in funding channel is a security vulnerability and must not be done. The plan that he would discuss that internally with all of you and than close that PR. By all means this method is unsafe in terms of type safety and I am for closing #221 without merging: the method is not needed. |
That discussion led to us checking the behavior of the resolver when accepting a transfer and that's how we discovered that an electrum resolver refactor introduced a bug where it would panic when a transaction was not found, instead of returning it as Let's look at an example of what we're doing:
So the method is needed and does not pose any additional risks compared to other cases where it's not used, not even RGB type safety. |
My point is that even if you do not misuse the method, others may misuse it. It is wrong to ship a library with a method which can be easily misused creating security vulnerability. What I would recommend is just do a dedicated resolver wrapping the electrum resolver, name it |
That's not the case. Anyone can modify the code to produce a Moreover this can be mitigated with good documentation. For example, rust-bitcoin has an
This approach is cumbersome and doesn't add any security, as the reality is that the transaction has not been broadcast and there can be no guarantee that the exact same transaction would be broadcast in the future. Validating the consignment using "fake" data provided by a modified resolver doesn't improve anything. |
@dr-orlovsky did I understood correctly that your main objection here is that some users may misuse the method? If so it doesn't seem to be a strong motivation as good documentation should prevent mistakes from the users. If we were to apply the same logic everywhere we would probably find a lot of other ways in which a user can misuse an RGB library. |
Well, it is not just a misuse, it is (1) there is no single reason for this method to exist and (2) if it exists it opens a direct security vulnerability. From what I understood this method is not needed for RGB LN node - and if it is still needed it means the node has a security issue. Under no circumstances an unvalidated consignment should be accepted (the only exception is penetration testing). |
This method is needed, as already explained:
It doesn't open any security vulnerability, as already explained:
It seems like your understanding is that it's not needed because the same effect can be achieved by using a custom resolver that provides fake transaction data. This is not different from having this method and changes nothing on the security side. Using a custom resolver is just another way to force the consignment validation to succeed. From my understanding of the matter, I conclude that:
|
Yes. That is the only right and secure method of doing it.
No it does. Your arguments are superficial:
First, this is not about performing an attack, but about footguns for the users of this library. Second, by the same logic you can add any hacky function to secp245k1 as well, saying otherwise it will be added anyway just by forking the library
There is a difference between "footgunny API" which can be simply misused (and docs do not protect from that) and a well-aware unsafe rust with pointers etc. Sure we can just merge this PR or add any other hacky function you need to the system, but I do believe this is a very bad practice. Thus, if you insist, you can disregard my opinion and merge this PR by yourselves - I will give you the rights to do that (if you do not have that already). But again, my experience of working with Blockstream team on libraries like |
I think it's ok to have the |
For the history record, I am strongly against having and using this method, since it violates the security model. Details: #211 (comment) Strong conceptual NACK on merging this PR
For the history record, it wasn't "lost functionality", it was "removed bug" @nicbus I have added you to the maintainers, it should work for you now and you should be able to merge. I pushed commit 63c3f5d so you can merge the PR as is. In any way, please keep my comment there |
Thanks for that. Anyway I won't be merging that PR, see my comment there. As a recap, after we had discussions elsewhere, this is no more an issue as the solution provided in #233 is a much better alternative and has already been confirmed to work as intended, so I'm closing this. |
With beta 5 it was possible to accept a transfer with the
force
boolean, with beta 6 this possibility has been removed. @dr-orlovsky I don't recall this being communicated or discussed. This breaks our Lightning Network node so please re-introduce this ASAP (to be included in the next beta release).The text was updated successfully, but these errors were encountered: