-
Notifications
You must be signed in to change notification settings - Fork 44
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
Swaps security issue: currency/amount info #615
Comments
I'll have a PR ready for this tomorrow. |
FWIW I don't think this is a bug per se, more like functionality that is lacking. I brought this concern up in #359 , but we went with this oversimplified approach deliberately to get the basic functionality working sooner. Still, I'm thinking I should have created an issue for this right away so that we wouldn't lose track of it, it's certainly critical functionality. |
This makes each node involved in a swap determine the swap amounts and currencies (`makerCurrency`, `takerCurrency`, `makerAmount`, and `takerAmount`) independently. If there is any discrepancy in these values, the swap will fail.These values are no longer sent as part of the `SwapRequestPacket`. Previously, only the taker (who initiates the swap) would determine these values and the maker would blindly accept them. It also updates the Swap unit tests to align with the new methods and logic used in the `beginSwap` and `acceptDeal` routines. Closes #615.
This makes each node involved in a swap determine the swap amounts and currencies (`makerCurrency`, `takerCurrency`, `makerAmount`, and `takerAmount`) independently. If there is any discrepancy in these values, the swap will fail.These values are no longer sent as part of the `SwapRequestPacket`. Previously, only the taker (who initiates the swap) would determine these values and the maker would blindly accept them. It also updates the Swap unit tests to align with the new methods and logic used in the `beginSwap` and `acceptDeal` routines. Closes #615.
This makes each node involved in a swap determine the swap amounts and currencies (`makerCurrency`, `takerCurrency`, `makerAmount`, and `takerAmount`) independently. If there is any discrepancy in these values, the swap will fail.These values are no longer sent as part of the `SwapRequestPacket`. Previously, only the taker (who initiates the swap) would determine these values and the maker would blindly accept them. It also updates the Swap unit tests to align with the new methods and logic used in the `beginSwap` and `acceptDeal` routines. Closes #615.
In
OrderBook.handleSwapRequest
, the maker verifies his order availability, and accepts the deal. Further validation is applied on LND requests (validateRequests
), based on the deal info. But the deal info was never validated on the maker side. It means that the maker is blindly accepting the taker currency/amount calculation in regards to the deal.The text was updated successfully, but these errors were encountered: