MasterPass.check is vulnerable to timing attacks.
See original GitHub issueSummary
Timing attacks are a type of side channel attack where one can discover valuable information by recording the time it takes for a cryptographic algorithm to execute.
_.isEqual()
does a byte-by-byte comparison of two values and as soon as the two differentiate it terminates. This means the longer it takes until the operation returns, the more correct characters the attacker has guessed.
const match = _.isEqual(global.creds.mpkhash, mpk.hash)
Link to source code: https://github.com/HR/Crypter/blob/master/app/src/MasterPass.js#L23
How can this be fixed?
The following code does not terminate as soon as two bytes are not the same:
var result = 0;
for (var i = 0; i < a.length; ++i) {
result |= (a.charCodeAt(i) ^ b.charCodeAt(i));
}
return result;
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Timing Attacks Have Never Been So Practical - YouTube
by Nethanel GelernterCross-site search (XS- search ) is a practical timing side-channel attack that allows the extraction of sensitive ...
Read more >What is a Timing Attack Vulnerability?
In a timing attack, the attacker gains information that is indirectly leaked by the application. This information is then used for malicious purposes,...
Read more >Timing Attacks Have Never Been So Practical
Agenda – practical timing attacks. • Cross-site search (XS-search) attacks &. Response inflation ... the challenge is to find all the vulnerable spots....
Read more >Introduction to Timing Attacks!
A timing attack is a security exploit that enables an attacker to spot vulnerabilities in a local or a remote system to extract...
Read more >Developer security best practices: protecting against timing ...
In this article, we're going to take a look at timing attacks. Timing attacks are a particular type of attack that exploits flaws...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Issue fixed!
Your implementation solves this issue perfectly.