libp2p / libp2p/jvm-libp2p

jvm-ibp2p vulnerable to attack using large RSA keys

Open
#418 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Kotlin
Stars
366
Forks
85
Avg merge
2d 39m
Merged PRs (30d)
6

Description

Summary

There is no length limit for RSA keys, and a malicious node can exploit large RSA keys to launch a resource exhaustion attack.
A malicious peer can use large RSA keys to run a resource exhaustion attack & force a node to spend time doing signature verification of the large key.
there is a similar problem
The relevant codes are in file1(RSA key generation and parsing functions)

Expected behavior

refuse large rsa key

Actual behavior

There is no length limit for RSA keys.

Relevant log output

Possible Solution

The vulnerability can be fixed by restricting the length of RSA keys. it is similar to this.
The fix could be to limit the RSAkeys length.

Version

the latest version

Would you like to work on fixing this bug ?

Yes

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in libp2p/src/main/kotlin/io/libp2p/crypto/keys/Rsa.kt, especially the RSA key generation and parsing functions identified in the issue. Review the analogous go-libp2p pull request and the linked advisory to determine the intended key-size restriction. Done means oversized RSA keys are refused without allowing the resource-exhaustion behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
kotlin
Domain
cryptography, security
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.