CVE-2023-46234
JSON

6.5medium

browserify-sign vulnerable via an upper bound check issue in `dsaVerify` that leads to a signature forgery attack

Severity
6.5medium CVSS:3.1 by GitHub_M
Exploit likelihood
0.56% (higher than 48% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-x9w5-v3q2-3rhw

Description

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.

Affected

Product or packageVersionsReported by
browserify browserify-sign>= 2.6.0, <= 4.2.1, before 4.2.2CVE List, NVD
browserify-sign (npm)from 2.6.0 before 4.2.2GitHub Advisory Database
debian debian_linux11.0, 12.0NVD

All scores

GitHub_M6.5medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N
GitHub7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
NVD7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N

Classification

What each source says

CVE List

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.

GitHub Advisory Database
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

NVD (es)

browserify-sign es un paquete para duplicar la funcionalidad de las funciones de clave pública criptográfica del nodo, gran parte de esto se basa en el trabajo de Fedor Indutny en indutny/tls.js. Un problema de verificación de límite superior en la función `dsaVerify` permite a un atacante construir firmas que pueden verificarse con éxito mediante cualquier clave pública, lo que lleva a un ataque de falsificación de firmas. Todos los lugares de este proyecto que implican la verificación DSA de las firmas ingresadas por los usuarios se verán afectados por esta vulnerabilidad. Este problema se solucionó en la versión 4.2.2.

References

https://github.com/browserify/browserify-sign/security/advisories/GHSA-x9w5-v3q2-3rhwthird-party-advisory, web
https://github.com/browserify/browserify-sign/commit/85994cd6348b50f2fd1b73c54e20881416f44a30third-party-advisory, web
https://lists.debian.org/debian-lts-announce/2023/10/msg00040.htmlthird-party-advisory, web
https://www.debian.org/security/2023/dsa-5539third-party-advisory, web
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/6PVVPNSAGSDS63HQ74PJ7MZ3MU5IYNVZ/release-notes
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/3HUE6ZR5SL73KHL7XUPAOEL6SB7HUDT2/release-notes
https://nvd.nist.gov/vuln/detail/CVE-2023-46234advisory
https://github.com/browserify/browserify-signpackage
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/3HUE6ZR5SL73KHL7XUPAOEL6SB7HUDT2web
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/6PVVPNSAGSDS63HQ74PJ7MZ3MU5IYNVZweb

Sources

SourceRecordLicence
CVE ListCVE-2023-46234 changed 2025-02-13CVE Terms of Use
GitHub Advisory DatabaseGHSA-x9w5-v3q2-3rhw changed 2026-09-10CC-BY-4.0
NVDCVE-2023-46234 changed 2026-06-17Public domain