Authentication bypass vulnerability discovered in Bouncy Castle

Attackers can bypass password checks in applications that use Bouncy Castle’s OpenBSDBcrypt class.

Password stars on a computer screen

Security researchers have found a flaw in a Java cryptography library that could enable hackers to brute force Bcrypt hashed passwords. Once exploited, a hacker could gain administrator-level access to a single sign-on (SSO) system

CVE-2020-28052 is an authentication bypass vulnerability in the OpenBSDBcrypt class of the popular Bouncy Castle library. Bcrypt hashing–based authentication is used for authentication checks, for example, in web applications and APIs. 

The exploit means an attacker could effectively bypass password checks in applications using the Bcrypt algorithm for password hashing. According to a Synopsys blog post, the vulnerability in the method OpenBSDBcrypt.doCheckPassword was introduced in a GitHub commit.

Researchers said 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 doesn’t contain them. Passing this check means an attacker doesn’t need a byte-for-byte match with the stored hash value,” researchers said.

In most cases where Bcrypt.doCheckPassword() is used to check a password, successful exploitation will cause an authentication bypass.

Researchers said a hacker must brute-force password attempts until they trigger a bypass.

“Our experiments show that 20% of tested passwords were successfully bypassed within 1,000 attempts. Some password hashes take more attempts, determined by how many bytes lie between 0 and 60 (1 to 59). Further, our investigation shows that all password hashes can be bypassed with enough attempts. In rare cases, some password hashes can be bypassed with any input,” said researchers.

Researchers shared the bug with Bouncy Castle on October 20, who fixed it in early November and published an advisory on December 18. The disclosure led Synopsys to check its use of the Bouncy Castle software, but none of its software used the affected versions.

According to researchers, affected software included Bouncy Castle 1.65 (released March 31, 2020) and Bouncy Castle 1.66 (released July 4, 2020). This authentication bypass issue affects no other versions of the software. Synopsys strongly recommended that software vendors and Bouncy Castle library users upgrade to Bouncy Castle Java release 1.67 or later.

Featured Resources

Managing security risk and compliance in a challenging landscape

How key technology partners grow with your organisation

Download now

Evaluate your order-to-cash process

15 recommended metrics to benchmark your O2C operations

Download now

AI 360: Hold, fold, or double down?

How AI can benefit your business

Download now

Getting started with Azure Red Hat OpenShift

A developer’s guide to improving application building and deployment capabilities

Download now

Recommended

Global ransom DDoS extortionists are retargeting companies
distributed denial of service (DDOS)

Global ransom DDoS extortionists are retargeting companies

22 Jan 2021
Best ransomware removal tools
ransomware

Best ransomware removal tools

22 Jan 2021
Hackers publish over 4,000 files stolen from SEPA in ransomware attack
Security

Hackers publish over 4,000 files stolen from SEPA in ransomware attack

22 Jan 2021
BEC scammers are using Google Forms to identify easy victims
phishing

BEC scammers are using Google Forms to identify easy victims

21 Jan 2021

Most Popular

School laptops sent by government arrive loaded with malware
malware

School laptops sent by government arrive loaded with malware

21 Jan 2021
How to move Windows 10 from your old hard drive to SSD
operating systems

How to move Windows 10 from your old hard drive to SSD

21 Jan 2021
What is the Raspberry Pi Pico?
Hardware

What is the Raspberry Pi Pico?

21 Jan 2021