News for hackers. Stuff that matters.
Re:Frequent reauth doesn't make you more secure by SAI_Peregrinus on Thursday June 12, 2025 @09:00PM (#44264763)
Does anyone not add the year & month of the last password change to the end of their password? E.g. PascalCasePassphraseGoesHere2025-06, then at the next required change in (for example) 6 months: PascalCasePassphraseGoesHere2026-01. It almost certainly fits the inane "letter, number, and special character" requirements they probably have, complies with "different from your last X passwords", and is easy to keep track of the change interval. It also adds no security whatsoever! A user could almost certainly get away with Password2025-06, etc.
Re:Frequent reauth doesn't make you more secure by repeekad on Thursday June 12, 2025 @09:50PM (#44265041)
I’ve personally experienced the password change require that “more than X characters be different than the old password”
Re:Frequent reauth doesn't make you more secure by valleyer on Thursday June 12, 2025 @10:49PM (#44265330)
Um, that's a really bad sign...
Re:Frequent reauth doesn't make you more secure by klysm on Thursday June 12, 2025 @10:53PM (#44265348)
To elaborate for the uninitiated, that means they are storing it in plaintext somewhere.
Re:Frequent reauth doesn't make you more secure by mx_03 on Thursday June 12, 2025 @10:58PM (#44265365)
Is there any way to check that with non-plain-text password?
Re:Frequent reauth doesn't make you more secure by jchw on Thursday June 12, 2025 @11:00PM (#44265372)
Actually it can be trivial as long as you can require the user to re-type the current password when entering a new password; check hash first, then check edit distance with the entered "current password" (and, of course, promptly throw it away once you know the edit distance.)
Re:Frequent reauth doesn't make you more secure by nullify88 on Friday June 13, 2025 @02:11AM (#44266112)
Ohh. I guess that's what Windows does when a user wants to change their own password in the domain.
Re:Frequent reauth doesn't make you more secure by mrspuratic on Friday June 13, 2025 @04:20AM (#44266738)
It does more than that, it keeps a hashed password history (which used to be in the user attr ntPasswdHistory, but is now "somewhere secret" afaik) according to the value of ms-DS-Password-History-Length attribute. OpenLDAP keeps these (ppolicy overlay) in the user object.

So, it can hash any proposed password and compare the history to make it's not been seen $recently (as an exact match, since it's comparing hashes).

It could also perform some minor permutations of any new password, and do the same history check to make sure you're not just changing the first or last character or digit. I don't know if it does this, but it could.

Re:Frequent reauth doesn't make you more secure by _moof on Friday June 13, 2025 @02:37AM (#44266212)
Unless they ask you for your current password as part of the password change flow.
Re:Frequent reauth doesn't make you more secure by mattmanser on Friday June 13, 2025 @03:41AM (#44266548)
No it doesn't. Shows you how complicated all this is and how the un-initiated (including me) should learn to not give their two cents.

When you do the password change it asks you for the old one, that's how it knows.

So it asks for old + new, checks old is correct against the hash, and then compares old + new likeness.

So it all happens in memory.

Re:Frequent reauth doesn't make you more secure by rocqua on Friday June 13, 2025 @02:12AM (#44266120)
No, you can do it safely. The idea is to have the password renewal process also ask for the previous password.

This means the password changing method doesn't need to store a plaintext password, but still has access to the old plaintext password when changing. It's still not a great idea, but that's because nagging your users will see them choose worse passwords.

Re:Frequent reauth doesn't make you more secure by _dark_matter_ on Friday June 13, 2025 @10:24AM (#44268806)
Oh so trivially bypassable by changing your password twice.
Re:Frequent reauth doesn't make you more secure by dspillett on Friday June 13, 2025 @06:34AM (#44267297)
Not if the check is done client-side, so the plain password never leaves you local domain. Of course the check being done client-side means that it isn't difficult to skip if you are inclined to make a smidgin of effort.
Re:Frequent reauth doesn't make you more secure by thih9 on Friday June 13, 2025 @08:17AM (#44267853)
It can be done server side too, the old password can be sent along the new one and the server can verify it.
Re:Frequent reauth doesn't make you more secure by dspillett on Tuesday June 17, 2025 @03:53AM (#44296688)
Yes, what I meant to say that it doesn't even have to be done server-side, so the fact it happens doesn't imply the server ever sees the old password beyond it's initial setting.
Re:Frequent reauth doesn't make you more secure by deathanatos on Thursday June 12, 2025 @10:15PM (#44265169)
I just let the keyring roll a completely new password. For some reason, all of my employers do require this insanity, but not on the one password I have to actually type.
Re:Frequent reauth doesn't make you more secure by bisby on Friday June 13, 2025 @12:43AM (#44265751)
I once had an employer that required us to use passworded SSH, and disallowed SSH keys, because they couldn't enforce that the SSH keys were passphrase protected, so just turned that option off.

They said it was a PCI requirement, or something.

Re:Frequent reauth doesn't make you more secure by yardstick on Friday June 13, 2025 @01:12AM (#44265868)
PCI requires multi-factor auth these days, so you’ll likely find now the ssh password will be your password plus a OTP at the end.
Re:Frequent reauth doesn't make you more secure by notpushkin on Friday June 13, 2025 @02:01AM (#44266064)
Isn’t there a way to ask for OTP after initiating the SSH session?
Re:Frequent reauth doesn't make you more secure by mrspuratic on Friday June 13, 2025 @04:25AM (#44266757)
Yes, via PAM, and this works fine with OpenSSH. But the couple of OTP implementations I've used are the same, you can either provide password and PIN or passwordPIN. In the end they get concatenated, passed to the next layer, and taken apart for checks. This lets it work with brain-dead http basic auth too, if you're unlucky enough to have to use that...
Re:Frequent reauth doesn't make you more secure by notpushkin on Saturday June 14, 2025 @02:24AM (#44274606)
Yeah, I’ve seen it in a couple places, too. (Once I’ve had to write my own wrapper for openfortivpn that did exactly that!)
Re:Frequent reauth doesn't make you more secure by odo1242 on Monday June 16, 2025 @12:15PM (#44290951)
One issue with this is it makes it hard for scripts to log in (this may be what you want)
Re:Frequent reauth doesn't make you more secure by mazone on Friday June 13, 2025 @06:34AM (#44267295)
PCI DSS from 4.0 actually have something called customized approach for everything. If you can prove and the QSA agrees that you fullfill the goal of a requirement, you can be quite flexible. Example i am doing things like not using passwords at all and only passkeys, or only ssh keys protected by hardware security key etc. Together with agents trying to verify the devices connected are company owned and hardened in different ways. Your milage might vary depending on how good your auditor is but PCI DSS standard do have quite a bit of flexibility in it.
Re:Frequent reauth doesn't make you more secure by yardstick on Friday June 13, 2025 @05:55PM (#44272652)
Presumably at some point in your environment you are doing MFA? Just not at every step?

Ie If someone broke into your office, opened computer, inserted the hardware security key, would they get in? Or is there something else non-physical going on? Like the initial login is password + security key, and you can demonstrate the ssh keys never leave the secured PCs etc.

Re:Frequent reauth doesn't make you more secure by mazone on Saturday June 14, 2025 @01:42AM (#44274454)
It is not about MFA or not but to demonstrate the process is secure for the purpose.

It can be complicated but a example. TOTP that is very common used with passwords is regarded as MFA (tho most of the time software based on phone) but have many problems regardless

- many time replayable - can be intercepted - implementations look different - recovery code reuse problems etc.

On the other hand, using only passkeys dont have those problems but with passkeys, many times you cannot decide on what device a user have registrated the passkeys in a enterprise setting. example they could be apple passkeys, chrome passkeys, windows, hardware key(yubikey) etc and all of them behave different when it comes how they ex can be copied/ synced between users devices. So from where they can be used.

So for any authentication flow, you need to look at the full picture. What is the process when credentials are lost? How do user onboard etc.

Is a good entry point to say. We should use MFA or similar but the details matter.

Re:Frequent reauth doesn't make you more secure by yardstick on Saturday June 14, 2025 @04:26PM (#44278597)
It’s always interesting to hear other people’s approaches- Thanks for the insights!
Re:Frequent reauth doesn't make you more secure by jerf on Friday June 13, 2025 @09:59AM (#44268612)
This is not as illegitimate as it may sound to you. You may not hear about "getting someone's SSH keys" very often, because we only hear about "vulnerabilities" on places like HN and this isn't a "vulnerability" in any software.

But getting someone's SSH keys and then running off and doing other things is a very normal part of any focused attack in which attackers use some foothold to start pivoting into your systems. It's one of the first things an attacker will check for, precisely because it's high likelihood they'll find one and high reward if they do. It's an extremely serious threat that you don't hear about very often, just like you may not hear about "the sudoers file left something open with passwordless access it shouldn't have and the attackers lifted themselves up to root from there" even though it's a major part of many actual incursions. I'm aware of multiple cases in which someone's passwordless SSH key played a part of the process.

So that really is a legitimate problem and turning them off is not security theater but can have a real impact on your security posture. The problem is solved nowadays with adding other auth to the process like proving possession of a physical token as part of the login process.

Re:Frequent reauth doesn't make you more secure by seadan83 on Friday June 13, 2025 @02:56PM (#44271197)
> But getting someone's SSH keys and then running off and doing other things is a very normal part of any focused attack in which attackers use some foothold to start pivoting into your systems.

Though, if someone gets that far, couldn't they also install a key logger on the users system? At that point - whether it's just password or a password enabled SSH key, anything the user does is all compromised regardless.

Re:Frequent reauth doesn't make you more secure by jerf on Friday June 13, 2025 @03:37PM (#44271561)
"Though, if someone gets that far, couldn't they also install a key logger on the users system?"

There are a ton of situations where that is not the case. They may be using directory traversal from something else to read a key without even necessarily being on the system. They may be on the system at 1am local time, and want to get in and get their job done before the user is even there. They may be on a server somewhere where someone left a key they shouldn't have. The attacker may have gotten enough of a secret to compromise some other secret store where the key is being held. They're probably on a system with user-level access only and that may not be enough to "just" install a keylogger, depending on how the system is set up and how the user accesses it. These are examples and not even remotely a full enumeration of all the possibilities. I won't tell you which ones, but some of these are things I've personally seen attackers take advantage of, so they're not just theory, either.

When you're under personal attack, not just getting popped by some vuln scanner scanning over the entire Internet, the situation becomes very different than a lot of people here on HN are used to. Ever been locked out of a system accidentally, then thought for a moment and strung together three other things to reach back into the system you were locked out of, like "oh yeah, I can push a software update to this automatic deployment system, which will run a bash script that checks the IP address and if it is this system restarts the ssh server, and so after 10 minutes we should be in"? Imagine someone who does that every day, all the time, as their full time job, and then imagine they're on a team of other people who also do it every day as their full time job, then imagine they've gotten a foothold into your system. Which, by the way, they immediately used to put a command-and-control client on your system, loaded with all kinds of exploits, and the ability to push arbitrary code to any number of systems at a time and all the tooling to use that as if they've been developing it for 20 years, which they have. What's the transitive closure of what they could work out how to access? The answer would probably surprise you.

Re:Frequent reauth doesn't make you more secure by seadan83 on Friday June 13, 2025 @04:33PM (#44271991)
I appreciate the additional insights, but the premise I'm pushing back on is whenever a SSH key is read, then the user account is by necessity compromised in order to do so. Given that level of a breach, there are myriad ways for an attacker to escalate privilege and exploit their access without worrying about a password on the SSH key. Namely, at that point, cracking the password on the SSH key is a tractable problem.

> They may be using directory traversal from something else to read a key without even necessarily being on the system.

At least on linux - to read the directory containing a SSH key requires the ability to also write to that directory, as the user. Therefore you can also write to '.bashrc' and all sorts of other places. I suspect Windows might have a larger attack surface, but nonetheless, a directory traversal that is able to read and write is also able to install a keylogger.

> They may be on a server somewhere where someone left a key they shouldn't have

Private key should never be transmitted over a network boundary. SSH key passwords can be bruteforced as well. Having a password on the SSH key, when the SSH key is somewhere it really should never have been, is closing the barn door after the horses have left.

> The attacker may have gotten enough of a secret to compromise some other secret store where the key is being held.

Again, getting access to the secret is enough to also have write access and be able to install a key logger. A password on the SSH key still does not help.

> They're probably on a system with user-level access only and that may not be enough to "just" install a keylogger

If a person has enough access to read a SSH key, they can also install a key logger for at least that user account. They are equivalent levels of compromise, a user account having its SSH key read is already compromised.

edit: addendum: There are certainly attacks that can only read the contents of a system, with root that can read the full system. It's just odd to think about, since at that rate the SSH keys being on a prod system is already such a big no-no. SSH keys really need to live exactly just on the personal devices of the people who own those keys - EG: it should never be the case that say a SQL injection attack that gains root level read permission over everything on a filesystem can then ever read SSH keys - cause those keys should never be on the remote system to begin with. Putting a password on private keys that are then copied to servers _is_ security theater; the keys ought to never be copied to a remote server to begin with.

Re:Frequent reauth doesn't make you more secure by jerf on Saturday June 14, 2025 @09:18PM (#44279937)
I can tell you've not been involved in defending against an active attack. You, as the defender, do not get to play the game of "well, if I squint and read it that way, that attack wouldn't work". The attackers get to play "well, hey, if it turns out I do this and that and push it through the other thing, I get access". They are the ones who get to flow through any crack they can find. They are the ones who get to do logic chopping like you're trying to do. You don't get to argue "Well gosh, that team shouldn't have left that one permission open on that one system, that's not a best practice, if they'd followed best practices 100% of the time the attackers couldn't have gotten in...". Your job is to pick up the pieces.
Re:Frequent reauth doesn't make you more secure by seadan83 on Monday June 16, 2025 @08:33PM (#44294630)
> I can tell you've not been involved in defending against an active attack.

Um... I'm really happy you can mind read dude.

The whole premise here is whether passwords on SSH keys actually help.

SSH keys tend to live in two places: (1) a developers laptop, (2) some sort of CI/CD machine.

The passworded SSH key helps in case (1) only when a person walks away from the laptop and leaves it unlocked. An attacker can't simply then open up a SSH terminal and then SSH to whatever they see in the history. Or, it helps in case a person has a laptop that never locks and the org is simply trying to buy enough time to rotate the persons public keys before the SSH key password is cracked. The SSH key password can buy time, yes - but it does not change the actual security posture.

In case (2), all sorts of considerations need to be made. Though, any password would need to be encoded in a way that is just as accessible as the secret key itself. In case (2), the password really does nothing.

So, yeah, passwording a SSH key does not really help very much. If the keys are left around, then it is the fact they are left around that is a problem. The solution is not to create a scanner that all SSH keys have a password on them, but instead be sure that no SSH keys are installed on systems where they do not belong.

> They are the ones who get to flow through any crack they can find.

I would agree, that is why defense in depth is a good principle just as zero trust security.

So.. passworded SSH keys are kinda really security theater. Please give an attack vector on a persons laptop where the password SSH key is going to stop an attack that is otherwise unachievable. I'll steel man the counter position and mention that physical access is one case (except in that case we are only buying time). AFAIK, that is really it, that is the one place where a password on a SSH key helps.

To hack a persons laptop and read contents in the .ssh directory is a full compromise. To pick up the pieces after that, you need to do things like make sure the compromise can be observed, that privilege escalation is limited. If it comes down to the password on a SSH key being last line of defense - it's game over.

Keep in mind, your burden of proof is to show cases where SSH password actually provides a true increase in real security. The meta conversation of "well, you obviously never have.." is not interesting.

I'll note, if it is the case that SSH passwords are actual security - then, presumably you would feel comfortable stating "yeah, the SSH key was stolen, but nothing needs to be done because the SSH key had a password on it!" It's like the locks on doors, it is for the honest people, the criminals are only slowed down but not stopped by most door locks.

Re:Frequent reauth doesn't make you more secure by delfinom on Friday June 13, 2025 @08:23AM (#44267896)
They do it because their IT departments are checklist monkeys with no actual brainpower there, AND/OR they have cybersecurity insurers that mandate it who also have nobody with actual brainpower working there.
Re:Frequent reauth doesn't make you more secure by SAI_Peregrinus on Friday June 13, 2025 @06:10PM (#44272757)
Whenever I don't have to type it, that's what I do. It's the login (or password manager password) needing this counterproductive crap that gets the "append a date" treatment. It's a 10-word diceware passphrase, only used for that login anyway, it's not getting breached if it's stored in even a remotely secure manner (even an unsalted hash would be safe).
Re:Frequent reauth doesn't make you more secure by pcardoso on Friday June 13, 2025 @04:38AM (#44266821)
I once wrote a script to change my password randomly X times and then back to my original password. Worked like a charm.
Re:Frequent reauth doesn't make you more secure by claudex on Friday June 13, 2025 @05:02AM (#44266925)
There are policies to prevent changing the password more than once a day to prevent that. I've encountered it in several places
Re:Frequent reauth doesn't make you more secure by thih9 on Friday June 13, 2025 @08:09AM (#44267810)
Fascinating. In other words:

In order to force the user to change their password more frequently (long term), the user is prevented from changing their password too frequently (short term).

Re:Frequent reauth doesn't make you more secure by eqvinox on Friday June 13, 2025 @09:23AM (#44268300)
There are also systems that keep a history of old passwords just to prevent you from reusing one.
Re:Frequent reauth doesn't make you more secure by jandrese on Friday June 13, 2025 @01:40PM (#44270524)
I like the ones that not only keep a history of your old passwords but will reject any password that is similar to any of your 30 previous passwords, which means they're storing either a plaintext or reversibly encrypted list of every password somewhere on the system. Talk about a goldmine for the hacker that dumps that database.
Re:Frequent reauth doesn't make you more secure by Rexxar on Friday June 13, 2025 @03:12PM (#44271361)
Something like that could probably be implemented by storing multiple hash of some automatically modified version of the password. For example, if your password is "PassWorD" they can additionally store the hash of the lowercase version of the password. So if you change it from "PassWorD" to "paSswOrd", they will see it has the same lowercase hash than the previous one without knowing it.
Re:Frequent reauth doesn't make you more secure by jandrese on Friday June 13, 2025 @03:48PM (#44271650)
This doesn't seem practical at all. The combinatoral explosion would make the storage requirements impractical for everything but the absolutely most trivial cases like incrementing a number as the very last digit. Even in your simple example you're talking about storing 256 different hashes just to catch one possible mutation on a way too short password.
Re:Frequent reauth doesn't make you more secure by eqvinox on Friday June 13, 2025 @10:54PM (#44273888)
Technical/pedantic answer: you can store a 'normalized' hashed form of the password, e.g. before hashing it, convert it to all lowercase, replace all digits with 0, sort the characters, … and then do the same to the new password before hashing it, so a whole bunch of stuff will compare "equal".

Practical/actual answer: this is stupid either way.

Re:Frequent reauth doesn't make you more secure by andrewaylett on Friday June 13, 2025 @11:04PM (#44273918)
You can store a normalised form -- so if the password is `PaSsWoRd` and the user tries to change it to `pA55wOrD`, a normalisation that lower-cases, turns 1 and i into l, turns 2 and 5 into s, and turns 4 into a, would normalise both to `password`.

Or if you want a slightly more convoluted mechanism, when someone changes their password you have both in plain-text and you can take a copy of the old password at that point -- after all, it's not being used as a password any more! For bonus fun, submit all previous passwords to pwned passwords. Password reuse makes this a bad idea in general, specific policies attempting to mandate it will not be an issue notwithstanding.

Re:Frequent reauth doesn't make you more secure by strken on Saturday June 14, 2025 @08:40AM (#44276069)
You could use a Bloom filter, and just gaslight your users when a false positive happens.
Re:Frequent reauth doesn't make you more secure by rightbyte on Friday June 13, 2025 @02:41PM (#44271059)
Ye. If the insane password gatekeeper shenanigans doesn't make you input your old password together with the new, you know they store your passwords.
Re:Frequent reauth doesn't make you more secure by Viliam1234 on Sunday June 15, 2025 @10:19AM (#44282419)
The obvious solution is to have a Monday password, a Tuesday password, etc.
Re:Frequent reauth doesn't make you more secure by HocusLocus on Friday June 13, 2025 @10:27AM (#44268842)
Password changed.

Password changed.

Password changed.

Error at : broken pipe

Re:Frequent reauth doesn't make you more secure by kelnos on Saturday June 14, 2025 @11:01PM (#44280233)
When I first set up an account at a new org or whatever, I don't think about the possibility of rotation later, but once I get my first "your password has expired and needs to be reset" message, I just add a counter to the end of the password that I increment each time I'm required to change it. Successive passwords have no less entropy than the original password, anyway.

Fortunately, I haven't encountered a system that does a similarity check when changing the password.