Summary
Stable Diffusion WebUI exposes parsed command-line arguments through the unauthenticated /sdapi/v1/cmd-flags endpoint, including configured authentication values in cleartext.
An attacker who can reach this endpoint may recover interface credentials and use them to authenticate to the application.
Affected context
The vulnerability affects Stable Diffusion WebUI deployments through version 1.10.1 when the API endpoint is network-accessible and command-line authentication options are configured. Risk is higher when the endpoint is exposed beyond a trusted local network or when returned command-line arguments include reusable usernames and passwords.
Exploit preconditions
- Attack surface: The
/sdapi/v1/cmd-flagsHTTP API endpoint - Required access: Network reachability to the endpoint; authentication is not required to query it
- Trigger point: Retrieval of the endpoint response containing parsed command-line arguments
- Why exploitation is possible: Sensitive authentication values are returned in cleartext rather than being omitted, masked, or restricted to authorized administrators
Why this happens
The underlying issue is improper protection of sensitive authentication data exposed through an informational API response. The endpoint discloses parsed startup arguments without filtering credential-bearing options, allowing unauthenticated users to retrieve secrets intended only for internal application configuration.
This behavior maps to CWE-522: Insufficiently Protected Credentials, because authentication information is exposed through an interface that does not adequately restrict or protect access to it.
Potential impact
- Attackers may recover configured usernames and passwords
- Exposed credentials could enable unauthorized access to the WebUI
- An attacker could modify application settings or generated content
- Compromised credentials may be reused against other services
- The application host or connected resources could be exposed to further abuse
General mitigation guidance
Mitigation generally focuses on preventing sensitive command-line arguments from being exposed and reducing the trust placed in runtime-disclosed configuration.
Common defensive patterns include:
- Removing credential values from diagnostic and informational API responses
- Returning only an allowlisted set of non-sensitive command-line options
- Requiring strong authorization for configuration and diagnostic endpoints
- Avoiding plaintext credentials in command-line arguments where safer secret-handling mechanisms are available
- Rotating credentials that may have been exposed
- Restricting API exposure to trusted networks or authenticated gateways
- Applying least privilege to the application account and connected services
How teams detect issues like this
Organizations can look for this issue through:
- Static analysis and API reviews that identify endpoints returning process arguments or configuration objects
- Code review checks for credential-bearing fields in diagnostic responses
- Dynamic testing that verifies unauthenticated endpoints do not disclose passwords, tokens, or authentication flags
- Network monitoring for unexpected requests to command-flag and diagnostic endpoints
- Policy enforcement requiring sensitive fields to be redacted or omitted from API output
Automated security testing and code review tools may help identify exposed secrets and insufficient endpoint authorization.

