Skip to content
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

cursor in /claimable_balances not validated #3085

Closed
bartekn opened this issue Oct 1, 2020 · 1 comment
Closed

cursor in /claimable_balances not validated #3085

bartekn opened this issue Oct 1, 2020 · 1 comment

Comments

@bartekn
Copy link
Contributor

bartekn commented Oct 1, 2020

What version are you using?

1.9.0

What did you do?

Request /claimable_balances with invalid cursor value. Ex: https://horizon-testnet.stellar.org/claimable_balances?cursor=1003529-00000043d380c38a2f2cac46ab63674064c56fdce6b977fdef1a278ad50e1a7e6a5e18 (hex-encoded balance id is malformed).

What did you expect to see?

400 Bad Request response.

What did you see instead?

500 Internal Server Error response.

@bartekn bartekn added this to the Horizon 1.10.0 milestone Oct 1, 2020
abuiles added a commit to abuiles/go that referenced this issue Oct 2, 2020
We do cursor validation, however, if there is an error we return a
plain error instead of a `problem.P` -- this causes horizon to handle
the error as a 500 instead of a 400.

This fix moves cursor parsing to its own method and then use it in the
query handler to return a `problem.P` error.

Fixes stellar#3085.
abuiles added a commit that referenced this issue Oct 2, 2020
We do cursor validation, however, if there is an error we return a
plain error instead of a `problem.P` -- this causes horizon to handle
the error as a 500 instead of a 400.

This fix moves cursor parsing to its own method and then use it in the
query handler to return a `problem.P` error.

Fixes #3085.
@abuiles
Copy link
Contributor

abuiles commented Oct 2, 2020

Fixed in #3088

@abuiles abuiles closed this as completed Oct 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants