News for hackers. Stuff that matters.
Re:Windows feature that resets system clocks based on random... by yetanotherloss on Wednesday August 16, 2023 @03:07PM (#37152061)
I can't imagine the sequence of horrible decisions that led to doing this. Like, why would the time service ever want to depend on all this insanity when if it has a network and everything else is bizarro world, just like scrape the time and date text from weather.gov.

Or just accept that absent NTP, w32time maybe just shouldn't try to set the clock to whatever a circus clown tells it?

This sort of reminds me how there is a buried registry setting to tell w32time to not place the firmware clock at very high stratum in the time sources list which also is just a giant WTF in how those two behaviors were decided on.

Re:Windows feature that resets system clocks based on random... by Varriount on Wednesday August 16, 2023 @03:22PM (#37152268)
This is what puzzles me - while time drift does occur, it tends to be in the form of minor errors which build up over time; large jumps are relatively rare. You'd think the mechanism described in the article would have a failsafe ensuring that only minor time recalibrations are performed.
Re:Windows feature that resets system clocks based on random... by toast0 on Wednesday August 16, 2023 @03:29PM (#37152378)
It kind of depends. There's a lot of poor clocks at boot up time, but a continuously running host usually doesn't get too off, too quickly; I've seen some things, but even at 10% fast/slow, you don't have to jump days unless you're checking infrequently.

On the other hand, with virtualization, who knows how long it's really been between clock ticks. Let's say someone suspends a VM for a couple months and then unsuspends it; hopefully the clock is synchronized, but maybe it isn't, and you do need to jump ahead.

I thought I saw in the article that there are failsafes, but the allowed range is still pretty broad. But reporting is going to tend to be dominated by larger values, because smalller jumps are less likely to be noticed or more likely to be considered an accidental change.

Re:Windows feature that resets system clocks based on random... by Wowfunhappy on Wednesday August 16, 2023 @03:40PM (#37152541)
Every VM software I've ever used automatically syncs the guest OS's clock to the host OS's clock. I've never used VMs in a server context, but do servers not do this too? It seems like the logical solution here.
Re:Windows feature that resets system clocks based on random... by toast0 on Wednesday August 16, 2023 @04:17PM (#37153122)
I've certainly had issues with time sync in the past, and Windows has a wide range of deployment, so I would imagine they can't rely on it.
Re:Windows feature that resets system clocks based on random... by HPsquared on Wednesday August 16, 2023 @03:36PM (#37152490)
There are a lot of machines out there with a dead battery on the real time clock. Every time they boot, the time is miles out and at some system-determined zero point.
Re:Windows feature that resets system clocks based on random... by magicalhippo on Wednesday August 16, 2023 @09:15PM (#37155940)
Imagine one could make an approximate clock that does not rely on batteries or similar things that can expire. How close would it need to be to the actual time to be useful? Does it have to be within a day, or could it be within a week or a month?
Re:Windows feature that resets system clocks based on random... by deepsun on Wednesday August 16, 2023 @03:50PM (#37152706)
It's already discussed in the article -- because to determine that weather.gov connection is sound and not hacked, you first need to check its certificate expiration date. Chicken/Egg problem.
Re:Windows feature that resets system clocks based on random... by ragebol on Wednesday August 16, 2023 @03:59PM (#37152854)
Why not let the user at least give an estimate for the current time & date. Should be close enough for certificate validation.

Yes, that gets annoying fast for said user, but a good incentive to eg fix the bios battery.

Re:Windows feature that resets system clocks based on random... by orf on Wednesday August 16, 2023 @04:17PM (#37153115)
Imagine there is no user, and there are thousands of machines
Re:Windows feature that resets system clocks based on random... by cwilkes on Wednesday August 16, 2023 @08:09PM (#37155551)
Just have those machines randomly ask one another for the time. Because of the Wisdom of Crowds the time will eventually be right.

/ sarcasm

Re:Windows feature that resets system clocks based on random... by ragebol on Thursday August 17, 2023 @09:45AM (#37161463)
Fair point. Another reason I don't want to manage thousands of Windows machines. Or even one for that matter.
Re:Windows feature that resets system clocks based on random... by yetanotherloss on Wednesday August 16, 2023 @03:58PM (#37152833)
That's the point, if you can't trust the connection, stop trying to come up with more complicated ways to use the untrustable connection and accept that there is no safe way to update time.
Re:Windows feature that resets system clocks based on random... by deepsun on Wednesday August 16, 2023 @06:05PM (#37154512)
Ok, so the system should fail to boot, right?
Re:Windows feature that resets system clocks based on random... by yetanotherloss on Wednesday August 16, 2023 @08:45PM (#37155766)
If for some reason an invalid time causes boot failure? Sure. There are some instrumented devices I work with that will alarm and cease operation if they lose their serial connection to a satellite clock, but those are few and far between.

But since the vast majority of them do not fail in that matter if the normal, configured methods of determining time aren't working, using TLS parameters that have been deliberately randomized by standard for like what, a decade now?, can not possibly be a more straightforward failure mode than logging errors and waiting for operator input.

If it's that critically important, embed a fixed signature for a set of known time sources and query those as a last resort. Microsoft certainly has the resources to set up a few to do this the much more obvious and predictable way.

Re:Windows feature that resets system clocks based on random... by oskarw85 on Wednesday August 16, 2023 @11:21PM (#37156753)
That means your server could not serve HTTPS traffic at all, because you need valid timestamp for that.
Re:Windows feature that resets system clocks based on random... by LeifCarrotson on Wednesday August 16, 2023 @04:02PM (#37152902)
> ...if it has a network...

But that network is not trusted.

Imagine this: You boot a machine for the first time, and the system clock tells you it's January 1, 1970. You might know when your OS was built, so you could maybe hard-code some sanity checks there, but you basically don't know what the date is.

You want to communicate securely with weather.gov? Sure, you can do that over SSL/TLS. You send it a list of cipher suites and SSL/TLS versions you can use, the weather.gov server selects a cipher and version, and sends you their certificate. It's valid from Jun 2023 to Jun 2024, signed by a DigiCert TLS RSA SHA256 2020 CA1 certificate valid Apr 2021 to Jun 2024, which is itself signed by the Digicert root global CA encoded into your OS's root certificate store, valid Nov 2006 to Sun, Apr 2031.

Wait a second. Or maybe 1.7 billion seconds. Are any of those certificates valid? Do you want to let the attacker set the date back to when a revoked, potentially leaked Trustico or Symantec private certificate was valid?

You don't have a secure network if you don't know what time it is.

Re:Windows feature that resets system clocks based on random... by yetanotherloss on Wednesday August 16, 2023 @04:13PM (#37153069)
Man it's like you and the other respondent want to be helpful but didn't read the next sentence after that bit of hyperbole.

If all available time sources are not trustable and none of the existing answers make sense, do not try to set the clock! Coming up with more complicated ways to use untrustable data is not an improvement.

Re:Windows feature that resets system clocks based on random... by solardev on Wednesday August 16, 2023 @04:35PM (#37153402)
Why can't it just ask the human to provide it, either in the welcome UI or in a setup script? That's how we've set up computers for many milliseconds.
Re:Windows feature that resets system clocks based on random... by dylan604 on Wednesday August 16, 2023 @04:45PM (#37153540)
because every developer has been told to never trust user input, and to sanitize the hell out of it.
Re:Windows feature that resets system clocks based on random... by akira2501 on Wednesday August 16, 2023 @05:16PM (#37153964)
There are public users and owner users. Specifically, you don't trust input from public users. You absolutely should trust input from owner users, or if you won't by default for some reason, you absolutely should give them the option to do so. Primarily, you should be giving them the choice as to what their system will do when it cannot reliably determine the actual time.

The alternative is to pretend that you can somehow divine a 'projected secure time.' Just, the gall to even write a sentence like that.

Re:Windows feature that resets system clocks based on random... by bob-09 on Wednesday August 16, 2023 @06:04PM (#37154497)
If your goal is to phase out local accounts and force microsoft.com logins as part of the computer setup, being able to trust your certificates seems like a prerequisite to being able to trust your users. And the correct time is a prerequisite to trusting your certificates.
Re:Windows feature that resets system clocks based on random... by solardev on Thursday August 17, 2023 @01:29AM (#37157610)
This makes no sense..? If the admin wants to change the clock to something else and make their certs invalid, they can always do so. It's just for getting an initial handshake, and then after that NTP should keep working (at least until the next reset with a dead CMOS battery).

There's no way for the server to accurately determine the client's hardware clock, barring some sort of user-hostile hardware clock with a nuclear battery or hardened GPS or radio time receiver or something.

Re:Windows feature that resets system clocks based on random... by dylan604 on Wednesday August 16, 2023 @06:50PM (#37154918)
>'projected secure time.'

It's 5 o'clock somewhere!

Re:Windows feature that resets system clocks based on random... by dullcrisp on Wednesday August 16, 2023 @07:15PM (#37155140)
It’s 1970-01-01T00:00:00Z somewhere
Re:Windows feature that resets system clocks based on random... by dragonwriter on Wednesday August 16, 2023 @05:04PM (#37153821)
But the user input thing is not the rule, its a specific case of the more general rule regarding external data generally.

It definitely applies even more to the data it is trusting in this case.

Re:Windows feature that resets system clocks based on random... by cesarb on Wednesday August 16, 2023 @06:28PM (#37154726)
If I understood the article correctly, this misfeature is for the rare case in which the server reboots after a power loss and the real-time-clock battery on the motherboard is dead, which can happen long after the initial setup of the server.
Re:Windows feature that resets system clocks based on random... by sudosysgen on Wednesday August 16, 2023 @09:03PM (#37155874)
This is a hardware failure. The server should report to the domain controller a malfunction (by assuming it's certificate is valid) and then give up.
Re:Windows feature that resets system clocks based on random... by jmholla on Wednesday August 16, 2023 @04:13PM (#37153058)
But this isn't just impacting machines at first boot. This is enabled in an on-going fashion.
Re:Windows feature that resets system clocks based on random... by Arnavion on Wednesday August 16, 2023 @05:47PM (#37154338)
The point isn't restricted to first boot. Lots of systems forget the time when they power cycle because of bad batteries or other trouble.
Re:Windows feature that resets system clocks based on random... by pixl97 on Wednesday August 16, 2023 @06:03PM (#37154493)
I mean, at that point the system should go to the IT group and be fixed.
Re:Windows feature that resets system clocks based on random... by cpeterso on Wednesday August 16, 2023 @04:54PM (#37153683)
The article says:

> Because Secure Time Seeding used SSL certificates Windows already stored locally, it could ensure that the machine was securely connected to the remote server. The mechanism, Microsoft engineers wrote, “helped us to break the cyclical dependency between client system time and security keys, including SSL certificates.”

But in that case, why does the Windows time service connect to a random server running OpenSSL instead of a trusted server under Microsoft's control like time.microsoft.com (or whatever)?

Re:Windows feature that resets system clocks based on random... by pixl97 on Wednesday August 16, 2023 @06:02PM (#37154478)
>instead of a trusted server under Microsoft's control like time.microsoft.com (or whatever)?

"Golly it's getting expensive hosting 100 billion random requests per year, lets let someone else shoulder the problem".

While this might not be it, we've seen plenty of other providers really screw up with time like this. I believe it was Linksys years ago just pointed their NTP as someone elses NTP servers and flooded them out.

Re:Windows feature that resets system clocks based on random... by X-Cubed on Wednesday August 16, 2023 @08:46PM (#37155774)
Not all PCs are on the internet or have access to time.microsoft.com
Re:Windows feature that resets system clocks based on random... by dragonwriter on Wednesday August 16, 2023 @05:02PM (#37153800)
> You don't have a secure network if you don't know what time it is

Yes, that's a very good reason not to trust the network to tell you what time it is.

Unfortunately, Windows, because it doesn't trust the network in the broad sense, relies on specific and known-to-be-unreliable SSL handshake data on the network to reset the clock.

Re:Windows feature that resets system clocks based on random... by simendsjo on Wednesday August 16, 2023 @04:40PM (#37153476)
> I can't imagine the sequence of horrible decisions that led to doing this.

My guess is that it was created because of Windows Phone 10. But it's not a feature I'd like even on my phone.

Re:Windows feature that resets system clocks based on random... by zokier on Wednesday August 16, 2023 @04:45PM (#37153529)
That seems far-fetched considering that afaik all cell networks provide time syncing
Re:Windows feature that resets system clocks based on random... by izacus on Wednesday August 16, 2023 @08:25PM (#37155656)
Cell networks provide some kind of time syncing... But accurate time syncing is less common than you'd think :)