CVE-2021-33651

7.5 HIGH

📋 TL;DR

This vulnerability in MindSpore's DepthwiseConv2D operator causes a division by zero exception when depth_multiplier is set to 0, leading to denial of service. It affects systems using vulnerable versions of MindSpore for machine learning operations. The vulnerability can crash applications performing analytical operations with this specific configuration.

💻 Affected Systems

Products:
  • MindSpore
Versions: Versions prior to 1.2.0
Operating Systems: All platforms running MindSpore
Default Config Vulnerable: ✅ No
Notes: Only vulnerable when DepthwiseConv2D operator is used with depth_multiplier attribute set to 0, which is not a typical configuration.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete application crash and denial of service for any system using the vulnerable DepthwiseConv2D operator with depth_multiplier=0, potentially disrupting machine learning inference pipelines.

🟠

Likely Case

Application crash when processing specific neural network models that use DepthwiseConv2D with depth_multiplier=0, requiring restart of affected services.

🟢

If Mitigated

No impact if depth_multiplier is never set to 0 in DepthwiseConv2D operations or if the patch is applied.

🌐 Internet-Facing: MEDIUM - Could affect ML inference services exposed to external users if they accept arbitrary model parameters.
🏢 Internal Only: MEDIUM - Affects internal ML training and inference pipelines using vulnerable configurations.

🎯 Exploit Status

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

Exploitation requires ability to set depth_multiplier=0 in DepthwiseConv2D operations, typically requiring some level of control over model parameters or code.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: MindSpore 1.2.0 and later

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

Restart Required: Yes

Instructions:

1. Upgrade MindSpore to version 1.2.0 or later. 2. Restart any applications using MindSpore. 3. Verify the fix by checking the version and testing DepthwiseConv2D operations.

🔧 Temporary Workarounds

Parameter Validation

all

Add validation to ensure depth_multiplier is never set to 0 in DepthwiseConv2D operations

# Add parameter validation in code using DepthwiseConv2D
# Ensure depth_multiplier > 0 before calling the operator

🧯 If You Can't Patch

  • Implement input validation to reject depth_multiplier=0 values in DepthwiseConv2D operations
  • Monitor applications for crashes related to DepthwiseConv2D operations and implement restart mechanisms

🔍 How to Verify

Check if Vulnerable:

Check MindSpore version and test DepthwiseConv2D with depth_multiplier=0 to see if it crashes

Check Version:

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

Verify Fix Applied:

After patching, test DepthwiseConv2D with depth_multiplier=0 and verify it handles the case gracefully without crashing

📡 Detection & Monitoring

Log Indicators:

  • Application crashes with division by zero errors
  • Stack traces mentioning DepthwiseConv2D operations
  • MindSpore error logs containing 'division by zero'

Network Indicators:

  • Sudden service unavailability for ML inference endpoints
  • Increased error rates in ML API responses

SIEM Query:

source="application.log" AND "division by zero" AND "DepthwiseConv2D"

🔗 References

📤 Share & Export