Skip to content

Commit 3f32f9e

Browse files
Merge pull request #34 from andrew-schofield/disable-unsafe-password-check
Disable unsafe password check
2 parents b744c07 + 98bf390 commit 3f32f9e

File tree

8 files changed

+16
-32
lines changed

8 files changed

+16
-32
lines changed

Changelog.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# keepass2-haveibeenpwned Changelog
22

3+
### v1.2.3 - 2017-10-27
4+
* Temporarily disable the password check mode as it sends weakly hashed passwords (although encrypted) to HIBP.
5+
36
### v1.2.2 - 2017-10-21
47
* Alter the way developer extensions are referenced to prevent dependency on a specific version of KeePass
58

HaveIBeenPwned.plgx

-283 Bytes
Binary file not shown.

HaveIBeenPwned/BreachCheckers/HaveIBeenPwnedPassword/HaveIBeenPwnedPasswordChecker.cs

+3-24
Original file line numberDiff line numberDiff line change
@@ -61,36 +61,15 @@ await Task.Run(() =>
6161
private async Task<List<HaveIBeenPwnedPasswordEntry>> GetBreaches(IProgress<ProgressItem> progressIndicator, IEnumerable<PwEntry> entries)
6262
{
6363
List<HaveIBeenPwnedPasswordEntry> allBreaches = new List<HaveIBeenPwnedPasswordEntry>();
64-
int counter = 0;
64+
/*int counter = 0;
6565
SHA1 sha = new SHA1CryptoServiceProvider();
6666
foreach (var entry in entries)
6767
{
6868
counter++;
6969
progressIndicator.Report(new ProgressItem((uint)((double)counter / entries.Count() * 100), string.Format("Checking \"{0}\" for breaches", entry.Strings.ReadSafe(PwDefs.TitleField))));
7070
if(entry.Strings.Get(PwDefs.PasswordField) == null || string.IsNullOrWhiteSpace(entry.Strings.ReadSafe(PwDefs.PasswordField)) || entry.Strings.ReadSafe(PwDefs.PasswordField).StartsWith("{REF:")) continue;
71-
HttpResponseMessage response = null;
72-
try
73-
{
74-
response = await client.GetAsync(new Uri("https://haveibeenpwned.com/api/v2/pwnedpassword/" + string.Join("", sha.ComputeHash(entry.Strings.Get(PwDefs.PasswordField).ReadUtf8()).Select(x => x.ToString("x2")).ToArray())));
75-
}
76-
catch (Exception ex)
77-
{
78-
throw ex;
79-
}
80-
81-
if (response.IsSuccessStatusCode)
82-
{
83-
allBreaches.Add(new HaveIBeenPwnedPasswordEntry(entry.Strings.ReadSafe(PwDefs.UserNameField), entry.GetUrlDomain(), entry));
84-
}
85-
else if (response.StatusCode != System.Net.HttpStatusCode.NotFound)
86-
{
87-
MessageBox.Show(string.Format("Unable to check haveibeenpwned.com (returned Status: {0})", response.StatusCode), Resources.MessageTitle, MessageBoxButtons.OK, MessageBoxIcon.Error);
88-
}
89-
// hibp has a rate limit of 1500ms
90-
await Task.Delay(1600);
91-
}
92-
93-
71+
var passwordHash = sha.ComputeHash(entry.Strings.Get(PwDefs.PasswordField).ReadUtf8()).Select(x => x.ToString("x2")).ToArray();
72+
} */
9473
return allBreaches;
9574
}
9675
}

HaveIBeenPwned/HaveIBeenPwnedExt.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,11 @@ public override bool Initialize(IPluginHost host)
7777
haveIBeenPwnedUsernameMenuItem.Click += this.CheckHaveIBeenPwnedUsernames;
7878
haveIBeenPwnedMenuItem.DropDown.Items.Add(haveIBeenPwnedUsernameMenuItem);
7979

80-
haveIBeenPwnedPasswordMenuItem = new ToolStripMenuItem();
80+
/*haveIBeenPwnedPasswordMenuItem = new ToolStripMenuItem();
8181
haveIBeenPwnedPasswordMenuItem.Text = "Check for breaches based on password";
8282
haveIBeenPwnedPasswordMenuItem.Image = Resources.hibp.ToBitmap();
8383
haveIBeenPwnedPasswordMenuItem.Click += this.CheckHaveIBeenPwnedPasswords;
84-
haveIBeenPwnedMenuItem.DropDown.Items.Add(haveIBeenPwnedPasswordMenuItem);
84+
haveIBeenPwnedMenuItem.DropDown.Items.Add(haveIBeenPwnedPasswordMenuItem);*/
8585

8686
tsMenu.Add(haveIBeenPwnedMenuItem);
8787

@@ -94,10 +94,10 @@ public override void Terminate()
9494
ToolStripItemCollection tsMenu = pluginHost.MainWindow.ToolsMenu.DropDownItems;
9595
haveIBeenPwnedServiceMenuItem.Click -= this.CheckHaveIBeenPwnedSites;
9696
haveIBeenPwnedUsernameMenuItem.Click -= this.CheckHaveIBeenPwnedUsernames;
97-
haveIBeenPwnedPasswordMenuItem.Click -= this.CheckHaveIBeenPwnedPasswords;
97+
/*haveIBeenPwnedPasswordMenuItem.Click -= this.CheckHaveIBeenPwnedPasswords;*/
9898
haveIBeenPwnedMenuItem.DropDown.Items.Remove(haveIBeenPwnedServiceMenuItem);
9999
haveIBeenPwnedMenuItem.DropDown.Items.Remove(haveIBeenPwnedUsernameMenuItem);
100-
haveIBeenPwnedMenuItem.DropDown.Items.Remove(haveIBeenPwnedPasswordMenuItem);
100+
/*haveIBeenPwnedMenuItem.DropDown.Items.Remove(haveIBeenPwnedPasswordMenuItem);*/
101101
tsMenu.Remove(haveIBeenPwnedMenuItem);
102102
tsMenu.Remove(toolStripSeperator);
103103
}

HaveIBeenPwned/Properties/AssemblyInfo.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@
3232
// You can specify all the values or you can default the Build and Revision Numbers
3333
// by using the '*' as shown below:
3434
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("1.2.2.0")]
36-
[assembly: AssemblyFileVersion("1.2.2.0")]
35+
[assembly: AssemblyVersion("1.2.3.0")]
36+
[assembly: AssemblyFileVersion("1.2.3.0")]

README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@
1616
* [Have I Been Pwned (HIBP)](https://haveibeenpwned.com/) - Checks the usernames of any entries against the Have I Been Pwned? list curated by Troy Hunt
1717

1818
### Password based
19-
* [Have I Been Pwned (HIBP)](https://haveibeenpwned.com/) - Checks the passwords of any entries against the Have I Been Pwned? list curated by Troy Hunt
19+
~~[Have I Been Pwned (HIBP)](https://haveibeenpwned.com/) - Checks the passwords of any entries against the Have I Been Pwned? list curated by Troy Hunt~~
20+
21+
**This checker is disabled in the current version of the plugin** as the HIBP password checking API requires passwords to only weakly-hashed. Although these hashes are encrypted in transit, this is still an insecure way of checking password breaches. A future updates should enable offline password breach checking. See https://github.com/andrew-schofield/keepass2-haveibeenpwned/issues/33 for reference.
2022

2123
## Usage
2224

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
:
2-
HaveIBeenPwned checker:1.2.2
2+
HaveIBeenPwned checker:1.2.3
33
:

mono/HaveIBeenPwned.dll

-4 KB
Binary file not shown.

0 commit comments

Comments
 (0)