Miggo Logo

GHSA-2c7c-3mj9-8fqh: Decryption of malicious PBES2 JWE objects can consume unbounded system resources

N/A

CVSS Score

Basic Information

CVE ID
-
EPSS Score
-
Published
11/21/2023
Updated
2/27/2024
KEV Status
No
Technology
TechnologyGo

Technical Details

CVSS Vector
-
Package NameEcosystemVulnerable VersionsFirst Patched Version
github.com/go-jose/go-jose/v3go< 3.0.13.0.1
github.com/square/go-josego< 2.6.22.6.2

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The analysis focused on the code modifications presented in the provided commit information. Both commits (65351c27657d58960c2e6c9fbb2b00f818e50568 for go-jose/v3 and a3d307244c3bc50b25a71aa0688764c32ec419c7 for go-jose/v2) apply the same fix to the decryptKey method within the symmetricKeyCipher type in symmetric.go. This method is responsible for handling key decryption using PBES2, where the p2c (iteration count) parameter is critical. The vulnerability stemmed from the lack of an upper-bound check on this p2c value, which could be maliciously inflated by an attacker. The patch introduces this necessary check. While the commit messages and vulnerability description mention higher-level API functions like JSONWebEncryption.Decrypt and JSONWebEncryption.DecryptMulti as being affected (as they are the entry points for decryption), the core logical flaw and the fix reside within (*symmetricKeyCipher).decryptKey. Therefore, this function is identified as the vulnerable function directly addressed by the patches. It processes the malicious input part (p2c) and contained the vulnerability (missing check), and it would appear in a runtime profile during exploitation.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

T** *o-jos* p**k*** is su*j**t to * "*illion **s**s *tt**k" **usin* **ni*l-o*-s*rvi** w**n ***ryptin* JW* inputs. T*is o**urs w**n *n *tt**k*r **n provi** * P**S* *n*rypt** JW* *lo* wit* * v*ry l*r** p** v*lu* t**t, w**n ***rypt**, pro*u**s * **ni*l-

Reasoning

T** *n*lysis *o*us** on t** *o** mo*i*i**tions pr*s*nt** in t** provi*** *ommit in*orm*tion. *ot* *ommits (**************************************** *or *o-jos*/v* *n* **************************************** *or *o-jos*/v*) *pply t** s*m* *ix to t**