Miggo Logo

CVE-2021-37643: Null pointer dereference in `MatrixDiagPartOp`

7.7

CVSS Score
3.1

Basic Information

EPSS Score
0.00648%
Published
8/25/2021
Updated
11/13/2024
KEV Status
No
Technology
TechnologyPython

Technical Details

CVSS Vector
CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H
Package NameEcosystemVulnerable VersionsFirst Patched Version
tensorflowpip< 2.3.42.3.4
tensorflowpip>= 2.4.0, < 2.4.32.4.3
tensorflowpip= 2.5.02.5.1
tensorflow-cpupip< 2.3.42.3.4
tensorflow-cpupip>= 2.4.0, < 2.4.32.4.3
tensorflow-cpupip= 2.5.02.5.1
tensorflow-gpupip< 2.3.42.3.4
tensorflow-gpupip>= 2.4.0, < 2.4.32.4.3
tensorflow-gpupip= 2.5.02.5.1

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems from the unvalidated access to the padding_value tensor's first element in MatrixDiagPartOp's implementation. The patch adds a check (OP_REQUIRES) to ensure the padding_value is a scalar (exactly 1 element), confirming the root cause was missing validation before accessing the tensor buffer. The affected code path is clearly in the Compute method of MatrixDiagPartOp as shown in the provided diff and CVE details.

Vulnerable functions

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

WAF Protection Rules

WAF Rule

### Imp**t I* * us*r *o*s not provi** * v*li* p***in* v*lu* to `t*.r*w_ops.M*trix*i**P*rtOp`, t**n t** *o** tri***rs * null point*r **r***r*n** (i* input is *mpty) or pro*u**s inv*li* ****vior, i*norin* *ll v*lu*s **t*r t** *irst: ```pyt*on import t

Reasoning

T** vuln*r**ility st*ms *rom t** unv*li**t** ****ss to t** p***in*_v*lu* t*nsor's *irst *l*m*nt in M*trix*i**P*rtOp's impl*m*nt*tion. T** p*t** ***s * ****k (OP_R*QUIR*S) to *nsur* t** p***in*_v*lu* is * s**l*r (*x**tly * *l*m*nt), *on*irmin* t** roo