cli icon indicating copy to clipboard operation
cli copied to clipboard

unlock is broken in 0.12.0 and 0.12.1

Open craigvanaman opened this issue 6 years ago • 7 comments

It seems that bw unlock always returns "Invalid Master Password" in versions 0.12.0 and 0.12.1. I don't see this in any of the previous versions. This seems to be the case for prompted input and --raw input.

$ for i in bw_1.11.0 bw_1.12.0 bw_1.12.1; do
echo "";
echo "*** BW client version: $i"; 
./$i --version;
echo "+ Logout"; 
./$i logout; 
echo "+ Log in"; 
export BW_SESSION=$(./$i login "${BITWARDEN_USERNAME}" "${BITWARDEN_PASSWORD}" --raw); 
echo "+ Lock vault"; 
./$i lock; 
echo "+ Confirm lock"; 
./$i unlock --check; 
echo "+ Attempt unlock"; 
./$i unlock;
done

*** BW client version: bw_1.11.0
1.11.0
+ Logout
You have logged out.
+ Log in
+ Lock vault
Your vault is locked.
+ Confirm lock
Vault is locked.
+ Attempt unlock
? Master password: [hidden]
Your vault is now unlocked!

To unlock your vault, set your session key to the `BW_SESSION` environment variable. ex:
$ export BW_SESSION="xxxxxxxxxxxxxxxxxxxxxxx"
> $env:BW_SESSION="xxxxxxxxxxxxxxxxxxxxxxx"

You can also pass the session key to any command with the `--session` option. ex:
$ bw list items --session xxxxxxxxxxxxxxxxxxxxxxx

*** BW client version: bw_1.12.0
1.12.0
+ Logout
You have logged out.
+ Log in
+ Lock vault
Your vault is locked.
+ Confirm lock
Vault is locked.
+ Attempt unlock
? Master password: [hidden]
Invalid master password.

*** BW client version: bw_1.12.1
1.12.1
+ Logout
You have logged out.
+ Log in
+ Lock vault
Your vault is locked.
+ Confirm lock
Vault is locked.
+ Attempt unlock
? Master password: [hidden]
Invalid master password.

craigvanaman avatar Nov 13 '20 11:11 craigvanaman

@cscharf @addisonbeck Might be released to the identity issues.

kspearrin avatar Nov 13 '20 16:11 kspearrin

@craigvanaman , is this still occurring?

cscharf avatar Nov 13 '20 16:11 cscharf

Yes @cscharf, tested it today.

craigvanaman avatar Nov 13 '20 18:11 craigvanaman

When today? We had identity server issues earlier today which have since been resolved.

cscharf avatar Nov 13 '20 19:11 cscharf

Sorry, i should have realised you wanted me to recheck. I just re-downloaded 11.0, 12.0 and 12.1 from github releases and ran the same test again and i still see the same behaviour.

$ for j in 1.11.0 1.12.0 1.12.1; do bash bw-get.sh $j; mv bw bw_$j; done
Archive:  bitwarden.zip
  inflating: bw                      
Archive:  bitwarden.zip
  inflating: bw                      
Archive:  bitwarden.zip
  inflating: bw

$ for i in bw_1.11.0 bw_1.12.0 bw_1.12.1; do
echo "";
echo "*** BW client version: $i";
./$i --version;
echo "+ Logout";
./$i logout;
echo "+ Log in";
export BW_SESSION=$(./$i login "${BITWARDEN_USERNAME}" "${BITWARDEN_PASSWORD}" --raw);
echo "+ Lock vault";
./$i lock;
echo "+ Confirm lock";
./$i unlock --check;
echo "+ Attempt unlock";
./$i unlock;
done

*** BW client version: bw_1.11.0
1.11.0
+ Logout
You have logged out.
+ Log in
+ Lock vault
Your vault is locked.
+ Confirm lock
Vault is locked.
+ Attempt unlock
? Master password: [hidden]
Your vault is now unlocked!

To unlock your vault, set your session key to the `BW_SESSION` environment variable. ex:
$ export BW_SESSION="xxxxxxxxxxxxx"
> $env:BW_SESSION="xxxxxxxxxxxxx"

You can also pass the session key to any command with the `--session` option. ex:
$ bw list items --session xxxxxxxxxxxxx

*** BW client version: bw_1.12.0
1.12.0
+ Logout
You have logged out.
+ Log in
+ Lock vault
Your vault is locked.
+ Confirm lock
Vault is locked.
+ Attempt unlock
? Master password: [hidden]
Invalid master password.

*** BW client version: bw_1.12.1
1.12.1
+ Logout
You have logged out.
+ Log in
+ Lock vault
Your vault is locked.
+ Confirm lock
Vault is locked.
+ Attempt unlock
? Master password: [hidden]
Invalid master password.

craigvanaman avatar Nov 14 '20 09:11 craigvanaman

We are on a self hosted instance. Could there have been a breaking change with older server versions?

craigvanaman avatar Nov 14 '20 11:11 craigvanaman

We've upgraded our server from 1.35.1 to 1.39.4 and this has fixed the issue. v11 to v14 of the CLI all work for us now. So it was a backwards compatibility issue with the older server and the new CLI. Closing this issue.

craigvanaman avatar Feb 16 '21 10:02 craigvanaman