Bitcoin Forum
April 27, 2024, 12:57:40 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: [Bouncy Castle]: vulnerability (CVE-2020-28052)  (Read 184 times)
Dave1 (OP)
Hero Member
*****
Offline Offline

Activity: 1288
Merit: 522



View Profile
December 18, 2020, 08:12:02 AM
Merited by vapourminer (2), ranochigo (2), ABCbits (1), aliashraf (1)
 #1

Bounty Castle, a popular open source cryptography library, has been found to have a authentication bypass vulnerability, tracked in CVE-2020-28052, which can be found in their OpenBSDBcrypt class. Is because their Bcrypt.doCheckPassword() function has an error in logic and attackers can bypass password checks.

Code:
boolean isEqual = sLength == newBcryptString.length();
for (int i = 0; i != sLength; i++)
{
    isEqual &= (bcryptString.indexOf(i) == newBcryptString.indexOf(i));
}
return isEqual;

Quote
The doCheckPassword method implements a flawed verification routine. The code checks for an index of characters from 0 to 59 inclusive, rather than checking that characters at positions from 0 to 59 match. This means that passwords that result in hashes that, for instance, don’t contain bytes between 0x00 and 0x3B match every other password hash that don’t contain them. Passing this check means an attacker doesn’t need a byte-for-byte match with the stored hash value.

Timeline:
  • October 20, 2020: Vulnerability disclosed to Bouncy Castle
  • October 22, 2020: Synopsys confirms no products use version vulnerable to this issue
  • October 27, 2020: Synopsys discloses vulnerability to Bouncy Castle
  • October 28, 2020: Bouncy Castle confirms vulnerability
  • November 2, 2020: Synopsys validates Bouncy Castle fixed vulnerability
  • December 17, 2020: Advisory published

For a more detailed explanation you can read it here: (https://www.synopsys.com/blogs/software-security/cve-2020-28052-bouncy-castle/)


R


▀▀▀▀▀▀▀██████▄▄
████████████████
▀▀▀▀█████▀▀▀█████
████████▌███▐████
▄▄▄▄█████▄▄▄█████
████████████████
▄▄▄▄▄▄▄██████▀▀
LLBIT
  CRYPTO   
FUTURES
 1,000x 
LEVERAGE
COMPETITIVE
    FEES    
 INSTANT 
EXECUTION
.
   TRADE NOW   
Transactions must be included in a block to be properly completed. When you send a transaction, it is broadcast to miners. Miners can then optionally include it in their next blocks. Miners will be more inclined to include your transaction if it has a higher transaction fee.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714179460
Hero Member
*
Offline Offline

Posts: 1714179460

View Profile Personal Message (Offline)

Ignore
1714179460
Reply with quote  #2

1714179460
Report to moderator
1714179460
Hero Member
*
Offline Offline

Posts: 1714179460

View Profile Personal Message (Offline)

Ignore
1714179460
Reply with quote  #2

1714179460
Report to moderator
1714179460
Hero Member
*
Offline Offline

Posts: 1714179460

View Profile Personal Message (Offline)

Ignore
1714179460
Reply with quote  #2

1714179460
Report to moderator
NotATether
Legendary
*
Offline Offline

Activity: 1582
Merit: 6688


bitcoincleanup.com / bitmixlist.org


View Profile WWW
December 18, 2020, 09:37:41 AM
 #2

This must have been a programming error from a junior JS developer or someone who was in a rush. A more experienced dev taking their time wouldn't mix up array access using [] with indexOf().

Cryptography projects that require all developers to have several months of language experience and code to be peer-reviewed usually don't contain these trivial vulnerabilities.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
pooya87
Legendary
*
Offline Offline

Activity: 3430
Merit: 10504



View Profile
December 18, 2020, 01:56:54 PM
Merited by malevolent (1), Carlton Banks (1), ABCbits (1), aliashraf (1)
 #3

Wikipedia page (https://en.wikipedia.org/wiki/Bouncy_Castle_(cryptography)) mention this library is for Java and C#, so i wonder how many Bitcoin wallet/library written on Java or C# ?
Wasabi is written in C# and its dependency NBitcoin used to depend on BouncyCastle, don't know how much of it is changed now.
BitcoinJ (written in Java) and by extension any wallet/tool created on top of it (which are a lot) depend on BouncyCastle for a lot of their cryptography.
Mycelium (written in Java) has a dependency on BouncyCastle.

Whether this vulnerability affects any of these wallets, I do not know.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
Dave1 (OP)
Hero Member
*****
Offline Offline

Activity: 1288
Merit: 522



View Profile
December 18, 2020, 11:52:26 PM
Merited by malevolent (1)
 #4

And based on the search I did, Bouncy Castle was well known, seen threads as old as 2011.

[1]Bouncy Castle help for a N00b Smiley
[2][SOLVED] Java/BouncyCastle - How to create public key with x and y coordinates?

So I will just assume Bouncy Castle is popular amongst cryptographic community.

R


▀▀▀▀▀▀▀██████▄▄
████████████████
▀▀▀▀█████▀▀▀█████
████████▌███▐████
▄▄▄▄█████▄▄▄█████
████████████████
▄▄▄▄▄▄▄██████▀▀
LLBIT
  CRYPTO   
FUTURES
 1,000x 
LEVERAGE
COMPETITIVE
    FEES    
 INSTANT 
EXECUTION
.
   TRADE NOW   
odolvlobo
Legendary
*
Offline Offline

Activity: 4298
Merit: 3209



View Profile
December 21, 2020, 10:51:59 AM
 #5

It appears that it only affected certain versions of the Java implementation.

Join an anti-signature campaign: Click ignore on the members of signature campaigns.
PGP Fingerprint: 6B6BC26599EC24EF7E29A405EAF050539D0B2925 Signing address: 13GAVJo8YaAuenj6keiEykwxWUZ7jMoSLt
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!