Advisory

GHSA-x9w5-v3q2-3rhw

Also known as: CVE-2023-46234

Summary

browserify-sign upper bound check issue in dsaVerify leads to a signature forgery attack

Details

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

Severity

High Basis: The source's own band: HIGH

Dates

Published
2023-10-26 20:53 UTC
Modified
2026-09-10 03:50 UTC

Affected packages and fixes

browserify-sign

npm · All systems

Affected

  • introduced 2.6.0, fixed 4.2.2 (semver)

Fixed versions

4.2.2

Fix

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences