CVE-2024-10481 in comfyuiinfo

Summary

by MITRE • 03/20/2025

A CSRF vulnerability exists in comfyanonymous/comfyui versions up to v0.2.2. This vulnerability allows attackers to host malicious websites that, when visited by authenticated ComfyUI users, can perform arbitrary API requests on behalf of the user. This can be exploited to perform actions such as uploading arbitrary files via the `/upload/image` endpoint. The lack of CSRF protections on API endpoints like `/upload/image`, `/prompt`, and `/history` leaves users vulnerable to unauthorized actions, which could be combined with other vulnerabilities such as stored-XSS to further compromise user sessions.

Be aware that VulDB is the high quality source for vulnerability data.

Analysis

by VulDB Data Team • 07/29/2025

The vulnerability identified as CVE-2024-10481 represents a critical cross-site request forgery weakness within the comfyanonymous/comfyui application framework up to version v0.2.2. This issue stems from the absence of proper anti-CSRF mechanisms across multiple API endpoints, creating a significant attack surface that can be exploited by malicious actors to perform unauthorized actions on behalf of authenticated users. The vulnerability manifests when users visit compromised websites that contain malicious code designed to trigger API requests against the ComfyUI instance they are logged into, effectively bypassing the authentication context and executing operations without user consent.

The technical flaw underlying this vulnerability resides in the application's failure to implement CSRF tokens or other protective measures on its API endpoints. According to CWE-352, this represents a classic cross-site request forgery vulnerability where the application does not verify the origin of requests, allowing attackers to craft malicious web pages that automatically submit requests to the target application. The affected endpoints include critical paths such as /upload/image, /prompt, and /history, which when combined with other vulnerabilities, can lead to severe compromise scenarios. The absence of CSRF protection mechanisms means that any authenticated user session can be hijacked through carefully crafted malicious requests that leverage the user's existing authentication context.

The operational impact of this vulnerability extends beyond simple unauthorized file uploads, as demonstrated by the ability to exploit the /upload/image endpoint for arbitrary file uploads. This capability can be leveraged to execute malicious code, establish persistent backdoors, or perform further attacks within the application's environment. When combined with stored cross-site scripting vulnerabilities, attackers can create a complete attack chain that allows for session hijacking, data exfiltration, and potential lateral movement within the network. The attack requires minimal user interaction beyond visiting a malicious website, making it particularly dangerous in environments where users may encounter compromised content through phishing or social engineering campaigns.

Security professionals should implement immediate mitigations including the deployment of CSRF tokens on all API endpoints, particularly those handling sensitive operations like file uploads and prompt execution. The implementation should follow established security frameworks such as the OWASP CSRF Prevention Cheat Sheet, which recommends the use of unique, unpredictable tokens for each user session. Additionally, developers should consider implementing strict origin validation and referer header checks to ensure requests originate from legitimate sources within the application. The ATT&CK framework categorizes this vulnerability under T1566 - Phishing and T1071.1 - Application Layer Protocol: Web Protocols, highlighting the need for comprehensive security controls that address both the technical flaw and the broader attack surface. Organizations should also consider implementing web application firewalls and monitoring for suspicious API request patterns to detect potential exploitation attempts. Regular security assessments and code reviews should be conducted to ensure that similar vulnerabilities do not exist in other application components, particularly given the widespread use of ComfyUI in machine learning and image processing workflows where the compromise could lead to significant data breaches or system compromise.

Responsible

@huntr Ai

Reservation

10/28/2024

Disclosure

03/20/2025

Moderation

accepted

CPE

ready

EPSS

0.00208

KEV

no

Activities

very low

Sources

Are you interested in using VulDB?

Download the whitepaper to learn more about our service!