CVE-2024-31462
Limited file write in Stable-diffusion-webui - GHSL-2024-010
Check your servers for CVE-2024-31462
The Vulnpocalypse collector sends the package list of each Linux server and of its container images once a day. Vulnpocalypse shows every server where CVE-2024-31462 affects stable-diffusion-webui, with the command that installs the fix. The free plan covers one server and one domain and does not need a credit card.
Description
stable-diffusion-webui is a web interface for Stable Diffusion, implemented using Gradio library. Stable-diffusion-webui 1.7.0 is vulnerable to a limited file write affecting Windows systems. The create_ui method (Backup/Restore tab) in modules/ui_extensions.py takes user input into the config_save_name variable on line 653. This user input is later used in the save_config_state method and used to create a file path on line 65, which is afterwards opened for writing on line 67, which leads to a limited file write exploitable on Windows systems. This issue may lead to limited file write. It allows for writing json files anywhere on the server where the web server has access.
Severity (CVSS)
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L
- Attack vector
- network: an attacker can reach the vulnerable part over the network, often from the internet
- Attack complexity
- low: an attack works without special conditions
- Privileges required
- low: the attacker needs an ordinary user account
- User interaction
- none: nobody has to click or open anything
- Scope
- unchanged: the damage stays inside the vulnerable component
- Impact
- confidentiality low, integrity low, availability low: what an attacker can read (confidentiality), change (integrity) or stop (availability)
Exploitation
EPSS 0.68%: the probability of exploitation activity in the next 30 days, from the EPSS model of FIRST. The score is higher than 53.6% of all scored CVEs. Scores of 1 Dec 2026.
The assessment of CISA (SSVC, 31 May 2024):
- Exploitation
- none: CISA did not find evidence of exploitation or a public proof of concept
- Automatable
- no: each attack takes manual steps
- Technical impact
- partial: limited control or limited data
Weakness
- CWE-22 Improper Limitation of a Pathname to a Restricted Directory
Affected products
As the CNA lists them.
| Product | Versions |
|---|---|
| stable-diffusion-webui |
affected <= 1.8.0
|
Is my server affected?
Find the installed version of stable-diffusion-webui and compare it with the fixed version of your distribution. Distributions often fix a CVE in a package version of their own, so the version number of the upstream project can mislead.
Debian, Ubuntu
dpkg -l | grep -i stable-diffusion-webui
# packages whose changelog names the CVE (fixed in the installed version)
zgrep -l CVE-2024-31462 /usr/share/doc/*/changelog.Debian.gz
# Ubuntu
pro fix CVE-2024-31462RHEL, Rocky, Alma, Fedora
rpm -q stable-diffusion-webui
# lists the advisory while the fix is not installed
dnf updateinfo list --cve CVE-2024-31462Alpine
apk list --installed | grep -i stable-diffusion-webuiWith Trivy, on the host and for a container image. When a package is affected, it prints the installed and the fixed version:
trivy rootfs --scanners vuln / | grep CVE-2024-31462
trivy image --scanners vuln IMAGE | grep CVE-2024-31462
Vulnpocalypse makes this comparison every day for the package lists of your servers and container images, including language packages (npm, PyPI, Go, Maven and others), and sends the command that installs the fix. Start free with one server and one domain or read how to install the collector.
References
Advisories
- https://securitylab.github.com/advisories/GHSL-2024-010_stable-diffusion-webui/ securitylab.github.com
Other references
- https://github.com/AUTOMATIC1111/stable-diffusion-webui/commit/d9708c92b444894bce8070e4dcfaa093f8eb8d43 github.com
- https://github.com/AUTOMATIC1111/stable-diffusion-webui/blob/cf2772fab0af5573da775e7437e6acdca424f26e/modules/ui_extensions.py#L59 github.com
- https://github.com/AUTOMATIC1111/stable-diffusion-webui/blob/cf2772fab0af5573da775e7437e6acdca424f26e/modules/ui_extensions.py#L646-L660 github.com
- https://github.com/AUTOMATIC1111/stable-diffusion-webui/blob/cf2772fab0af5573da775e7437e6acdca424f26e/modules/ui_extensions.py#L65 github.com
- https://github.com/AUTOMATIC1111/stable-diffusion-webui/blob/cf2772fab0af5573da775e7437e6acdca424f26e/modules/ui_extensions.py#L653 github.com
- https://github.com/AUTOMATIC1111/stable-diffusion-webui/blob/cf2772fab0af5573da775e7437e6acdca424f26e/modules/ui_extensions.py#L67 github.com
- https://github.com/AUTOMATIC1111/stable-diffusion-webui/blob/v1.7.0/modules/ui_extensions.py github.com
- https://github.com/AUTOMATIC1111/stable-diffusion-webui/discussions/15461 github.com
- https://securitylab.github.com/advisories/GHSL-2024-010_stable-diffusion-webui securitylab.github.com
Source: the record CVE-2024-31462 of the CVE List (CVE Program), CVE Terms of Use; the CISA KEV catalog and the CISA ADP container; EPSS of FIRST; the CWE catalog of MITRE, CWE Terms of Use. The text of the record is shown as published. Data sources and licences.
Vulnpocalypse