Description
A remote code execution vulnerability exists in invoke-ai/invokeai versions 5.3.1 through 5.4.2 via the /api/v2/models/install API. The vulnerability arises from unsafe deserialization of model files using torch.load without proper validation. Attackers can exploit this by embedding malicious code in model files, which is executed upon loading. This issue is fixed in version 5.4.3.
EPSS Score:
39%
Comprehensive Technical Analysis of EUVD-2025-7245
1. Vulnerability Assessment and Severity Evaluation
The vulnerability EUVD-2025-7245, also known as CVE-2024-12029, is a remote code execution (RCE) flaw in the invoke-ai/invokeai software. The issue arises from unsafe deserialization of model files using torch.load without proper validation, allowing attackers to embed and execute malicious code.
Severity Evaluation:
- CVSS Base Score: 9.8
- CVSS Vector: CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
The high CVSS score indicates a critical vulnerability due to its potential for remote exploitation, low attack complexity, and significant impact on confidentiality, integrity, and availability.
2. Potential Attack Vectors and Exploitation Methods
Attack Vectors:
- Remote Code Execution (RCE): Attackers can craft malicious model files and upload them via the
/api/v2/models/installAPI endpoint. Upon loading these files, the embedded malicious code is executed. - Supply Chain Attacks: Compromised model files distributed through third-party repositories or marketplaces could be used to exploit this vulnerability.
Exploitation Methods:
- Payload Injection: Embedding malicious Python code within the model files that gets executed when the model is loaded.
- Phishing and Social Engineering: Tricking users into downloading and installing compromised model files from untrusted sources.
3. Affected Systems and Software Versions
Affected Software:
- invoke-ai/invokeai versions 5.3.1 through 5.4.2
Fixed Version:
- The vulnerability is fixed in version 5.4.3.
Affected Systems:
- Any system running the vulnerable versions of invoke-ai/invokeai, particularly those with the
/api/v2/models/installAPI exposed to the internet.
4. Recommended Mitigation Strategies
Immediate Actions:
- Upgrade Software: Upgrade to invoke-ai/invokeai version 5.4.3 or later.
- Disable API Endpoint: Temporarily disable the
/api/v2/models/installAPI endpoint if an immediate upgrade is not possible. - Network Segmentation: Restrict access to the API endpoint to trusted networks only.
Long-Term Mitigations:
- Input Validation: Implement robust input validation and sanitization for all model files.
- Secure Deserialization: Use secure deserialization methods and avoid
torch.loadfor untrusted data. - Regular Audits: Conduct regular security audits and code reviews to identify and mitigate similar vulnerabilities.
5. Impact on European Cybersecurity Landscape
The vulnerability poses a significant risk to organizations and individuals using invoke-ai/invokeai within the European Union. The potential for remote code execution can lead to data breaches, unauthorized access, and system compromises, impacting the confidentiality, integrity, and availability of sensitive data.
Regulatory Implications:
- GDPR Compliance: Organizations must ensure that they comply with GDPR regulations by protecting personal data from unauthorized access and breaches.
- Incident Reporting: Any successful exploitation of this vulnerability may require reporting to relevant authorities under GDPR and other cybersecurity regulations.
6. Technical Details for Security Professionals
Vulnerability Details:
- Root Cause: Unsafe deserialization of model files using
torch.loadwithout proper validation. - Exploitation: Malicious code embedded in model files is executed upon loading via the
/api/v2/models/installAPI.
Detection and Monitoring:
- Log Analysis: Monitor logs for unusual activities related to model file uploads and API calls.
- Intrusion Detection Systems (IDS): Deploy IDS to detect and alert on suspicious network traffic and API requests.
- File Integrity Monitoring: Implement file integrity monitoring to detect unauthorized changes to model files.
Patch Management:
- Automated Updates: Implement automated update mechanisms to ensure that software is kept up-to-date with the latest security patches.
- Vulnerability Scanning: Regularly scan systems for known vulnerabilities and apply patches promptly.
References:
By addressing this vulnerability promptly and implementing robust security measures, organizations can mitigate the risk of exploitation and protect their systems and data from potential attacks.