CVE-2021-33649

7.5 HIGH

📋 TL;DR

CVE-2021-33649 is an out-of-bounds read vulnerability in MindSpore's Transpose operator that occurs when the perm parameter exceeds input shape bounds. This allows attackers to read heap memory beyond allocated buffers, potentially exposing sensitive information. Users of affected MindSpore versions are vulnerable when processing untrusted models.

💻 Affected Systems

Products:
  • MindSpore
Versions: Versions prior to 1.3.0
Operating Systems: All platforms running MindSpore
Default Config Vulnerable: ⚠️ Yes
Notes: Vulnerability triggers when processing models with Transpose operations containing invalid perm parameters.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Information disclosure leading to memory content leakage, potentially exposing sensitive data like model weights, credentials, or other process memory.

🟠

Likely Case

Application crash or denial of service due to invalid memory access, with possible limited information disclosure.

🟢

If Mitigated

No impact if proper input validation is implemented or vulnerable versions are not used.

🌐 Internet-Facing: MEDIUM - Exploitation requires submitting malicious models to inference services, which is plausible for ML-as-a-service deployments.
🏢 Internal Only: LOW - Requires local model execution or internal API access, reducing attack surface.

🎯 Exploit Status

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

Exploitation requires crafting malicious models with specific Transpose configurations. No known public exploits.

🛠️ 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-006_en.md

Restart Required: Yes

Instructions:

1. Check current MindSpore version. 2. Upgrade to version 1.3.0 or later using pip: 'pip install --upgrade mindspore'. 3. Restart all services using MindSpore.

🔧 Temporary Workarounds

Input validation wrapper

all

Implement custom validation for Transpose operator inputs before processing

# Python example: Validate perm parameter length matches input shape
def safe_transpose(input_tensor, perm):
    if len(perm) != len(input_tensor.shape):
        raise ValueError('Invalid perm parameter length')
    if any(p >= len(input_tensor.shape) for p in perm):
        raise ValueError('Perm values exceed input dimensions')
    return original_transpose(input_tensor, perm)

🧯 If You Can't Patch

  • Implement strict input validation for all model inference requests
  • Isolate MindSpore services in restricted containers with minimal memory access

🔍 How to Verify

Check if Vulnerable:

Check MindSpore version: 'python -c "import mindspore; print(mindspore.__version__)"' and verify if below 1.3.0

Check Version:

python -c "import mindspore; print('MindSpore version:', mindspore.__version__)"

Verify Fix Applied:

After upgrade, verify version is 1.3.0+ and test with known vulnerable Transpose configurations

📡 Detection & Monitoring

Log Indicators:

  • Segmentation faults in MindSpore processes
  • Unexpected memory access errors
  • Model processing failures with Transpose operations

Network Indicators:

  • Unusual model upload patterns to ML inference endpoints
  • Repeated failed inference requests with similar parameters

SIEM Query:

process_name: "python" AND (event_description: "segmentation fault" OR event_description: "memory access violation") AND process_command_line: "*mindspore*"

🔗 References

📤 Share & Export