GitHub Security Advisory: GHSA-8gw4-p4wq-4hcv
Package: github.com/lxc/incus/v6/cmd/incusd (GO)
Severity: MODERATE (CVSS 4.3)
CWE: CWE-918: Server-Side Request Forgery (SSRF)
Vulnerable versions: < 7.0.0
Patched in: 7.0.0

Summary: Incus has Blind SSRF via Image Import Preflight HEAD

Details:
### Summary
A partial implementation of our `restricted.images.servers` project restriction allows users in such restricted projects to still cause Incus to send HEAD requests to arbitrary endpoints.

The actual image download will be rejected by the project restriction, but the ability to trigger arbitrary HTTP requests inside of the Incus environment can still be used as a way to discover otherwise hidden details about the environment.

### Details
The image import flow performs outbound network access to a user-supplied URL before the request is fully validated and before the import is rejected. The URL information helper constructs a HEAD request directly from the supplied source URL and immediately sends it to resolve image metadata.

A host-originated HEAD request is issued from attacker-controlled input during the image import preflight stage. In the observed reproduction, this request is sent before the flow fails on later processing requirements, such as missing image metadata headers. As a result, an authenticated user can coerce the daemon into making blind outbound HEAD requests to arbitrary destinations. This yields a blind server-side request forgery (SSRF) primitive against internal services, unroutable address space, or cloud metadata endpoints reachable by the host. This vulnerability pattern is similar to CVE-2026-24767.

Affected File:
https://github.com/lxc/incus/blob/v6.22.0/cmd/incusd/images.go 

Affected Code:
```
func imgPostURLInfo(ctx context.Context, s *state.State, r *http.Request, req api.ImagesPost, op *operations.Operation, project string, budget int64) (*api.Image, error) {
    [...]
    head, err := http.NewRequest("HEAD", req.Source.URL, nil)
    if err != nil {
        return nil, err
    }

    [...]


    head.Header.Set("User-Agent", version.UserAgent)
    head.Header.Set("Incus-Server-Architectures", strings.Join(architectures, ", "))
    head.Header.Set("Incus-Server-Version", version.Version)

    raw, err := myhttp.Do(head)
    if err != nil {
        return nil, err
    }

    hash := raw.Header.Get("Incus-Image-Hash")
    if hash == "" {
        return nil, errors.New("Missing Incus-Image-Hash header")
    }

    url := raw.Header.Get("Incus-Image-URL")
    if url == "" {
        return nil, errors.New("Missing Incus-Image-URL header")
    }

    info, _, err := ImageDownload(ctx, r, s, op, &ImageDownloadArgs{
        Server:      url,
        Protocol:    "direct",
        Alias:       hash,
        AutoUpdate:  req.AutoUpdate,
        Public:      req.Public,
        ProjectName: project,
        Budget:      budget,
    })
    [...]
}
```

The following PoC demonstrates that an authenticated user can trigger a host-originated HEAD request to an arbitrary external URL during the image import preflight stage.

Step 1: Select the reproduction project

From an Incus client with access to the target server, switch into the project used for reproduction. In this environment, the selected project was config