mirror of
https://github.com/bitwarden/browser.git
synced 2024-12-22 16:29:09 +01:00
[PM-9619] Fix broken vault upon saving empty URI (#10037)
* [PM-9619] Add null check for URI before validating checksum * [PM-9619] Prevent saving empty string login URIs
This commit is contained in:
parent
0e2c486a38
commit
2fe07f3d8e
@ -69,6 +69,11 @@ export class Login extends Domain {
|
||||
if (this.uris != null) {
|
||||
view.uris = [];
|
||||
for (let i = 0; i < this.uris.length; i++) {
|
||||
// If the uri is null, there is nothing to decrypt or validate
|
||||
if (this.uris[i].uri == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const uri = await this.uris[i].decrypt(orgId, encKey);
|
||||
// URIs are shared remotely after decryption
|
||||
// we need to validate that the string hasn't been changed by a compromised server
|
||||
|
@ -1374,7 +1374,7 @@ export class CipherService implements CipherServiceAbstraction {
|
||||
|
||||
if (model.login.uris != null) {
|
||||
cipher.login.uris = [];
|
||||
model.login.uris = model.login.uris.filter((u) => u.uri != null);
|
||||
model.login.uris = model.login.uris.filter((u) => u.uri != null && u.uri !== "");
|
||||
for (let i = 0; i < model.login.uris.length; i++) {
|
||||
const loginUri = new LoginUri();
|
||||
loginUri.match = model.login.uris[i].match;
|
||||
|
Loading…
Reference in New Issue
Block a user