Skip to content
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

add nil check for mfa enforcement config namespace on login #20375

Merged
merged 2 commits into from
Apr 26, 2023

Conversation

davidadeleon
Copy link
Contributor

This PR adds a nil check around the namespace for a MFA enforcement config. This resolves a panic experienced on login after deleting a namespace which contains a MFA enforcement configuration.
Example Panic:

2023-04-26T12:39:37.380-0400 [INFO]  http: panic serving 127.0.0.1:64255: runtime error: invalid memory address or nil pointer dereference
goroutine 930 [running]:
net/http.(*conn).serve.func1()
	/Users/runner/actions-runner/_work/_tool/go/1.19.4/x64/src/net/http/server.go:1850 +0xbf
panic({0x5dfd600, 0xae57de0})
	/Users/runner/actions-runner/_work/_tool/go/1.19.4/x64/src/runtime/panic.go:890 +0x262
github.com/hashicorp/vault/vault.(*Core).buildMFAEnforcementConfigList(0xc000ae6000, {0x7dca1b8, 0xc000adf3e0}, 0xc0012de1c0, {0xc001cf723a, 0x17})
	/Users/runner/actions-runner/_work/vault-enterprise/vault-enterprise/vault/login_mfa.go:1696 +0x2f2
github.com/hashicorp/vault/vault.(*Core).handleLoginRequest(0xc000ae6000, {0x7dca1b8, 0xc000adf3e0}, 0xc00165ec00)
	/Users/runner/actions-runner/_work/vault-enterprise/vault-enterprise/vault/request_handling.go:1506 +0x19e9
github.com/hashicorp/vault/vault.(*Core).handleCancelableRequest(0xc000ae6000, {0x7dca1b8, 0xc000adf3b0}, 0xc00165ec00)
	/Users/runner/actions-runner/_work/vault-enterprise/vault-enterprise/vault/request_handling.go:663 +0x15fe
github.com/hashicorp/vault/vault.(*Core).switchedLockHandleRequest(0xc000ae6000, {0x7dca1b8, 0xc000adee40}, 0xc00165ec00, 0xc0?)
	/Users/runner/actions-runner/_work/vault-enterprise/vault-enterprise/vault/request_handling.go:472 +0x539
github.com/hashicorp/vault/vault.(*Core).HandleRequest(...)

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.

4 participants