CVE-2023-46725: Foodcoopshop/foodcoopshop FoodCoopShop Server-Side Request Forgery Vulnerability Vulnerability

HIGH
Advisory Identifier: GHSA-jhww-fx2j-3rf7
CVSS 8.1
CWE-367 CWE-918
Published
Advisory Summary

CVE-2023-46725 is a HIGH (CVSS 8.1) foodcoopshop server-side request forgery vulnerability vulnerability (CWE-367: Time-of-check Time-of-use (TOCTOU) Race Condition) affecting Foodcoopshop/foodcoopshop libraries in the Packagist ecosystem. The issue involves foodcoopshop server-side request forgery vulnerability. Remediation is available by upgrading affected packages to version 3.6.1.

CVE-2023-46725 at a Glance

CVE Identifier CVE-2023-46725
GHSA Identifier GHSA-jhww-fx2j-3rf7
Severity HIGH
CVSS v3.1 Base Score 8.1
CWE Classification CWE-367: Time-of-check Time-of-use (TOCTOU) Race Condition
Affected Product Foodcoopshop/foodcoopshop
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 8.1

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability None (A:N)

How to Fix CVE-2023-46725

To remediate this vulnerability, upgrade all affected Foodcoopshop/foodcoopshop dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

foodcoopshop/foodcoopshop fixed: 3.6.1
Upgrade foodcoopshop/foodcoopshop to 3.6.1
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for foodcoopshop/foodcoopshop

How to Check if You Are Affected

To determine whether your application is affected by CVE-2023-46725, inspect your project dependencies for Foodcoopshop/foodcoopshop:

inspect dependencies for foodcoopshop/foodcoopshop

Analyze the terminal output to locate any version of Foodcoopshop/foodcoopshop in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.6.1), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-367: Time-of-check Time-of-use (TOCTOU) Race Condition, where the product checks the state of a resource before using that resource, but the resource's state can change between the check and the use in a way that invalidates the results of the check. In Foodcoopshop/foodcoopshop, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

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

CVE-2023-46725 Affected Foodcoopshop/foodcoopshop Versions

1 component(s)
Fixed Versions:
3.6.1
Product / Package Ecosystem Affected Versions Fixed Version
foodcoopshop/foodcoopshop
Packagist
≥ 3.2.0
< 3.6.1
3.6.1

References

Frequently Asked Questions

What is CVE-2023-46725?
CVE-2023-46725 is a security vulnerability in Foodcoopshop/foodcoopshop involving FoodCoopShop Server-Side Request Forgery vulnerability under CWE-367: Time-of-check Time-of-use (TOCTOU) Race Condition.
Which Foodcoopshop/foodcoopshop versions are affected?
Affected versions include releases prior to 3.6.1 across affected packages: foodcoopshop/foodcoopshop.
What version fixes CVE-2023-46725?
Upgrading to 3.6.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is foodcoopshop/foodcoopshop affected?
Yes, foodcoopshop/foodcoopshop is affected in releases prior to 3.6.1. Upgrade your dependency to 3.6.1 or later.
What is the CVSS score of CVE-2023-46725?
CVE-2023-46725 has a CVSS v3.1 base score of 8.1 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N.
What CWE is associated with CVE-2023-46725?
CVE-2023-46725 is classified under CWE-367: Time-of-check Time-of-use (TOCTOU) Race Condition (The product checks the state of a resource before using that resource, but the resource's state can change between the check and the use in a way that invalidates the results of the check.).
How can I check Packagist dependencies for CVE-2023-46725?
Run the dependency tree command: 'inspect dependencies for foodcoopshop/foodcoopshop'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-jhww-fx2j-3rf7",
  "modified" : "2023-11-02T20:53:19Z",
  "published" : "2023-11-02T20:53:19Z",
  "aliases" : [ "CVE-2023-46725" ],
  "summary" : "FoodCoopShop Server-Side Request Forgery vulnerability",
  "details" : "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.\n\nThe 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.\nFor example, use\n```\ndata[data][0][remoteProductId]=352&data[data][0][image]=http://localhost:8888/\n```\nwill 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.\n\nTo make matters worse, the checks on valid image is not enough. There is time of check time of use issue there.\nFor 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\nat the redirect destination, making this a full SSRF.\n(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)\n\nYou 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.\n\nRegards",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "foodcoopshop/foodcoopshop"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.2.0"
      }, {
        "fixed" : "3.6.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/foodcoopshop/foodcoopshop/security/advisories/GHSA-jhww-fx2j-3rf7"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-46725"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/foodcoopshop/foodcoopshop/pull/972"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/foodcoopshop/foodcoopshop/commit/0d5bec5c4c22e1affe7fd321a30e3f3a4d99e808"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/foodcoopshop/foodcoopshop"
  }, {
    "type" : "WEB",
    "url" : "https://pastebin.com/8K5Brwbq"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-367", "CWE-918" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-11-02T20:53:19Z",
    "nvd_published_at" : "2023-11-02T15:15:08Z"
  }
}