/

CVE-2026-77814

Severity:

HIGH RISK

(7.5)

Path Traversal (CWE-22) in IIB File Access Control

CVE-2026-77814

Deferred

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22

Impact:

Unauthorized File Disclosure

Severity:

HIGH RISK

(7.5)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A path-confinement weakness in IIB's file-serving access control accepts paths whose names merely begin with an allowed directory name. When access control is enabled and a requester can reach the file-serving endpoint, this may expose readable files outside the intended directory boundary.

Affected context

The issue occurs in deployments where IIB's access-control logic is active, including configurations that explicitly enable it or infer enablement from network-exposure options such as sharing, tunneling, listening, or a configured server name. The vulnerable comparison can treat a sibling directory with a similar prefix as being inside an allowed parent. Standalone deployments without access control may already serve any readable file, so the impact and applicability depend on deployment settings and filesystem permissions.

Exploit preconditions

  • Attack surface: IIB's file-serving endpoint exposed through the Stable Diffusion WebUI integration
  • Required access: Ability to submit or cause a file request to be processed by the service
  • Trigger point: Path validation before the requested file is returned through FileResponse
  • Why exploitation is possible: The validator uses a prefix comparison without requiring a directory boundary, allowing a path outside the approved directory to satisfy the trust check

Why this happens

The vulnerability results from treating a filesystem path as trusted when its string representation merely starts with the string representation of an allowed parent directory. Without appending or otherwise enforcing a path-separator boundary, directory names that share the allowed directory's prefix can be accepted incorrectly. This is a path traversal and improper pathname validation pattern mapped to CWE-22: Improper Limitation of a Pathname to a Restricted Directory.

Potential impact

  • An attacker may read files outside the intended confinement directory.
  • Sensitive configuration, credentials, or application data could be disclosed if readable by the service.
  • The exposed file-serving endpoint could broaden the effective attack surface of a network-accessible WebUI.
  • Information disclosure could support further compromise of the host or application.

General mitigation guidance

Mitigation generally focuses on enforcing filesystem-aware containment rather than raw string-prefix checks.

Common defensive patterns include:

  • Compare normalized, resolved paths using a directory-boundary-aware containment check.
  • Require the approved parent path to terminate with a path separator when using compatible prefix logic.
  • Resolve symlinks and canonicalize paths according to the platform's filesystem semantics.
  • Restrict file-serving operations to explicit allowlisted directories and file types.
  • Apply least-privilege filesystem permissions to the service account.
  • Keep access control enabled by default for network-exposed deployments and avoid serving arbitrary readable files.

How teams detect issues like this

Organizations can identify this weakness through:

  • Static analysis rules for startswith or equivalent prefix comparisons used in pathname authorization.
  • Code review checks for missing path-separator boundaries, canonicalization, or resolved-path containment.
  • Tests covering allowed directories alongside sibling names that share the same prefix.
  • Policy enforcement requiring filesystem-aware path validation before file responses are generated.
  • Runtime monitoring for requests targeting paths outside configured serving roots and for unusual file-read activity.
  • Automated security review tools that flag path authorization based solely on string prefixes.

Sources

SourceLink
github.comgithub.com/zanllp/infinite-image-browsing
github.comgithub.com/zanllp/infinite-image-browsing/blob/v1.8.0/scripts/iib/api.py#L329-L344
github.comgithub.com/zanllp/infinite-image-browsing/commit/4057a624c7a23a36f0b4dc6a545b40767d602450
github.comgithub.com/zanllp/infinite-image-browsing/issues/968
github.comgithub.com/zanllp/infinite-image-browsing/pull/969
vulncheck.comvulncheck.com/advisories/infinite-image-browsing-is-path-trusted-prefix-comparison-omits-the-trailing-path-separator

Frequently asked

questions

It may be remotely exploitable when the IIB file-serving endpoint is reachable by an attacker and access-control confinement is enabled. The practical scope depends on deployment exposure, authentication, and filesystem permissions.

Authentication requirements depend on the surrounding WebUI and deployment configuration. The essential condition is the ability to submit a request that reaches the vulnerable path-validation logic.

Use normalized, resolved paths and verify that the requested path is contained within an approved directory using a filesystem-aware, directory-boundary-safe comparison.

Treat path authorization as a structured filesystem operation rather than a string-prefix test, add boundary and sibling-directory regression tests, enforce least privilege, and monitor file-serving requests.

Find out what's already
exploitable in your codebase.