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

Crash when trying to return wrapped token with userpass auth CLI #3217

Closed
lauradiane opened this issue Aug 21, 2017 · 0 comments
Closed

Crash when trying to return wrapped token with userpass auth CLI #3217

lauradiane opened this issue Aug 21, 2017 · 0 comments
Milestone

Comments

@lauradiane
Copy link
Contributor

When I try to return a wrapped token from the userpass auth login using the typical -wrap-ttl parameter, it causes a SIGSEGV.

Example:

$ vault auth -wrap-ttl=1m -method=userpass username=luva

// OR:

$ vault auth -method=userpass -wrap-ttl=1m username=luva
Password (will be hidden):

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x1935d99]

goroutine 1 [running]:
github.com/hashicorp/vault/builtin/credential/userpass.(*CLIHandler).Auth(0xc420209530, 0xc4206c5d40, 0xc420203170, 0x0, 0x0, 0x0, 0x0)
/gopath/src/github.com/hashicorp/vault/builtin/credential/userpass/cli.go:64 +0x329
github.com/hashicorp/vault/command.(*AuthCommand).Run(0xc42006f040, 0xc42000e1b0, 0x1, 0x1, 0xc420208f20)
/gopath/src/github.com/hashicorp/vault/command/auth.go:169 +0xe76
github.com/hashicorp/vault/vendor/github.com/mitchellh/cli.(*CLI).Run(0xc4200898c0, 0xc4200898c0, 0x27, 0x297c698)
/gopath/src/github.com/hashicorp/vault/vendor/github.com/mitchellh/cli/cli.go:235 +0x2d1
github.com/hashicorp/vault/cli.RunCustom(0xc42000e1a0, 0x4, 0x4, 0xc420150510, 0x0)
/gopath/src/github.com/hashicorp/vault/cli/main.go:44 +0x4ea
github.com/hashicorp/vault/cli.Run(0xc42000e1a0, 0x4, 0x4, 0xc420000340)
/gopath/src/github.com/hashicorp/vault/cli/main.go:11 +0x56
main.main()
/gopath/src/github.com/hashicorp/vault/main.go:10 +0x64

Environment:

  • Vault Version: 0.8.1 and 0.8.1+ent

Expected Behavior:
Should return a wrapped token

Workaround:
Able to workaround this with vault write command for now. This successfully returns a wrapped token:

$ vault write -wrap-ttl=1m auth/userpass/login/luva password=foo 
@jefferai jefferai added this to the 0.8.2 milestone Aug 29, 2017
jefferai added a commit that referenced this issue Aug 31, 2017
This allows us to properly handle wrapped responses.

Fixes #3217
jefferai added a commit that referenced this issue Aug 31, 2017
This allows us to properly handle wrapped responses.

Fixes #3217
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

No branches or pull requests

2 participants