Skip to content

(PUP-10943) Puppet read registry until WCHAR_NULL #8533

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

Dorin-Pleava
Copy link
Contributor

On Windows, it is possible to have a registry that contains corrupted
data after the WCHAR_NULL characters, that can break puppet when reading
the registy.

Part of the fix was done in PUP-10536, but when the WCHAR_NULL from the
registry is \u0000 instead of \u0000\u0000, the split did not work.

Now WCHAR_NULL is forced encoded to UTF-16LE, meaning \u000 so puppet
will now stop at the WCHAR_NULL char.

The initial issue can be reproduced by importing file.reg using
reg import .\file.reg

----file.reg----

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\PUP105360000]
"DisplayName"="PUP105"
"DisplayVersion"=hex(2):32,0,0,0,f3,23,8a,bc,fa,7f,0,0,10,65,74,b9,fa,7f,0,0,90,d8,55,6f,59

On Windows, it is possible to have a registry that contains corrupted
data after the WCHAR_NULL characters, that can break puppet when reading
the registy.

Part of the fix was done in PUP-10536, but when the WCHAR_NULL from the
registry is \u0000 instead of \u0000\u0000, the split did not work.

Now WCHAR_NULL is forced encoded to UTF-16LE, meaning `\u000` so puppet
will now stop at the WCHAR_NULL char.

The initial issue can be reproduced by importing file.reg using
`reg import  .\file.reg`

----file.reg----

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\PUP105360000]
"DisplayName"="PUP105"
"DisplayVersion"=hex(2):32,0,0,0,f3,23,8a,bc,fa,7f,0,0,10,65,74,b9,fa,7f,0,0,90,d8,55,6f,59
@Dorin-Pleava Dorin-Pleava requested review from a team March 9, 2021 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants