/

CVE-2026-39362

Severity:

HIGH RISK

(7.1)

SSRF in InvenTree Remote Image Download

CVE-2026-39362

Analyzed

Vulnerability type

Category:

Server-Side Request Forgery (SSRF)

CWE:

CWE-918

Impact:

Access to internal network resources and services via SSRF

Severity:

HIGH RISK

(7.1)

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

InvenTree's optional remote image download feature can be abused to make the server perform arbitrary HTTP requests to attacker-supplied URLs.

When enabled, authenticated users may trigger server-side requests to internal or private network resources, potentially exposing sensitive information or interacting with internal services that are not otherwise accessible.

Affected context

This vulnerability affects InvenTree deployments where:

  • The INVENTREE_DOWNLOAD_FROM_URL setting is enabled (opt-in feature)
  • Users are allowed to provide remote_image URLs that the server fetches
  • The application server has network connectivity to internal or private IP ranges

The issue arises because URL inputs are only validated using Django's URLValidator, without additional checks for internal IP ranges, hostnames, or redirected destinations.

Exploit preconditions

  • Attack surface: HTTP endpoint(s) that accept a remote_image URL and trigger server-side downloads
  • Required access: Authenticated user account with permission to submit or edit objects that accept remote_image fields
  • Trigger point: Supplying a crafted URL that points to internal services, private IP addresses, or URLs that redirect to such locations
  • Why exploitation is possible: The server uses requests.get() with allow_redirects=True and relies only on URL format validation, with no network-layer or hostname-based restrictions to prevent access to internal targets

Why this happens

The core issue is a lack of trust boundary validation for server-initiated HTTP requests based on user-controlled URLs.

The implementation uses requests.get() on user-supplied remote_image values and only applies Django's URLValidator, which checks syntactic correctness but not the reachability or safety of the target.

Because redirects are followed automatically and no filtering is applied for private IP ranges, internal hostnames, or loopback addresses, the server can be coerced into connecting to internal resources.

This aligns with CWE-918: Server-Side Request Forgery (SSRF), where an attacker leverages server-side HTTP capabilities to reach otherwise inaccessible network locations.

Potential impact

  • Access to internal HTTP services that are not directly exposed to users
  • Probing of internal network structure (e.g., via timing differences or response characteristics)
  • Interaction with internal admin panels, metadata services, or management APIs that rely on network location for trust
  • Potential data exposure from internal services that respond with sensitive information
  • Facilitation of further attacks when combined with other weaknesses (e.g., misconfigured internal services)

General mitigation guidance

Effective mitigation centers around restricting where the server can connect and tightening trust boundaries around user-supplied URLs:

  • Enforce allowlists for outbound HTTP destinations (e.g., only known safe domains or CDNs for images)
  • Explicitly block private IP ranges, loopback addresses, link-local, and internal hostnames at the application layer before making outbound requests
  • Disable or carefully gate the remote URL download feature, especially in environments where the server can reach sensitive internal networks
  • Avoid following redirects from untrusted domains, or re-validate the final destination after redirects against the same safety rules
  • Run application servers with network segmentation and least-privilege egress rules so they cannot reach sensitive internal services by default

How teams detect issues like this

Organizations can detect and monitor SSRF risk through a combination of code-level and operational controls:

  • Static analysis and code review focused on identifying server-side HTTP calls that use user-controlled URLs (e.g., requests.get(), urlopen())
  • Review of validation and filtering logic around any feature that fetches remote resources, ensuring checks are based on network properties, not just URL syntax
  • Logging and monitoring of outbound requests initiated by the application, including destination IPs and domains, to spot unusual access to internal ranges
  • Network-level controls such as egress filtering and firewall rules, combined with alerting on attempts to reach disallowed IP ranges
  • Integration of security scanners or automated review tools that flag SSRF patterns and missing IP/hostname filtering

Sources

SourceLink
github.comgithub.com/inventree/InvenTree/security/advisories/GHSA-m9j7-jw3m-fr22

Frequently asked

questions

It is exploitable by any user who can authenticate to the application and reach the feature that accepts remote_image URLs. The attack is executed indirectly through the server, which makes requests to attacker-chosen destinations.

Not necessarily. Any authenticated account with the ability to submit or modify data that includes a remote_image field can potentially exploit this issue, depending on how permissions are configured in a given deployment.

Apply strict outbound request controls: use allowlists for acceptable domains, block private and loopback IP ranges, validate both the initial URL and any final destination after redirects, and consider disabling the feature where it is not strictly needed.

Treat all user-supplied URLs as untrusted, implement centralized URL and network validation routines, restrict server egress at the network level, and ensure security review for any functionality that makes server-side requests based on client input.

Find out what's already
exploitable in your codebase.