Incorrect Bitwise Shift of Integer Affecting @apeleghq/asn1-der package, versions <1.0.5


Severity

Recommended
0.0
medium
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.24% (17th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-JS-APELEGHQASN1DER-9743579
  • published17 Apr 2025
  • disclosed7 Apr 2025
  • creditUnknown

Introduced: 7 Apr 2025

CVE-2025-32029  (opens in a new tab)
CWE-1335  (opens in a new tab)

How to fix?

Upgrade @apeleghq/asn1-der to version 1.0.5 or higher.

Overview

@apeleghq/asn1-der is an A collection of utility classes to encode ASN.1 data following DER rules

Affected versions of this package are vulnerable to Incorrect Bitwise Shift of Integer via the number DER encoding. An attacker can cause the application to enter an infinite loop by providing values in the specific range of 2**31 -- 2**32 - 1, which are not properly handled by the numBitLen function. This results in a denial of service. Additionally, the encoding issues can lead to incorrect value representation when handling certain number ranges.

Workaround

This vulnerability can be mitigated by validating inputs to Asn1Integer to ensure that they are not smaller than -2**31 + 1 and no larger than 2**31 - 1. If range checks are impractical, input to Asn1Integer can be provided as a buffer to be used directly, requiring external computation of the correct DER encoding.

References

CVSS Base Scores

version 4.0
version 3.1