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

Detect ivars in Rack middleware #15

Open
synth opened this issue Sep 20, 2022 · 0 comments
Open

Detect ivars in Rack middleware #15

synth opened this issue Sep 20, 2022 · 0 comments

Comments

@synth
Copy link

synth commented Sep 20, 2022

Instance variables in Rack middleware are bad. They are not thread safe and are insidious to track down issues relating to it.

Ref:

  1. Request responses getting swapped puma/puma#2001
  2. https://bernardoamc.com/rails-middleware-leak/
  3. https://crypt.codemancers.com/posts/2018-06-07-frozen-middleware-with-rack-freeze/

Since this is such a gotcha, I (via my company) would gladly sponsor development of such a cop to walk the middleware hierarchy and catch offenders which could occur at app level or third party.

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