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

WARNING: Security bypass in multi threaded environments #2

Open
ST-DDT opened this issue Nov 11, 2018 · 3 comments
Open

WARNING: Security bypass in multi threaded environments #2

ST-DDT opened this issue Nov 11, 2018 · 3 comments

Comments

@ST-DDT
Copy link

ST-DDT commented Nov 11, 2018

According to SO each grpc callback can be triggered by a different thread, thus setting and clearing the security context only in the interceptor's startCall may lead to other threads picking up the security contexts. grpc avoided the issue for their contexts with this interceptor

I could observe rare / random security exceptions with an interceptor that works similar to the ones used in this repository. The likelihood of these exceptions increased by running more requests (both authenticated and non-authenticated) in parallel and running on slower/busier CPUs.

Is the SO overflow answer wrong or is this demo affected by this?

@alexleigh
Copy link
Contributor

Yes, this demo is indeed affected by this issue. It is something I have been intending to fix but unfortunately haven't had the time to fix.

@ST-DDT
Copy link
Author

ST-DDT commented Nov 12, 2018

See https://github.com/yidongnan/grpc-spring-boot-starter/pull/126 for my attempt to fix the concurrency issue (for a different grpc-spring library though).

@alex-lzl
Copy link

See yidongnan/grpc-spring-boot-starter#126 for my attempt to fix the concurrency issue (for a different grpc-spring library though).

This concurrency issue is terrible, you can easily reproduce it by sending concurrent requests to the server. This means the demo shouldn't be used by anyone for any purposes.

@ST-DDT 's fix is live in net.devh:grpc-spring-boot-starter:2.2.0.RELEASE. Everyone should switch to that. THANK YOU!

@ST-DDT ST-DDT changed the title Security bypass in multi threaded environments? WARNING: Security bypass in multi threaded environments Jun 24, 2020
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

3 participants