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

Claims Validation Error #62

Closed
schmidtw opened this issue Mar 3, 2017 · 6 comments
Closed

Claims Validation Error #62

schmidtw opened this issue Mar 3, 2017 · 6 comments

Comments

@schmidtw
Copy link
Member

schmidtw commented Mar 3, 2017

If you pass in a nasty claim you can bypass the protection.

/api/v2/device/mac:112233445566/stat?ignore-me=/api/v2/device/mac:112233445566/hook
or
/api/v2/device/mac:112233445566/stat/../../../../../api/v2/device/mac:112233445566/hook

@ilawjr
Copy link

ilawjr commented Aug 8, 2018

This issue is still valid.

kcajmagic pushed a commit to kcajmagic/webpa-common that referenced this issue Aug 9, 2018
- fixes issue xmidt-org#62
- update handling of paths by parsing it through the url package
- added tests to validate claims and weird paths
@kristinapathak
Copy link
Contributor

Closing this issue, but will investigate and possibly open a new one in the bascule repo.

@kristinapathak
Copy link
Contributor

This is still an issue in the basculechecks package:
https://github.com/xmidt-org/webpa-common/blob/master/basculechecks/basculechecks.go#L59

instead of matching anywhere in the string, we need to be more judicious about how we are matching, to ensure the requester is authorized to access the endpoint.

@kristinapathak kristinapathak added the hacktoberfest good issue for hacktoberfest label Sep 30, 2019
@kristinapathak kristinapathak removed the hacktoberfest good issue for hacktoberfest label Nov 1, 2019
@kristinapathak
Copy link
Contributor

The first case is dealt with from using the URL EscapedPath() function, which doesn't include parameters:
https://golang.org/pkg/net/url/#URL.EscapedPath

Still working on a fix for the second case and making our regex more picky.

@kristinapathak
Copy link
Contributor

Going to see what more needs to be done for this issue, if anything.

@kristinapathak
Copy link
Contributor

This issue has been fixed.

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

4 participants