# CVE-2023-46725: FoodCoopShop Server-Side Request Forgery vulnerability

> Attackers can exploit SSRF in FoodCoopShop to access internal networks and read arbitrary files via redirect tricks.

- **Severity:** High 8.1 (`CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N`)
- **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 Nov 2023
- **Updated:** 12 Sep 2024
- **Also known as:** GHSA-jhww-fx2j-3rf7

## What is CVE-2023-46725?

CVE-2023-46725 is a high-severity server-side request forgery vulnerability in foodcoopshop, published on 2 Nov 2023. Any signed-in user can exploit it over the network, with no action from the victim.

### Official description

FoodCoopShop is open source software for food coops and local shops. Versions starting with 3.2.0 prior to 3.6.1 are vulnerable to server-side request forgery. In the Network module, a manufacturer account can use the `/api/updateProducts.json` endpoint to make the server send a request to an arbitrary host. This means that the server can be used as a proxy into the internal network where the server is. Furthermore, the checks on a valid image are not adequate, leading to a time of check time of use issue. For example, by using a custom server that returns 200 on HEAD requests, then return a valid image on first GET request and then a 302 redirect to final target on second GET request, the server will copy whatever file is at the redirect destination, making this a full SSRF. Version 3.6.1 fixes this vulnerability.

Weakness: CWE-367 (Time-of-check Time-of-use (TOCTOU) Race Condition), CWE-918 (Server-Side Request Forgery)

## Which versions are affected by CVE-2023-46725?

2 open source packages ship an affected version, including foodcoopshop/foodcoopshop. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `foodcoopshop/foodcoopshop` | Packagist | From 3.2.0 | 3.6.1 |
| `foodcoopshop/foodcoopshop` | Packagist | From 3.2.0 | 3.6.1 |

Products: Foodcoopshop Foodcoopshop.

## How do I fix CVE-2023-46725?

Upgrade foodcoopshop/foodcoopshop to 3.6.1 or later.

## Is CVE-2023-46725 being exploited?

There is no known exploitation of CVE-2023-46725 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2023-46725 and fix it if it is affected.

What it is: CVE-2023-46725 is a high-severity server-side request forgery vulnerability in foodcoopshop, published on 2 Nov 2023. Any signed-in user can exploit it over the network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2023-46725 in the wild and no public exploit code.

Affected packages and fixed versions:
- foodcoopshop/foodcoopshop (Packagist): affected from 3.2.0; fixed in 3.6.1
- foodcoopshop/foodcoopshop (Packagist): affected from 3.2.0; fixed in 3.6.1

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/CVE-2023-46725/ (Markdown: https://insights.sbomify.com/CVE-2023-46725/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2023-46725
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2023-46725
- OSV: https://osv.dev/vulnerability/CVE-2023-46725

---
From sbomify Insights: https://insights.sbomify.com/CVE-2023-46725/
Summaries are generated and may contain mistakes; the official description above is the record.
