You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are issues with the /peer/transactionsFromIds endpoint in the p2p api:
The ids values in the query string should be restricted to a comma delimited list of valid transaction IDs, namely 64 character hex values only. But due to an error in the regex, any value longer than 32 characters, including non-hex characters, is considered valid.
Even if valid transaction ids are specified, the response contains an empty transactions array.
To Reproduce
For case 1, access an endpoint like so: /peer/transactionsFromIds?ids=12345678901234567890123456789012abcxyz!(accepted as valid when it shouldn't be)
For case 2, access an endpoint like so: /peer/transactionsFromIds?ids=098193e5b51fd172ed23b2b849851ab63b9e00b648343dab5fbc31ed5932a4ae (this is a valid tx on devnet but yields an empty array in the response if the request is sent to a devnet peer).
In both cases, the api erroneously responds with the following:
{
"success": true,
"transactions": [
null
]
}
Expected behaviour
For case 1, the id should be not be processed as it should fail the regex check.
For case 2, the transaction information should be returned. Using the example tx above from devnet, the following is expected:
Describe the bug
There are issues with the /peer/transactionsFromIds endpoint in the p2p api:
The
ids
values in the query string should be restricted to a comma delimited list of valid transaction IDs, namely 64 character hex values only. But due to an error in the regex, any value longer than 32 characters, including non-hex characters, is considered valid.Even if valid transaction ids are specified, the response contains an empty transactions array.
To Reproduce
For case 1, access an endpoint like so:
/peer/transactionsFromIds?ids=12345678901234567890123456789012abcxyz!
(accepted as valid when it shouldn't be)For case 2, access an endpoint like so:
/peer/transactionsFromIds?ids=098193e5b51fd172ed23b2b849851ab63b9e00b648343dab5fbc31ed5932a4ae
(this is a valid tx on devnet but yields an empty array in the response if the request is sent to a devnet peer).In both cases, the api erroneously responds with the following:
Expected behaviour
For case 1, the id should be not be processed as it should fail the regex check.
For case 2, the transaction information should be returned. Using the example tx above from devnet, the following is expected:
The text was updated successfully, but these errors were encountered: