CVE-2023-46725
JSON

8.1high

FoodCoopShop Server-Side Request Forgery vulnerability

Severity
8.1high CVSS:3.1 by GitHub_M
Exploit likelihood
0.56% (higher than 48% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-jhww-fx2j-3rf7

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.

Affected

Product or packageVersionsReported by
foodcoopshop foodcoopshop>= 3.2.0, < 3.6.1, from 3.2.0 up to 3.6.0CVE List, NVD
foodcoopshop/foodcoopshop (Packagist)from 3.2.0 before 3.6.1GitHub Advisory Database

All scores

GitHub_M8.1high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N
GitHub8.1high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N
NVD7.5high CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H

Classification

CWE-367CWE-918

SSVC (CISA-ADP): exploitation none, automatable no, technical impact total.

What each source says

CVE List

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.

GitHub Advisory Database

There is a potential SSRF vulnerability in foodcoopshop. Since there is no security policy on your Github, I tried to use the emails to contact you.

The potential issue is in the Network module, where a manufacturer account can use the /api/updateProducts.json endpoint to make the server send a request to arbitrary host. For example, use

data[data][0][remoteProductId]=352&data[data][0][image]=http://localhost:8888/

will make the server send a request to localhost:8888. This means that it can be used as a proxy into the internal network where the server is.

To make matters worse, the checks on valid image is not enough. There is time of check time of use issue there. 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 at the redirect destination, making this a full SSRF. (An example python server that can do this is at https://pastebin.com/8K5Brwbq This will make the server download whatever at the redirect target)

You can check https://cheatsheetseries.owasp.org/cheatsheets/Server_Side_Request_Forgery_Prevention_Cheat_Sheet.html for more information on SSRF, their impact and how to properly fix it.

Regards

NVD (es)

FoodCoopShop es un software de código abierto para cooperativas de alimentos y tiendas locales. Las versiones que comienzan con 3.2.0 anteriores a 3.6.1 son vulnerables a server-side request forgery. En el módulo de Network, una cuenta de fabricante puede usar el endpoint `/api/updateProducts.json` para hacer que el servidor envíe una solicitud a un host arbitrario. Esto significa que el servidor se puede utilizar como proxy en la red interna donde se encuentra el servidor. Además, las comprobaciones de una imagen válida no son adecuadas, lo que genera un problema de tiempo de verificación de uso. Por ejemplo, al usar un servidor personalizado que devuelve 200 en solicitudes HEAD, luego devuelve una imagen válida en la primera solicitud GET y luego una redirección 302 al destino final en la segunda solicitud GET, el servidor copiará cualquier archivo que esté en el destino de la redirección, haciendo Esta es una SSRF completa. La versión 3.6.1 corrige esta vulnerabilidad.

References

Sources

SourceRecordLicence
CVE ListCVE-2023-46725 changed 2024-09-12CVE Terms of Use
GitHub Advisory DatabaseGHSA-jhww-fx2j-3rf7 changed 2024-02-16CC-BY-4.0
NVDCVE-2023-46725 changed 2026-06-17Public domain