# GHSA-vx3h-qwqw-r2wq: Inventree Server-Side Request Forgery vulnerability exposes server port/internal IP

> Attackers can exploit the remote image download feature to extract sensitive server-side information via error messages, requiring an upgrade to fix.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 2 Oct 2024

## What is GHSA-vx3h-qwqw-r2wq?

GHSA-vx3h-qwqw-r2wq is a server-side request forgery vulnerability in inventree, published on 2 Oct 2024. Any signed-in user can exploit it over the network, with no action from the victim.

### Official description

### Impact

The "download image from remote URL" feature can be abused by a malicious actor to potentially extract information about server side resources. Submitting a crafted URL (in place of a valid image) can raise a server side error, which is reported back to the user. 

This error message may contain sensitive information about the server side request, including information about the availability of the remote resource.

### Patches

The solution to this vulnerability is to prevent the server from returning any specific information about the observed exception. Instead, a generic error message is returned to the client.

This patch has been applied to the upcoming 0.17.0 release, and also back-ported to the 0.16.5 stable release.

### Workarounds

To avoid this issue with unpatched versions, the "download image from remote URL" feature can be disabled in InvenTree, preventing users from accessing this information. 

### References

Thanks to @febin0x10 for identifying this vulnerability and reporting it to us as per our security policy.

## Which versions are affected by GHSA-vx3h-qwqw-r2wq?

2 open source packages ship an affected version, including inventree.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `inventree` | PyPI | All versions | 0.16.5 |
| `inventree` | PyPI | All versions | 0.16.5 |

## How do I fix GHSA-vx3h-qwqw-r2wq?

Upgrade inventree to 0.16.5 or later.

## Is GHSA-vx3h-qwqw-r2wq being exploited?

There is no known exploitation of GHSA-vx3h-qwqw-r2wq in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-vx3h-qwqw-r2wq and fix it if it is affected.

What it is: GHSA-vx3h-qwqw-r2wq is a server-side request forgery vulnerability in inventree, published on 2 Oct 2024. Any signed-in user can exploit it over the network, with no action from the victim.
Exploitation: There is no known exploitation of GHSA-vx3h-qwqw-r2wq in the wild and no public exploit code.

Affected packages and fixed versions:
- inventree (PyPI): affected all versions; fixed in 0.16.5
- inventree (PyPI): affected all versions; fixed in 0.16.5

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/GHSA-vx3h-qwqw-r2wq/ (Markdown: https://insights.sbomify.com/GHSA-vx3h-qwqw-r2wq/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-vx3h-qwqw-r2wq

---
From sbomify Insights: https://insights.sbomify.com/GHSA-vx3h-qwqw-r2wq/
Summaries are generated and may contain mistakes; the official description above is the record.
