jvm-ibp2p vulnerable to attack using large RSA keys
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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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