Miggo Logo

CVE-2022-29203: Integer overflow in `SpaceToBatchND`

5.5

CVSS Score
3.1

Basic Information

EPSS Score
0.13217%
Published
5/24/2022
Updated
1/27/2023
KEV Status
No
Technology
TechnologyPython

Technical Details

CVSS Vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
Package NameEcosystemVulnerable VersionsFirst Patched Version
tensorflowpip< 2.6.42.6.4
tensorflowpip>= 2.7.0, < 2.7.22.7.2
tensorflowpip>= 2.8.0, < 2.8.12.8.1
tensorflow-cpupip< 2.6.42.6.4
tensorflow-cpupip>= 2.7.0, < 2.7.22.7.2
tensorflow-cpupip>= 2.8.0, < 2.8.12.8.1
tensorflow-gpupip< 2.6.42.6.4
tensorflow-gpupip>= 2.7.0, < 2.7.22.7.2
tensorflow-gpupip>= 2.8.0, < 2.8.12.8.1

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems from integer overflows in dimension calculations for tensor allocation. Key issues were identified in:

  1. SpaceToBatch implementations (both XLA and regular kernels) where block_shape elements were multiplied without overflow-safe operations.
  2. Shape inference's dimension multiplication logic that lacked overflow checks. The patches introduced MultiplyWithoutOverflow and explicit validation, confirming these were the vulnerable points. Test cases added to validate block_shape positivity and overflow scenarios further corroborate these locations.

Vulnerable functions

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

WAF Protection Rules

WAF Rule

### Imp**t T** impl*m*nt*tion o* `t*.r*w_ops.Sp***To**t**N*` (in *ll ***k*n*s su** *s XL* *n* **n*writt*n k*rn*ls) is vuln*r**l* to *n int***r ov*r*low: ```pyt*on import t*nsor*low *s t* input = t*.*onst*nt(-*.**+**, s**p*=[**,**,**], *typ*=t*.*lo*

Reasoning

T** vuln*r**ility st*ms *rom int***r ov*r*lows in *im*nsion **l*ul*tions *or t*nsor *llo**tion. K*y issu*s w*r* i**nti*i** in: *. Sp***To**t** impl*m*nt*tions (*ot* XL* *n* r**ul*r k*rn*ls) w**r* *lo*k_s**p* *l*m*nts w*r* multipli** wit*out ov*r*low-