Skip to content

Commit

Permalink
Bugfix/afqdn check (#6891)
Browse files Browse the repository at this point in the history
* Added logic to convert afqdn

* Added test case for afqdn

* Version bump - convert afqdn to fqdn before testing domain against lists

* Correct variable name
  • Loading branch information
409H committed Mar 22, 2022
1 parent 3568777 commit e58ead2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eth-phishing-detect",
"version": "1.1.15",
"version": "1.1.16",
"description": "Utility for detecting phishing domains targeting Ethereum users",
"main": "src/index.js",
"scripts": {
Expand Down
6 changes: 5 additions & 1 deletion src/detector.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ class PhishingDetector {
}

check (domain) {
const source = domainToParts(domain)
let fqdn = domain.substring(domain.length - 1) === "."
? domain.slice(0, -1)
: domain;

const source = domainToParts(fqdn)

// if source matches whitelist domain (or subdomain thereof), PASS
const whitelistMatch = matchPartsAgainstList(source, this.whitelist)
Expand Down
1 change: 1 addition & 0 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ function startTests () {
"metamask.com",
"wallet-ethereum.net",
"etherclassicwallet.com",
"wallet-ethereum.net." //Test for absolute fully-qualified domain name
])

// whitelist
Expand Down

0 comments on commit e58ead2

Please sign in to comment.