VulnWatch by ve1ve2
medium 5.0 EPSS 0.28%

GHSA-3gq2-x4qg-p4g6: LXD: SSRF via image import from URL allows internal network probing by authenticated users

Source:
OSV.dev
Published:
Fetched:
Updated:
Affects:
github.com/canonical/lxd

https://osv.dev/vulnerability/GHSA-3gq2-x4qg-p4g6 ↗

osvgofix-available

LXD: SSRF via image import from URL allows internal network probing by authenticated users ## Summary The LXD image import-from-URL endpoint (`POST /1.0/images` with `source.type=url`) makes server-side HTTP requests to an attacker-supplied URL without any private-IP or loopback blocking. An authenticated user with the `can_create_images` entitlement can force the LXD daemon to connect to internal network addresses (127.0.0.1, RFC1918 ranges, cloud metadata endpoints), enabling port scanning via error-based inference and interaction with internal HTTP services from the daemon's privileged network position. ## Severity - **Attack Vector:** Network — LXD API is network-accessible. - **Attack Complexity:** Low — Single crafted API request with no special conditions. - **Privileges Required:** Low — Requires `can_create_images` entitlement, a non-admin permission commonly delegated to regular users. - **User Interaction:** None. - **Scope:** Changed — The attacker leverages LXD's privileged network position to probe and interact with internal services that are outside the attacker's direct network access and outside the scope of LXD's image management authorization. - **Confidentiality Impact:** Low — Error messages reveal internal port states (open/closed/filtered) and service availability. Response bodies from internal services are NOT returned to the attacker (hash validation blocks content exfiltration). - **Integrity Impact:** None — No demonstrated ability to modify data on internal services. - **Availability Impact:** None — No meaningful resource exhaustion or denial of service. ## Affected Component - `lxd/images.go` — `imgPostURLInfo` (lines 668–755) — Makes HEAD request to user-supplied URL without any SSRF protections. - `lxd/util/http.go` — `HTTPClient` (lines 102–147) — Creates HTTP client with no IP blocking or URL validation. - `shared/network.go` — `RFC3493Dialer` (lines 20–49) — Dials arbitrary hosts including private/loopback ranges. - `lxd/daemon_images.go` — `ImageDownload` (lines 478–510, "direct" case) — Makes GET request to URL from attacker-controlled response header. ## Description ### Core vulnerability: no SSRF protections on server-side image fetching When a user imports an image from a URL, the `imgPostURLInfo` function makes an HTTP HEAD request directly to the user-supplied URL with zero validation: ```go // lxd/images.go:668-703 func imgPostURLInfo(ctx context.Context, s *state.State, req api.ImagesPost, ...) (*api.Image, error) { if req.Source.URL == "" { return nil, errors.New("Missing URL") } myhttp, err := util.HTTPClient("", s.Proxy) // ... // Resolve the image URL head, err := http.NewRequest("HEAD", req.Source.URL, nil) // No URL validation, no scheme check, no IP range check // ... raw, err := myhttp.Do(head) // Makes request to arbitrary destination ``` The HTTP client is created via `util.HTTPClient` which uses `shared.RFC3493Dialer` — a standard dialer with zero private-IP filtering: ```go // shared/network.go:20-49 func RFC3493Dialer(conte Affected: Go:github.com/canonical/lxd Fixed in: 0.0.0-20261005133302-c4a919f3f4e2 References: https://github.com/canonical/lxd/security/advisories/GHSA-3gq2-x4qg-p4g6 https://nvd.nist.gov/vuln/detail/CVE-2026-28385 https://github.com/canonical/lxd/pull/18210 https://github.com/canonical/lxd/pull/18462 https://github.com/canonical/lxd/commit/08996fa031eebc2bc2f8e27148c2ba24386c01d0 https://github.com/canonical/lxd/commit/4bbdb17ab67010446668e4b00a5175df5b6d55b4 https://github.com/canonical/lxd/commit/5976c92117b79d73437d7fab55e34cb80083edff https://github.com/canonical/lxd/commit/886fcf5b7686bf59de78e239cec90a69e8fb9c65

Linked vulnerabilities (2)

CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:N/A:N

LXD: SSRF via image import from URL allows internal network probing by authenticated users

CWE: CWE-918Aliases: CVE-2026-28385
CVE-2026-28385 medium 5.0 EPSS 0.28% (p20) NVDCVE.orgGHSA
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:N/A:N

LXD: SSRF via image import from URL allows internal network probing by authenticated users

CWE: CWE-918Aliases: GHSA-3gq2-x4qg-p4g6