Hello everyone. Welcome back. Let's take a look at
the second of your questions during the session using cookies. And how
do we secure them?
If you go back to our first Hands-On under the web section where
we were able to hijack, the session using a
feta cross-site scripting attack do for. The reason attack
was really successful is because of
the scripts that are being run on the browser capable
enough to access these cookies in
practice, even though these are saved in
the browser. It is a server who really needs them to
authenticate the session or the use
of
That is no role of these scripts reading
access for any of these cookies.
One of the way to secure than is by enabling this HTTP
flag. St. Only flag is
going to shock. The browser's saying that none of the scripts should have access
to these cookies.
Some of the other parameter that
we are looking at is a secure flag.
As we have already discussed that is action. ID should be treated as
passwords. That means these are highly sensitive any
sensitive information should never be sent in
plain traffic. That means
you should always be sent using secure protocols only.
By enabling this particular flag. We are instructing
the browser to only send this cookies. Whenever
the connection between the browser and
the server is done using HTTP protocol
by doing. So we are avoiding
multiple mathml attack and
the scenarios one really accesses.
The browser's on Open Wi-Fi
networks such as Cafe.
One of the important factor for any cookie. Is that
how do we expand
them? This is one particular topic. I
would like to touch base on.
Taking a scenario, especially in social media
websites, where the purse is the session
for a longer point of time.
That is because none of the users accessing the social
media multiple times in a day would want to enter
the credentials every time you access those. So
those are those business requirements, but
now it is about keeping the balance between the
business use case and Security in
place. If we have a session expiring for
a longer duration of time, we do give a
large amount of window for the attacker to gain
access to the sessions.
Could be multiple attack vectors that we looked at for example performing
brute force or performing very similar attack scenarios
and getting access.
The same time, if we Implement a very
short window of expiring the sessions that
becomes a trouble for the user to
always re-authenticate and position.
Either ways. This is something we need to take
into consideration and we can use this flag to
put out a certain window as to
how much should the session be valid. And that is something we
always need to enable.
The last parameter that I would like to talk about is the
same site and two main parameter.
So by setting this values, we are instructing saying
that which particular domains should
cookie be passed in today's scenario.
All the websites are quite complex where
there is a use case of multiple websites, accessing
the cookies between each other.
As long as there's a valid business case and always passes,
cookies, and that is where this particular parameter is
going to enable security.
Maybe Define the domains as to
whom should the cookie impasse to
and so that they can consume and authenticate the user.
That's it for this video. Thank you.