Skip to main content

ms-swift CVE-2026-10801

| EUVDEUVD-2026-34242 LOW
Use of Weak Hash (CWE-328)
2026-06-04 VulDB GHSA-prfw-69r3-wqxf
1.1
CVSS 4.0 · Vendor: VulDB
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Gain local low-privilege access to ms-swift host
  2. Delivery
    Stage or inject two PIL images with identical tobytes() output but different dimensions
  3. Exploit
    Trigger Template._save_pil_image for the first image to populate cache
  4. Execution
    Submit second image to same cache lookup
  5. Persist
    Cache collision returns first image's file path
  6. Impact
    Wrong image silently used as model input, corrupting inference integrity

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A04:2025 - Cryptographic Failures
ASVS 5.0
V11 - Cryptography Irreversible hash functions
Exploitation Conditions

Exploitation requires local system access with at least low-privileged credentials (CVSS PR:L) - remote unauthenticated exploitation is not possible. High attack complexity (AC:H) is required: the attacker must specifically construct or stage PIL images whose raw pixel byte buffers (as returned by image.tobytes()) are identical despite differing in dimensions or color mode, which requires deliberate image crafting, not incidental input. The vulnerable code path is triggered when Template._save_pil_image is invoked during multimodal template processing in ms-swift; this requires the PIL image caching feature to be active in the deployment. Exploitation is limited to versions up to 4.2.0 of ms-swift. There is no user interaction required (UI:N) once the attacker can supply or stage crafted images. The limiting factors - local-only access, high complexity, and the need to control image content entering the cache - significantly constrain realistic exploitation to insider-threat or post-compromise scenarios in ML pipeline environments.

Impact

The overall risk is very low. The CVSS 4.0 base score of 1.1 reflects an attack vector of Local (AV:L), high attack complexity (AC:H), and low privileges required (PR:L), with confidentiality impact of None (VC:N) and only limited integrity (VI:L) and availability (VA:L) impacts in the vulnerable system. There is no scope change to downstream systems (SC:N, SI:N, SA:N). The exploit maturity modifier E:P confirms a publicly available proof-of-concept, but this does not elevate the practical risk substantially given the local-only attack surface and high complexity requirement. No EPSS data was provided in the intelligence sources, so exploitation probability cannot be quantified. The vulnerability is not listed in the CISA KEV catalog, indicating no confirmed active exploitation. The attack requires an adversary who already has local, authenticated access to the host and must craft or stage image files specifically designed to collide - this is not a scenario that lends itself to opportunistic, automated exploitation. The primary real-world impact is incorrect image retrieval from cache, which could silently corrupt multimodal LLM inference inputs, a subtle but potentially meaningful data integrity concern in fine-tuning or inference pipelines.

Exploit ScenarioDerived

A local, low-privileged user on a system running ms-swift fine-tuning or inference pipelines crafts two PIL images with identical raw pixel byte buffers but different dimensions - for example, 120×80 and 80×120 - so that image.tobytes() produces the same byte sequence for both. When the first image is processed and cached via Template._save_pil_image, the second image resolves to the same cache key and is served the first image's cached file instead of its own, silently corrupting the multimodal model input. A proof-of-concept demonstrating this collision is publicly available at https://github.com/modelscope/ms-swift/issues/9360.

Monitor Track and reassess. Why: LOW severity (CVSS 0.1-3.9).
Patch available 0.0% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Jun 04, 2026

Cache key collision in modelscope ms-swift up to 4.2.0 allows a local, low-privileged attacker to cause PIL image integrity failures via the Template._save_pil_image function in swift/template/base.py. The root cause is that the image cache key was computed by hashing only raw pixel bytes (image.tobytes()), without incorporating image metadata such as dimensions or color mode - meaning two structurally different images (e.g., 120×80 vs 80×120) sharing identical byte payloads produce the same SHA-256 cache key and thus collide to the same cached file path. No public exploit identified at time of analysis beyond the publicly disclosed proof-of-concept; no active exploitation confirmed (not listed in CISA KEV).

RemediationAI

Upstream fix available via GitHub pull request #9359 (https://github.com/modelscope/ms-swift/pull/9359); a released patched version is not independently confirmed as the PR awaits acceptance. Users should monitor the ms-swift release feed and upgrade to the first version released after PR #9359 is merged. As a compensating control, operators can disable or bypass the PIL image caching path in swift/template/base.py by patching the Template._save_pil_image method locally to prepend image metadata (mode, width, height) to the hash input before the official fix is available - the exact corrected logic is visible in the PR diff: img_meta = f'{image.mode}:{image.width}:{image.height}:'.encode(); img_hash = hashlib.sha256(img_meta + image.tobytes()).hexdigest(). This local patch carries the trade-off of diverging from upstream and requiring re-application on each update. Restricting write access to the PIL image cache directory to trusted processes only will reduce the blast radius but will not eliminate the collision condition.

Affected VersionsENISA

ms-swift 4.2.0
ms-swift 4.1
ms-swift 4.0

Affected Packages

pypi ms-swift no fix

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in pypi

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

ms-swift is a scalable lightweight fine-tuning framework from ModelScope (Alibaba DAMO). The affected code path is Template._save_pil_image in swift/template/base.py, which caches PIL Image objects on disk using a SHA-256 hash as the filename. CWE-328 (Use of Weak Hash) applies here not because SHA-256 is cryptographically weak, but because the hash input is structurally incomplete: the pre-patch code hashed only image.tobytes() - raw pixel data - without including the image mode (e.g., RGB, RGBA), width, or height. Python's PIL/Pillow tobytes() returns a flat byte buffer; two images with different dimensions but the same total pixel count and same raw buffer content (or identical buffers reinterpreted across different shapes) are indistinguishable to the hash function. The fix, visible in PR #9359, prepends a metadata string formatted as 'mode:width:height:' before hashing, ensuring geometric and color-space properties are reflected in the cache key. Affected CPE: cpe:2.3:a:modelscope:ms-swift:*:*:*:*:*:*:*:*.

Know when Modelscope gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (VulDB) PRIMARY 1.1 LOW
CVSS:4.0/AV:L/AC:H/AT:N/PR:L/UI:N/VC:N/VI:L/VA:L/SC:N/SI:N/SA:N/E:P

Primary rating from Vendor (VulDB) · only source for this CVE.

CVSS VectorVendor: VulDB

Attack Vector
Local
Attack Complexity
High
Attack Requirements
None
Privileges Required
Low
User Interaction
None
Vulnerable system: Confidentiality
None
Vulnerable system: Integrity
Low
Vulnerable system: Availability
Low
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

Lifecycle Timeline

1
CVSS changed
Jun 04, 2026 - 11:22 NVD
3.6 (LOW) 1.1 (LOW)

DescriptionCVE.org

A security vulnerability has been detected in modelscope ms-swift up to 4.2.0. This affects the function Template._save_pil_image of the file swift/template/base.py of the component PIL Image Cache Key Handler. The manipulation leads to use of weak hash. An attack has to be approached locally. A high degree of complexity is needed for the attack. It is indicated that the exploitability is difficult. The exploit has been disclosed publicly and may be used. The pull request to fix this issue awaits acceptance.

Threat Intelligence Overview

EPSS Score
0.0%
Top 99% exploitable
Exploit
POC
Public exploit code exists
Data Quality
7 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment GitHub VulDB

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity LOW
CISA KEV No
Public POC Yes
EPSS 0.0%
Patch available Yes
Active threat No
Deciding rule
LOW severity (CVSS 0.1-3.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Defer
Exploitation
Poc
System Exposure· derived
Small
Automatable
No
Human Impact· derived
Low
Technical Impact
Partial

Priority Score

26
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +6
PoC: +20
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.

CVE-2024-48050 CRITICAL POC
9.8 Nov 04

In agentscope <=v0.0.4, the file agentscope\web\workstation\workflow_utils.py has the function is_callable_expression. R

CVE-2024-8537 CRITICAL POC
9.1 Mar 20

A path traversal vulnerability exists in the modelscope/agentscope application, affecting all versions. Rated critical s

CVE-2024-8551 CRITICAL POC
9.1 Mar 20

A path traversal vulnerability exists in the save-workflow and load-workflow functionality of modelscope/agentscope vers

CVE-2024-8501 HIGH POC
8.8 Mar 20

An arbitrary file download vulnerability exists in the rpc_agent_client component of modelscope/agentscope version v0.0.

CVE-2024-8524 HIGH POC
7.5 Mar 20

A directory traversal vulnerability exists in modelscope/agentscope version 0.0.4. Rated high severity (CVSS 7.5), this

CVE-2024-8438 HIGH POC
7.5 Mar 20

A path traversal vulnerability exists in modelscope/agentscope version v.0.0.4. Rated high severity (CVSS 7.5), this vul

CVE-2026-6603 MEDIUM POC
5.5 Apr 20

Remote code execution in ModelScope AgentScope up to version 1.0.18 allows unauthenticated network attackers to inject a

CVE-2026-6606 MEDIUM POC
5.5 Apr 20

Modelscope AgentScope versions up to 1.0.18 contain a server-side request forgery (SSRF) vulnerability in the _process_a

CVE-2026-6605 MEDIUM POC
5.5 Apr 20

Server-side request forgery in ModelScope AgentScope up to version 1.0.18 allows remote unauthenticated attackers to man

CVE-2026-6604 MEDIUM POC
5.5 Apr 20

Server-side request forgery (SSRF) in ModelScope AgentScope up to version 1.0.18 allows remote unauthenticated attackers

CVE-2026-84202 HIGH
8.7 Sep 01

Unsafe PyYAML deserialization in ModelScope through v1.40.0 enables remote code execution when users load model configur

CVE-2026-85686 HIGH
8.7 Sep 04

Server-side request forgery in ms-swift 4.5.2 allows unauthenticated remote attackers to weaponize the server's multimod

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy