CVE-2021-33653

7.5 HIGH

📋 TL;DR

CVE-2021-33653 is a division by zero vulnerability in MindSpore's SpaceToBatch operator that occurs when block_shape parameter contains a value of 0. This can cause denial of service (DoS) by crashing the application. Affects users of MindSpore deep learning framework.

💻 Affected Systems

Products:
  • MindSpore
Versions: MindSpore versions before 1.3.0
Operating Systems: All platforms running MindSpore
Default Config Vulnerable: ✅ No
Notes: Only vulnerable when using SpaceToBatch operator with block_shape parameter containing 0 value.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete service disruption through application crash, potentially affecting dependent systems and causing data loss in processing pipelines.

🟠

Likely Case

Application crash leading to denial of service for the affected MindSpore process, interrupting machine learning operations.

🟢

If Mitigated

Controlled application termination with proper error handling, minimal impact on overall system stability.

🌐 Internet-Facing: LOW - Typically requires specific ML model execution with malicious parameters, not directly exposed via typical web interfaces.
🏢 Internal Only: MEDIUM - Internal ML pipelines could be disrupted if processing untrusted models or data.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ✅ No
Complexity: LOW

Exploitation requires ability to control model parameters or input data to the SpaceToBatch operator.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: MindSpore 1.3.0 and later

Vendor Advisory: https://gitee.com/mindspore/community/blob/master/security/security_advisory_list/mssa-2021-002_en.md

Restart Required: Yes

Instructions:

1. Check current MindSpore version. 2. Upgrade to MindSpore 1.3.0 or later using pip or package manager. 3. Restart all services using MindSpore. 4. Verify the fix by testing SpaceToBatch operations.

🔧 Temporary Workarounds

Input validation wrapper

all

Add validation to check block_shape parameter before passing to SpaceToBatch operator

# Python code snippet to validate block_shape
import numpy as np

def safe_spacetobatch(input_tensor, block_shape):
    if 0 in block_shape:
        raise ValueError('block_shape cannot contain 0')
    # Proceed with normal SpaceToBatch operation

🧯 If You Can't Patch

  • Implement strict input validation for all SpaceToBatch operator calls
  • Isolate MindSpore processes and implement monitoring for crashes

🔍 How to Verify

Check if Vulnerable:

Check MindSpore version and test SpaceToBatch with block_shape containing 0

Check Version:

python -c 'import mindspore; print(mindspore.__version__)'

Verify Fix Applied:

After upgrade, test SpaceToBatch operator with block_shape containing 0 - should return error instead of crash

📡 Detection & Monitoring

Log Indicators:

  • Application crashes with division by zero errors
  • MindSpore process termination
  • Error logs mentioning SpaceToBatch or block_shape

Network Indicators:

  • Sudden termination of ML inference services
  • Failed model processing requests

SIEM Query:

process_name: 'python' AND (error: 'division by zero' OR error: 'SpaceToBatch')

🔗 References

📤 Share & Export