News: 1698317230

  ARM Give a man a fire and he's warm for a day, but set fire to him and he's warm for the rest of his life (Terry Pratchett, Jingo)

Does Windows have a very weak password lurking in its crypto libraries?

(2023/10/26)


Microsoft's Raymond Chen took to his "Old New Thing" blog this week to explain why Windows has a hash of a weak password in its cryptographic libraries.

The sequence in question was spotted by a customer, who reported they'd found the SHA256 hash of "abc" in the Windows cryptographic libraries.

Dodgy passwords are the bane of many an administrator, and plenty of organizations are keen to tell you how best to [1]manage the things . Change them frequently. Don't change them frequently. Use random gibberish. [2]Don't use random gibberish . And so it goes on.

[3]

Irrespective of this, there is no doubt that "abc" is not a great choice for a password, however, Chen [4]has an explanation for its presence. It is part of the library's self-test to ensure nothing is amiss with the modules. It isn't actually being used as a password per se.

[5]

[6]

We can imagine the alerts raised by various source control tools at the sight of a hard-coded password lurking in the code. After all, no engineer would have dropped such a thing into their carefully crafted source, right?

Chen said: "You can find this hard-coded 'well-known SHA256' in the sha256.c module, with the 'plaintext' in selftest.c. The values are used by the function Sym­Crypt­Sha256­Self­Test to verify that the algorithm produces the expected answer."

[7]

Windows is hardly the only codebase to include such things. One user [8]commented : "It's not just a particular artefact of the Windows cryptographic library, 'abc' is a standard test string used for hash functions going back to at least MD5 in 1991."

[9]ROBOT crypto attack on RSA is back as Marvin arrives

[10]Apple squashes security bugs after iPhone flaws exploited by Predator spyware

[11]Signal adopts new alphabet jumble to protect chats from quantum computers

[12]Microsoft: China stole secret key that unlocked US govt email from crash debug dump

A swift hunt around other libraries showed several other test strings that would be less than ideal as passwords but help validate that functions are working correctly.

Chen said: "The fact that an insecure password appears in the cryptography libraries doesn't mean that the library is using them as passwords. In this case, they are just test data."

He concluded: "I bet you can find insecure passwords in a lot of binaries if you set your mind to it. Just scan for the bytes 61 62 63 in any binary, and if you find it, you can get all excited: 'Hey, your binary contains the insecure password abc!'" ®

Get our [13]Tech Resources



[1] https://www.theregister.com/2018/05/03/world_password_day/

[2] https://xkcd.com/936/

[3] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/oses&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=2&c=2ZTqNJ9yWH7JeCQHDIu2r3QAAAEg&t=ct%3Dns%26unitnum%3D2%26raptor%3Dcondor%26pos%3Dtop%26test%3D0

[4] https://devblogs.microsoft.com/oldnewthing/20231024-00/?p=108919

[5] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/oses&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=4&c=44ZTqNJ9yWH7JeCQHDIu2r3QAAAEg&t=ct%3Dns%26unitnum%3D4%26raptor%3Dfalcon%26pos%3Dmid%26test%3D0

[6] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/oses&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=3&c=33ZTqNJ9yWH7JeCQHDIu2r3QAAAEg&t=ct%3Dns%26unitnum%3D3%26raptor%3Deagle%26pos%3Dmid%26test%3D0

[7] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/oses&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=4&c=44ZTqNJ9yWH7JeCQHDIu2r3QAAAEg&t=ct%3Dns%26unitnum%3D4%26raptor%3Dfalcon%26pos%3Dmid%26test%3D0

[8] https://devblogs.microsoft.com/oldnewthing/20231024-00/?p=108919#comment-140844

[9] https://www.theregister.com/2023/09/26/robot_marvin_rsa/

[10] https://www.theregister.com/2023/09/22/apple_emergency_patches/

[11] https://www.theregister.com/2023/09/20/signal_adopts_new_alphabet_jumble/

[12] https://www.theregister.com/2023/09/06/microsoft_stolen_key_analysis/

[13] https://whitepapers.theregister.com/



That's great and all, but...

pip25

What is test data doing in the production binary? Does it need to test itself during each startup to make sure the function did not stop working somehow...?

Re: That's great and all, but...

Avalanche

Given it is a self-test, it is probably run when the library is loaded to verify the library works correctly.

Re: That's great and all, but...

Jou (Mxyzptlk)

It is there to test whether the CPU does it right and to check for tampering with the binaries and check whether dependent libraries (.dlls) still offer the right functions etc etc.

TBH: You didn't read or understand Raymon Chens article. Jumping to such premature conclusions is not a good sign.

Engineers and public relations

Alan W. Rateliff, II

He concluded: "I bet you can find insecure passwords in a lot of binaries if you set your mind to it. Just scan for the bytes 61 62 63 in any binary, and if you find it, you can get all excited: 'Hey, your binary contains the insecure password abc!'"

This was a completely dismissive and douchie thing to say. This is why we need Tom Smykowskis in the world.

Correct me if I'm wrong ...

John H Woods

but although it "doesn't mean that the library is using them as passwords" it does surely mean these hashes are stored unsalted?

Re: Correct me if I'm wrong ...

richardcox13

Yes.

Cryptographic hashes are used for more than passwords.

Sounds like

aerogems

Reminds me of when some self-proclaimed security expert claimed they had found some massive flaw in the Windows printing subsystem, and the reality was they didn't know WTF they were looking at. Or all the anti-vaxxer death cultists who "do their own research" but forget the part where they need an advanced degree (or the equivalent education at least) to be able to correctly interpret what they're looking at.

Fine's Corollary:
Functionality breeds Contempt.