[IMP] http: set HTTPonly flag on session cookie
This will reinforce the framework against potential XSS exploits escalating to session hijack
This commit is contained in:
@@ -303,11 +303,8 @@ var Session = core.Class.extend(mixins.EventDispatcherMixin, {
|
||||
}).always(function () {
|
||||
self.avoid_recursion = false;
|
||||
});
|
||||
} else {
|
||||
// normal use case, just use the cookie
|
||||
self.session_id = utils.get_cookie("session_id");
|
||||
return $.when();
|
||||
}
|
||||
return $.when();
|
||||
},
|
||||
/**
|
||||
* Executes an RPC call, registering the provided callbacks.
|
||||
|
||||
+2
-1
@@ -1420,7 +1420,8 @@ class Root(object):
|
||||
# (the one using the cookie). That is a special feature of the Session Javascript class.
|
||||
# - It could allow session fixation attacks.
|
||||
if not explicit_session and hasattr(response, 'set_cookie'):
|
||||
response.set_cookie('session_id', httprequest.session.sid, max_age=90 * 24 * 60 * 60)
|
||||
response.set_cookie(
|
||||
'session_id', httprequest.session.sid, max_age=90 * 24 * 60 * 60, httponly=True)
|
||||
|
||||
return response
|
||||
|
||||
|
||||
Reference in New Issue
Block a user