콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
2 답글
17101 화면

I've been able to login my credentials by just using this kind of address in the browser "h t t p s://localhost:8080/web/webclient/login?db=MyDB&login=myusername&key=mypassword&session_id=994f75a93ac949489423368d0e528109" in which the value for the session_id is a result from connecting via JSON-RPC in C#.

However, I think no cookie is set because when I try to browse just the localhost:8080 from a different tab I am redirected to the login page and not the opened home page of the account though I have not yet logout.

I want to ask if it is possible to assign my own value for session0|sessionid or cookie using JSON-RPC in C#?

아바타
취소
베스트 답변

The web module looks for the session id in cookies variable sid. If it is not set, it looks for the request variable sid. So sending sid in request URL works just like in cookie.

The session cookie is only set by the request handler only if the response already has set_cookie which happens at login. Since you are already logged-in for this session by the JSON-RPC client, the session cookie will not be set.

Check the method Root.dispatch() in the web module.

아바타
취소
작성자

Is there a way so that i can set a cookie using the request URL?

You can create module or wsgi middle-ware that adds any cookie. The request dispatcher will always recreate the session cookie when the response has cookies. You may also modify Root.dispatch() to add response.set_cookie('sid', session.sid) in case of sid is read from url parameter.

베스트 답변

@Mohammad Alhashash your answer was (You may also modify Root.dispatch() to addresponse.set_cookie('sid', session.sid) in case of sid is read from url parameter.) and this gives the attacker the opportunity to use the session fixation method for hacking the system users by setting sid="WHATEVER_VALID_SESSION_ID" in the url.

아바타
취소
관련 게시물 답글 화면 활동
0
3월 15
6808
2
9월 20
5995
1
5월 25
1146
1
1월 23
2467
0
2월 22
3145