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

FastRender + page caching = security hole? #145

Open
shilman opened this issue Oct 19, 2015 · 6 comments
Open

FastRender + page caching = security hole? #145

shilman opened this issue Oct 19, 2015 · 6 comments

Comments

@shilman
Copy link

shilman commented Oct 19, 2015

Suppose I am running FastRender on a page that does not require the user to be logged in. Furthermore, suppose I am using a CDN or some other intermediate page cache to improve my page load performance.

Now, suppose a logged-in user Alice accesses that page. FastRender will insert Alice's loginToken into the page head, and the page will be cached.

Next, suppose another user Bob accesses the cached page. Bob will then have access to Alice's loginToken, and can therefore access the site as Alice.

If this is correct, FastRender should never be used in conjunction with page caching. Or am I misunderstanding something about FastRender and/or Meteor security?

Thanks for your help.

@avalanche1
Copy link
Contributor

as far as I know, FR doesn't inject loginToken alongside with user data..
You can check this by Meteor.user() in the console.

@arunoda
Copy link
Contributor

arunoda commented Oct 26, 2015

It's depends. We send the loginToken, if it comes with the cookie. (We can do it better). So, if you cached a loggedIn users page(even if it's a public page), it will have issues.

If you cached a non-logged user's page that won't have any issues.

@shilman
Copy link
Author

shilman commented Oct 26, 2015

Thanks for the response @arunoda -- I think this is a pretty serious issue and I'm surprised that more people haven't made a fuss about it. I guess this is a great reason to transition to SSR as quickly as possible. Thanks for being a trailblazer on both fronts! 😄

If I come up with any good workarounds/practices as I work through this, I will post them here.

@avalanche1
Copy link
Contributor

@arunoda, could you elaborate on if it comes with the cookie and how to circumvent this?

@arunoda
Copy link
Contributor

arunoda commented Oct 26, 2015

FR set the loginToken into the cookie once loggedIn. Then every request to server carries the login token. That's how it identify the user.

@theodorDiaconu
Copy link

I'm almost sure there is nothing in this world that offers page caching for logged in users. As different people may see different results based on their role/data access restrictions on the same route.

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

4 participants