[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:
Olivier Dony
2017-09-05 10:06:35 +02:00
parent 84f0e84d14
commit f4d541e51a
2 changed files with 3 additions and 5 deletions
+1 -4
View File
@@ -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
View File
@@ -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