-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Partial Payments Exploit and API response saying *Amount* is misleading developers #3902
Comments
I agree, the Amount field is quit ambiguous in the partial payment context. To avoid any ambiguity between developers, I guess the Amount field should define the actual delivered amount in all the cases, and some other field specify the partial payment (e.g. intended_amount). |
The |
I was referring to Amount in API GET response and not POST; should be renamed to perhaps Potential_Amount rather than keeping it Amount which is misleading, at least developer would go and search for the meaning of Potential_Amount rather than assuming Amount as final. |
We're not very familiar with how rippled API works or designed; perhaps having partial payments disabled by default with a flag/Settings similar to DisallowXRP and can be called AllowPartial; just a thought. |
This has been discussed at length and there are some significant reasons not to do this. (For one, it defeats the intended value of partial payments, which is to let you to bounce payments you didn't want back while spending as little possible extra on fees—if it's opt-in, you won't be able to send these most of the time because the people who sent you the unwanted payments probably didn't opt in.) |
I do think the most reasonable course of action would be to rename the 'Amount' Field/property to something that can be better interpreted by developers not familiar with partial payments and the exploits. Instead of changing the base class, can we not refactor the API response classes instead? |
…F#4733) Using the "Amount" field in Payment transactions can cause incorrect interpretation. There continue to be problems from the use of this field. "Amount" is rarely the correct field to use; instead, "delivered_amount" (or "DeliveredAmount") should be used. Rename the "Amount" field to "DeliverMax", a less misleading name. With api_version: 2, remove the "Amount" field from Payment transactions. - Input: "DeliverMax" in `tx_json` is an alias for "Amount" - sign - submit (in sign-and-submit mode) - submit_multisigned - sign_for - Output: Add "DeliverMax" where transactions are provided by the API - ledger - tx - tx_history - account_tx - transaction_entry - subscribe (transactions stream) - Output: Remove "Amount" from API version 2 Fix XRPLF#3484 Fix XRPLF#3902
Issue Description
Built-in API response Amount is misleading developers; perhaps common sense while reading any transaction in the world of crypto would assume that Amount in response is the Amount of XRP that is received or sent hence XRPL.org documentation is referring to these partial payments as a feature which causing a vulnerability to developers listening to Amount in API responses.
Perhaps using delivered_amount in API response is a solution for the vulnerability but doesn't solve the misleading issue and fact.
Source: https://xrpl.org/partial-payments.html#partial-payments-exploit
The text was updated successfully, but these errors were encountered: