question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

New Bcrypt credentials enables DoS attack on the protocol adapters.

See original GitHub issue

As per Credentials API, Hono is using Spring security for Bcrypt password encoding.

Spring security supports bcrypt password encoding with log rotations from 4 to 31, 10 being default (i.e:- 2^10 hash iterations). Once hashed, the log rotation used is part of the password like

$2a$21$LQdzaDSINBpHmYRiGEVtkOVt2GScZ6bPvEyoAIpiVIE6F4rviemdm

where $21 represents the log rotation used. There is currently no max limit defined in Hono. If a user, say stores the password with higher rotation, then it could enable a DOS attack on the adapters.

I tested the time taken for BCryptPasswordEncoder.matches with higher log rotation on my laptop (Intel Core i7 - 2.7GHz 8 core, 32 GB RAM) it took

  • 10 - 105 milliseconds
  • 12 - 360 milliseconds
  • 18 - 21 seconds
  • 21 - 178 seconds
  • 31 - more than 1 hour and I had to abort it.

Setting 31 as log rotation will definitely block the protocol adapters.

As a best practise, I would restrict the log rotation to 12 or 14, document them as part of credentials API and have this checked in

org.eclipse.hono.util.CredentialsObject.hasValidSecrets()

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
balsmncommented, Oct 4, 2018

@sophokles73 yes I can work on this PR sometime next week.

0reactions
balsmncommented, Oct 10, 2018

oh, I was about to start this now. Anyways. Thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

New Bcrypt credentials enables DoS attack on the protocol ...
As per Credentials API, Hono is using Spring security for Bcrypt ... New Bcrypt credentials enables DoS attack on the protocol adapters.
Read more >
Should you care about DoS attacks if your server is using ...
Any server is vulnerable to DoS, whether they are using bcrypt or not. Do you mean to ask if a server is particularly...
Read more >
MeasureUp Bank Flashcards | Quizlet
Which of the following can be used to launch a coordinate DDoS attack? ... A credential scan allows you to generate a list...
Read more >
OWASP Threat Model for Secure Password Storage
This document describes goals, threats, and design for a reusable password storage module. (PSM or module). It describes module goals in terms of...
Read more >
What is a Denial-of-Service Attack? - TechTarget
In a DoS attack, malicious actors flood a system with network packets making it unusable. Find out how these attacks work and how...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found