| Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
|---|---|---|---|
| org.bouncycastle:bc-fips | maven | = 2.1.0 | 2.1.1 |
The vulnerability is an out-of-bounds write in the doFinal method of the BaseCipher class in Bouncy Castle for Java. The analysis started by trying to locate the fixing commit to pinpoint the exact code changes. However, due to non-standard versioning tags and the lack of a public pull request or commit message referencing the CVE, it was not possible to find the specific patch.
Despite the absence of a patch, the vulnerability description is very specific, pointing to the org/bouncycastle/jcajce/provider/BaseCipher class and the doFinal method. By exploring the source code of the bcgit/bc-java repository, the file prov/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/util/BaseCipherSpi.java was identified as the most likely implementation of the vulnerable class. This file contains the engineDoFinal method, which corresponds to the doFinal method of the javax.crypto.CipherSpi class that it extends.
The vulnerability is triggered when the same byte array is used for both input and output, but with different offsets. This can cause the output of the cipher to overwrite the input prematurely, leading to incorrect results and potentially an out-of-bounds write. Therefore, the engineDoFinal method is identified as the vulnerable function. The confidence is high because the vulnerability description directly points to this function and the scenario described is a well-known cause of such vulnerabilities.
Ongoing coverage of React2Shell