Live data from Hacker News

Short session expiration does not help security

sjoerdlangkemper.nl

71–80 of 434 posts

Re: Short session expiration does not help security

#71

I use one website semi regularly that has what feels like a 5 minute session expiration, but is actually probably 10 minutes. The session expires even if you are actively using it. Drives me nuts. But not nuts enough to write in and complain. Maybe I should send them this article ;-)

Let me guess... is it a bank? One of mine's does it (expires session after a few minutes, even actively using it).

I find that bank websites usually follow completely opposite ways regarding to security than any other industry: very short passwords, only digits, not encrypted in db (some sites ask for single positions), mandatory password input by virtual keyboard, cannot use password managers, not using 2FA or only allowing SMS instead of TOTP or other methods, etc...

Re: Short session expiration does not help security

#72

Earlier quoted context omitted.

On what services? I’m not an iOS dev, but I just haven’t been hit with this on apple services as a user.

Apple's web properties are so, so bad. They clearly don't invest in anything that isn't a native iOS / MacOS app.

They don't really invest in native Mac apps now either.

Re: Short session expiration does not help security

#73
post #8

> Also, it would be better to protect against this by securing the logs or using hard drive encryption. This one line is emblematic of the flaws in the article. My take on the article is, “Imagine that everything else in a system is done correctly, and the system, overall, is perfectly secure. In this imaginary world, short sessions don’t help.” One fact about security which you cannot avoid is that any one particula…

> Short sessions are there because there are various ways that sessions could be compromised. You haven't actually addressed either of the author's points, though. Namely: 1: A short compromised session is still a compromised session. The duration usually does not prevent the attacker from achieving their goal. 2: The vast majority of ways to compromise a session already give you access far beyond that session itself…

> A short compromised session is still a compromised session. The duration usually does not prevent the attacker from achieving their goal.

I'm a bank robber, I want to steal your money without you knowing so I'm not caught.

What would be a better way to do that? Withdraw $1000 immediately or to spread out that withdrawal over several months.

A short token forces the $1000 withdraw immediately. And one common way these tokens are compromised is a scammer getting Grandma to open the developer console so they can "fix" things.

> The vast majority of ways to compromise a session already give you access far beyond that session itself (ex: you have user access on a local machine, or physical hardware access, or you're an admin who manages that user, etc/etc/etc). So an expired session is, at most, a small speed bump in those cases.

Or you are employing the common scam above, screen sharing under the guise of helping.

Granted, some of the calculus needs to be "what type of app is this? What does compromise mean?".

> The most secure application runs completely isolated, with no input or output, and is totally, utterly useless. But no worries - it's secure!

I didn't take this as what the op was saying.

Security works in layers and good security imagines that other layers don't exist or might have been compromised. In your ship analogy, that's adding a second hull, putting airtight sections between hull locations, and having lifeboats.

You wouldn't eject the lifeboats because "we have two hulls, what could go wrong!"

The actual cost of doing this is generally developer time.

There are certainly practicality limits, but in general a layered approach to security is how you both increase security and decrease compromise impact.

Re: Short session expiration does not help security

#74

In real world, security is done by a bunch of nearly clueless people hoping to put enough hard enough roadblocks to make it practically not worthwhile for you to hack in. If you don't have mathematically secure solutions, session expiration and similar are the imperfect tools you use to solve your problem. One beef I have with short session expiration, though, is that in many cases it causes people to degrade securit…

> One beef I have with short session expiration, though, is that in many cases it causes people to degrade security.

One counterpoint—if sessions last too long, then I forget the password, and reset the password. If sessions are too short, then I choose an insecure password. Neither option is great for security!

Talking about systems for which a password manager doesn’t make sense, like your lock screen password.

Re: Short session expiration does not help security

#75
post #55

Earlier quoted context omitted.

> Nonsense, defence in depth is a core security principle. You should not rely on a single control to protect you. And you should not prioritize security over the goal of the product. The conversation is a discussion of relative value and tradeoffs. Does increasing security make the tool as a whole worse? Sometimes - the answer is yes. I have a nice set of front windows, but that means a risk of someone breaking thro…

Don’t prioritize security if the root cause of the security breach is someone is getting access to the session tokens not that the server session tokens are arbitrarily too long. that attack might happen once ever and it doesn’t really matter if they have five or 10 minutes you’re still screwed because they can just go get another session token next time and be prepared. Optimize the application to run the best for a…

"Optimize the application to run the best for all the users first and then adjust the security implementation as necessary. Otherwise, you could DoS yourself by trying to be too secure. "

I think it depends what kind of buisness you are running and what a security breach means for you or your users. If it is a hobby forum, well yes, UX matters more. But if you screwed up security for anything with big money related - you probably want to prioritize security first and not after you lost some billions.

Re: Short session expiration does not help security

#76
post #24

Is there a list of "security advice that doesn't really make sense but we keep following just because"? This is a great one, another good one is regularly changing passwords. What else?

NIST dropped the password change recommendation a while back [1] but it still lingers on. The staying power and long tail of this deprecated advice is unfortunate, to say the least. I don't personally agree that short sessions is bad advice, but Phil Venables has an article that you might enjoy, "Ceremonial Security and Cargo Cults" [2] [1] https://pages.nist.gov/800-63-FAQ/#q-b05 [2] https://www.philvenables.com/pos…

My experience with security auditors from big firms is that they have a checklist including recommendations like 90-day password changes, composition rules, and so on, and will probably never get rid of those.

You may be able to explain to the assessor that "we don't force password changes because NIST no longer recommends it", and they may be sympathetic, but they are still ultimately going to deliver a report that you got dinged on two items because you answered those parts of their questionnaire "wrong".

I have had issues raised for a site having a robots.txt file. NOT that there was a sensitive URL listed in the robots.txt file, or that we were using it to try to hide stuff that wasn't locked behind authentication. Just that we had one at all.

It ends up being way easier to just get rid of it and comply, than try to explain to multiple people at different levels of management how robots.txt works and how it could be associated with vulnerabilities due to misguided usage while also having NOTHING to do with security when used properly.

Re: Short session expiration does not help security

#77
> You forgot to lock your computer when you went to lunch, and the attacker sat down at your desk and gained access to your machine.

> In this case, session expiration may prevent them from gaining access to your session, if they weren’t fast enough. However, they now have access to your email, ...

Only because GMail sessions never expire now.

Re: Short session expiration does not help security

#78
post #3
post #2

Phew, now I will bump session time to a week, since shorter ones were bothering me a lot. Thank you! :D

A week? Here i was thinking 8 hours would be a luxury.

I fought a lot at work until I got our sessions times extended into 2 hours (they were 20 minutes).

Re: Short session expiration does not help security

#79

Earlier quoted context omitted.

On all their websites. Microsoft is quite a bad offender of this also.

IME github session is almost eternal.

It's possible to connect repositories / organizations to an external SSO. At my work place I have to re-authenticate several times a day. Luckily it usually doesn't require me to login at my work account each time and just redirects back automatically, but it adds an extra layer of protection. If someone gained access to my Github session either physically or externally it would not be enough to access my work.

I have these layers of protection between the web page and the actual code.

1. Github password

2. Github MFA

3. SSO password

4. SSO MFA

If an attacker wants to be successful, they probably need to actually use my machine as I suspect that both Github and the auth solution at work checks ip-addresses and other things that they would also need to get hold of. In that case they probably have complete control of my machine anyway and can do what they want.

Re: Short session expiration does not help security

#80
post #19

Earlier quoted context omitted.

The author also puts lot’s of faith on the user not doing stupid things: “Is this a thing? Are shared computers without user separation a thing? If so, these shouldn’t be used to access web applications with sensitive information at all, no matter how short the session expiry time is.” Yeah, users might just leave their bank logged in a open and logged computer library. That’s why short sessions exist for those as th…

> Not perfect of course, but limit the exposure. It's a shared computer (and if the session is carrying over, it's not just shared hardware it's a shared account). In this case - you are utterly fucked if you think that machine is secure. Hell, fuck the session, I'll just run a keylogger (or if I'm not admin, install a malicious browser extension) and capture your whole login - I have considerably more access to this…

Maybe the machine is secured by not allowing anything further to be installed on it. Or maybe it's not. I've heard most crimes are due to opportunity, so it's best to protect your users from accidentally leaving themselves logged in on a shared computer for the next person to find that opportunity.
Post reply on HN