CVE-2023-46234: browserify-sign vulnerable via an upper bound check issue in `dsaVerify` that leads to a signature forgery attack
Summary An upper bound check issue in dsaVerify function allows an attacker to construct signatures that can be successfully verified by any public key, thus leading to a signature forgery attack.
Details In dsaVerify function, it checks whether the value of the signature is legal by calling function checkValue, namely, whether r and s are both in the interval [1, q - 1]. However, the second line of the checkValue function wrongly checks the upper bound of the passed parameters, since the value of b.cmp(q) can only be 0, 1 and -1, and it can never be greater than q.
In this way, although the values of s cannot be 0, an attacker can achieve the same effect as zero by setting its value to q, and then send (r, s) = (1, q) to pass the verification of any public key.
Impact All places in this project that involve DSA verification of user-input signatures will be affected by this vulnerability.
Fix PR: Since the temporary private fork was deleted, here's a webarchive of the PR discussion and diff pages: PR webarchive.zip
Other sources
browserify-sign is a package to duplicate the functionality of node's crypto public key functions, much of this is based on Fedor Indutny's work on indutny/tls.js. An upper bound check issue in dsaVerify function allows an attacker to construct signatures that can be successfully verified by any public key, thus leading to a signature forgery attack. All places in this project that involve DSA verification of user-input signatures will be affected by this vulnerability. This issue has been patched in version 4.2.2.
— Ubuntu
Affected Software
Event History
Frequently Asked Questions
What is CVE-2023-46234?
CVE-2023-46234 is a vulnerability in the browserify-sign package that allows an attacker to construct signatures which can be successfully verified by any public key, leading to a signature forgery attack.
How does CVE-2023-46234 work?
CVE-2023-46234 works by exploiting an upper bound check issue in the dsaVerify function of the browserify-sign package.
What is the severity rating of CVE-2023-46234?
CVE-2023-46234 has a severity rating of 7.5 (high).
Which software is affected by CVE-2023-46234?
The browserify-sign package with versions 2.6.0 to 4.2.1 (inclusive) is affected by CVE-2023-46234.
How can I fix CVE-2023-46234?
To fix CVE-2023-46234, update the browserify-sign package to version 4.2.2 or higher.