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

Security issue: Panic on invalid base62-encoded tokens #24

Closed
brycx opened this issue Nov 29, 2020 · 1 comment
Closed

Security issue: Panic on invalid base62-encoded tokens #24

brycx opened this issue Nov 29, 2020 · 1 comment

Comments

@brycx
Copy link
Collaborator

brycx commented Nov 29, 2020

Documentation for decode(), which also implicitly covers Branca::decode(), states that:

If the input is not in Base62 format, it returns a BrancaError::InvalidBase62Token Result.

Prior to v0.10.0 this was not the case, instead a panic would occur:

let decoded_data = b62_decode(BASE62, &data).expect("Base62 token is invalid.");

This could leave any validating instance vulnerable to potential DoS, when parsing untrusted data and unexpected panics could occur.

This behavior was corrected in 7da3274:

let decoded_data = match b62_decode(BASE62, data) {

@brycx
Copy link
Collaborator Author

brycx commented Nov 29, 2020

I will file an advisory with RustSec for this issue, but will leave the decision of yanking affected versions up to @return.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant