Open StarGeezerPhil opened 5 months ago
Suggested change to basic_transer.go https://github.com/deso-protocol/backend/blob/e6eadebc934e18f6c3e6c595b03fa8bef6a40c7d/scripts/tools/toolslib/basic_transfer.go
func _generateUnsignedSendDeSo(senderPubKey *btcec.PublicKey, recipientPubKey *btcec.PublicKey, amountNanos int64,
params *lib.DeSoParams, node string) (*routes.SendDeSoResponse, error) {
**if !amountNanos || amountNanos <= 0 {
return nil, errors.New("_generateUnsignedSendDeSo() invalid AmountNanos: must be a positive integer")
}**
endpoint := node + routes.RoutePathSendDeSo
Very interesting. We're taking a look at this now.
Pull request with validation: @diamondhands0
@StarGeezerPhil this should be fixed now. It looks like the mempool was failing to reject txns with an invalid signature (the amount being zero was actually a red herring). Can you try submitting the txns again to node.deso.org and lmk your results?
It appears that malformed BASIC_TRANSFER transactions that do not include AmountNanos are not rejected by backend and can be signed and submitted into the mempool.
However, these transactions do not appear to be then accepted and mined into the chain.
@lazynina @diamondhands0 my concern is that this leaves us open to a vulnerability where the mempool could become hijacked in a DOS-type attack/clog the mempool entirely - that could overwhelm nodes and validators.
Here are the details - transactions created by user DiamondThumb:
This is his example payload provided:
Example transactions crash the blockchain explorer: https://explorer.deso.com/txn/3JuEUQSXue97tHWVrRidZC1GUU1Qdau78YskxHGukxByz1g6xxNCCo https://explorer.deso.com/txn/3JuETYrJjmN8LV1tvCfcZdsvMpNzB8pjzhQzAJ2BsojgcQJic4QkFu https://explorer.deso.com/txn/3JuETB3wvCm1UQ8bFNU7uRmoWZ9hE621e4waJDYzNDeYs5a9kfb41x https://explorer.deso.com/txn/3JuETt6hMbiYtrkAFUb1pVqWhwLj1xroXdmWbYmZzpY1SN7WKsFZua
Here is the verbose transaction details for the first example from my front-end:
DiamondThumb's thread regarding his issue here: https://desocialworld.com/posts/20891c713fe091a02b4bd556b4f2cfeef4a758ec6fdf5a7f3522317d6557ee9e