Skip to content

fix: Avoid tsh panic on Windows Server 2019#38444

Merged
codingllama merged 1 commit intomasterfrom
codingllama/webauthn-dll-zero
Feb 21, 2024
Merged

fix: Avoid tsh panic on Windows Server 2019#38444
codingllama merged 1 commit intomasterfrom
codingllama/webauthn-dll-zero

Conversation

@codingllama
Copy link
Copy Markdown
Contributor

@codingllama codingllama commented Feb 20, 2024

Some Windows installs appear to contain a WebAuthn.dll without WebAuthNGetApiVersionNumber, which leads to a panic. This PR aims to fix that.

Error on Windows Server 2019
panic: Failed to find WebAuthNGetApiVersionNumber procedure in WebAuthn.dll: The specified procedure could not be found.

goroutine 1 [running]:
golang.org/x/sys/windows.(*LazyProc).mustFind(...)
	C:/Users/runneradmin/go/pkg/mod/golang.org/x/sys@v0.16.0/windows/dll_windows.go:325
golang.org/x/sys/windows.(*LazyProc).Addr(...)
	C:/Users/runneradmin/go/pkg/mod/golang.org/x/sys@v0.16.0/windows/dll_windows.go:333
github.com/gravitational/teleport/lib/auth/webauthnwin.webAuthNGetApiVersionNumber()
	C:/a/teleport.e/teleport.e/lib/auth/webauthnwin/zsyscall_windows.go:83 +0xb4
github.com/gravitational/teleport/lib/auth/webauthnwin.newNativeImpl()
	C:/a/teleport.e/teleport.e/lib/auth/webauthnwin/webauthn_windows.go:65 +0xad
github.com/gravitational/teleport/lib/auth/webauthnwin.init()
	C:/a/teleport.e/teleport.e/lib/auth/webauthnwin/webauthn_windows.go:36 +0x169

WebAuthNGetApiVersionNumber is a v1 procedure on WebAuthn.dll, so in its absence we disable WebAuthn support as well (as all bets are off in which other functions may or may not exist).

Changelog: Avoid tsh/WebAuthn.dll panic on Windows Server 2019

@codingllama
Copy link
Copy Markdown
Contributor Author

FYI @stevenGravy.

@stevenGravy
Copy link
Copy Markdown
Contributor

FYI @stevenGravy.

thanks! @tenaciousdlg

@codingllama
Copy link
Copy Markdown
Contributor Author

Steven kindly tried out a test build, seems to be working fine.

@codingllama codingllama added this pull request to the merge queue Feb 21, 2024
Merged via the queue into master with commit ac48c48 Feb 21, 2024
@codingllama codingllama deleted the codingllama/webauthn-dll-zero branch February 21, 2024 13:34
@public-teleport-github-review-bot
Copy link
Copy Markdown

@codingllama See the table below for backport results.

Branch Result
branch/v13 Create PR
branch/v14 Create PR
branch/v15 Create PR

@sergefedorow
Copy link
Copy Markdown

I have the same issue with tsh v.14.3.3 and 15.0.2.
Client is Windows 10 Enterprise Evaluation, version 1809
Installation did from zip file.

C:\Users\IEUser>tsh version
panic: Failed to find WebAuthNGetApiVersionNumber procedure in WebAuthn.dll: The specified procedure could not be found.

goroutine 1 [running]:
golang.org/x/sys/windows.(*LazyProc).mustFind(...)
        C:/Users/runneradmin/go/pkg/mod/golang.org/x/sys@v0.16.0/windows/dll_windows.go:325
golang.org/x/sys/windows.(*LazyProc).Addr(...)
        C:/Users/runneradmin/go/pkg/mod/golang.org/x/sys@v0.16.0/windows/dll_windows.go:333
github.com/gravitational/teleport/lib/auth/webauthnwin.webAuthNGetApiVersionNumber()
        C:/a/teleport.e/teleport.e/lib/auth/webauthnwin/zsyscall_windows.go:83 +0xb4
github.com/gravitational/teleport/lib/auth/webauthnwin.newNativeImpl()
        C:/a/teleport.e/teleport.e/lib/auth/webauthnwin/webauthn_windows.go:65 +0xad
github.com/gravitational/teleport/lib/auth/webauthnwin.init()
        C:/a/teleport.e/teleport.e/lib/auth/webauthnwin/webauthn_windows.go:36 +0x169

@ravicious
Copy link
Copy Markdown
Member

@sergefedorow Could you try tsh v14.3.4 which shipped with this fixed? 15.0.3 is not out yet but it'll include the fix as well.

@sergefedorow
Copy link
Copy Markdown

sergefedorow commented Feb 28, 2024

@ravicious Unfortunately 14.3.4 does not work for me either.

2024-02-28_14-40

@ravicious
Copy link
Copy Markdown
Member

ravicious commented Feb 28, 2024

Sorry, my bad, I looked at the release notes for 14.3.4 and I saw #36868 which was a fix for a similar problem.

14.3.7+ is going to include the fix, I imagine it'll be released later this or next week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants