Skip to content

Fixing issue with ZEPPELIN-173: Zeppelin websocket server is vulnerab… - #205

Closed
djoelz wants to merge 3 commits into
apache:masterfrom
djoelz:master
Closed

Fixing issue with ZEPPELIN-173: Zeppelin websocket server is vulnerab…#205
djoelz wants to merge 3 commits into
apache:masterfrom
djoelz:master

Conversation

@djoelz

Copy link
Copy Markdown

Fixing the socket cross-origin vulnerability as described in the Jira. Overwrote the checkOrigin in the WebSocketServlet class implemented by NotebookServer so that a list of all seen socket Get requests are kept and only Upgrade requests from the same origin will be accepted. Otherwise unauthorized will be returned.
Included basic unit tests.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you explain little bit, why this if condition can be removed??

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's a merge issue as I did not remove it. Let me double check

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixing in the next commit. Please review when you have time.

@Leemoonsoo

Copy link
Copy Markdown
Member

Tested and working nicely. Thanks for the contribution!

@djoelz

Copy link
Copy Markdown
Author

I have fixed the merge issues and recommitted. Ready for your review.

Thanks,
Joel


From: Lee moon soo notifications@github.com
Sent: Thursday, August 13, 2015 9:20:05 AM
To: apache/incubator-zeppelin
Cc: Joel Zambrano
Subject: Re: [incubator-zeppelin] Fixing issue with ZEPPELIN-173: Zeppelin websocket server is vulnerab… (#205)

Tested and working nicely. Thanks for the contribution!


Reply to this email directly or view it on GitHubhttps://na01.safelinks.protection.outlook.com/?url=https%3a%2f%2fgithub.com%2fapache%2fincubator-zeppelin%2fpull%2f205%23issuecomment-130748871&data=01%7c01%7cjoelz%40microsoft.com%7c8b71ee668dd34c8e280708d2a3fb0e00%7c72f988bf86f141af91ab2d7cd011db47%7c1&sdata=ulufWnZiCgXfeRlodVWtuiUPUk0fi81urTN4V4uiJiA%3d.

@Leemoonsoo

Copy link
Copy Markdown
Member

Thanks, LGTM.

@djoelz

Copy link
Copy Markdown
Author

Great! Next step is to merge? Who does this?

@Leemoonsoo

Copy link
Copy Markdown
Member

Next step is, getting more review and votes, or waiting for enough time to have discussions and consensus (which is normally take a day at least). Then it's going to be merged.

@philwills

Copy link
Copy Markdown

Not sure if it's best to comment here, or open a new issue, but

java.net.InetAddress.getLocalHost().getHostName();

isn't going to return all possible addresses which a node might reasonably be listening on. For instance, on an EC2 node, this will return the private IP, but if you want to connect to that node from outside of Amazon's network, that address won't be visible, where as the public address will.

I think there needs to at least be the option of setting an alternative value in config.

@corneadoug

Copy link
Copy Markdown
Contributor

We got a similar problem, can't complete websocket handshake in some instalations since this commit

@Leemoonsoo

Copy link
Copy Markdown
Member

@philwills@corneadoug Right, i'll create a patch, soon. Thanks!

@djoelz

Copy link
Copy Markdown
Author

@Leemoonsoo can I suggest alternativeallowedsource as the configuration name? Also this will be used for my other pull request that affects REST endpoints as well.

I could implement it also if you want. have you started already?

@Leemoonsoo

Copy link
Copy Markdown
Member

@djoelz If you can implement, that would be really appreciated!

@djoelz

Copy link
Copy Markdown
Author

@Leemoonsoo@jonbuffington is already doing the work. I will work closely with Jon to wrap this up.

Thanks Jon!

@djoelz

Copy link
Copy Markdown
Author

I have a fix for this. Will create the PR soon

@jitenderaswani

Copy link
Copy Markdown

Looking forward to this fix, I am unable to run Zeppelin in AWS. On my local machine, I don't have web-socket issue.

@LeemoonsooLeemoonsoo mentioned this pull request Aug 20, 2015
@Leemoonsoo

Copy link
Copy Markdown
Member

@djoelz I also pushed a fix. @djoelz, @jitenderaswani please review #233.

Leemoonsoo pushed a commit to Leemoonsoo/zeppelin that referenced this pull request Sep 17, 2015
Fixing the socket cross-origin vulnerability as described in the Jira. Overwrote the checkOrigin in the WebSocketServlet class implemented by NotebookServer so that a list of all seen socket Get requests are kept and only Upgrade requests from the same origin will be accepted. Otherwise unauthorized will be returned.
Included basic unit tests.
Author: joelz <djoelz@gmail.com>
Author: djoelz <joelz@microsoft.com>
Closesapache#205 from djoelz/master and squashes the following commits:
08ff369 [djoelz] unecessary file
013f22d [joelz] Fixing issue with ZEPPELIN-173: Zeppelin websocket server is vulnerable to Cross-Site WebSocket Hijacking
ea54b55 [joelz] Fixing issue with ZEPPELIN-173: Zeppelin websocket server is vulnerable to Cross-Site WebSocket Hijacking
(cherry picked from commit d5ab911)
Signed-off-by: Lee moon soo <moon@apache.org>
lelou6666 pushed a commit to lelou6666/incubator-zeppelin that referenced this pull request Mar 25, 2016
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@djoelz@Leemoonsoo@philwills@corneadoug@jitenderaswani@djoelz-tssr