CVE-2024-4146: Lunary Lunary-ai/lunary Allows Users Unauthorized Access Vulnerability

CRITICAL
Advisory Identifier: GHSA-w5xm-mx47-v7c8
CVSS 9.8
CWE-285 CWE-863
Published
Advisory Summary

CVE-2024-4146 is a CRITICAL (CVSS 9.8) lunary-ai/lunary allows users unauthorized access vulnerability (CWE-285: Improper Authorization) affecting Lunary libraries in the npm ecosystem. The issue involves lunary-ai/lunary allows users unauthorized access to projects. Remediation is available by upgrading affected packages to version 1.2.26.

CVE-2024-4146 at a Glance

CVE Identifier CVE-2024-4146
GHSA Identifier GHSA-w5xm-mx47-v7c8
Severity CRITICAL
CVSS v3.1 Base Score 9.8
CWE Classification CWE-285: Improper Authorization
Affected Product Lunary
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 9.8

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:H/I:H/A:H).

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 High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2024-4146

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

lunary fixed: 1.2.26
npm install lunary@1.2.26
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 lunary

How to Check if You Are Affected

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

npm ls lunary

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

Note: The npm ls lunary 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-285: Improper Authorization, where the product does not perform or incorrectly performs an authorization check when an actor attempts to access a resource or perform an action. In Lunary, 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

Withdrawn: This advisory was incorrectly linked the the npm package `lunary`. The advisory is valid, but not for that packlage. In lunary-ai/lunary version v1.2.13, an incorrect authorization vulnerability exists that allows unauthorized users to access and manipulate projects within an organization they should not have access to. Specifically, the vulnerability is located in the `checkProjectAccess` method within the authorization middleware, which fails to adequately verify if a user has the correct permissions to access a specific project. Instead, it only checks if the user is part of the organization owning the project, overlooking the necessary check against the `account_project` table for explicit project access rights. This flaw enables attackers to gain complete control over all resources within a project, including the ability to create, update, read, and delete any resource, compromising the privacy and security of sensitive information.

CVE-2024-4146 Affected Lunary Versions

1 component(s)
Fixed Versions:
1.2.26
Product / Package Ecosystem Affected Versions Fixed Version
lunary
npm
< 1.2.26
1.2.26

References

Frequently Asked Questions

What is CVE-2024-4146?
CVE-2024-4146 is a security vulnerability in Lunary involving lunary-ai/lunary allows users unauthorized access to projects under CWE-285: Improper Authorization.
Which Lunary versions are affected?
Affected versions include releases prior to 1.2.26 across affected packages: lunary.
What version fixes CVE-2024-4146?
Upgrading to 1.2.26 (or the latest patched release for your respective branch) resolves the vulnerability.
Is lunary affected?
Yes, lunary is affected in releases prior to 1.2.26. Upgrade your dependency to 1.2.26 or later.
What is the CVSS score of CVE-2024-4146?
CVE-2024-4146 has a CVSS v3.1 base score of 9.8 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2024-4146?
CVE-2024-4146 is classified under CWE-285: Improper Authorization (The product does not perform or incorrectly performs an authorization check when an actor attempts to access a resource or perform an action.).
How can I check npm dependencies for CVE-2024-4146?
Run the dependency tree command: 'npm ls lunary'. 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-w5xm-mx47-v7c8",
  "modified" : "2024-11-18T19:40:39Z",
  "published" : "2024-06-08T21:30:38Z",
  "withdrawn" : "2024-11-18T19:40:39Z",
  "aliases" : [ "CVE-2024-4146" ],
  "summary" : "lunary-ai/lunary allows users unauthorized access to projects",
  "details" : "Withdrawn: This advisory was incorrectly linked the the npm package `lunary`. The advisory is valid, but not for that packlage.\n\nIn lunary-ai/lunary version v1.2.13, an incorrect authorization vulnerability exists that allows unauthorized users to access and manipulate projects within an organization they should not have access to. Specifically, the vulnerability is located in the `checkProjectAccess` method within the authorization middleware, which fails to adequately verify if a user has the correct permissions to access a specific project. Instead, it only checks if the user is part of the organization owning the project, overlooking the necessary check against the `account_project` table for explicit project access rights. This flaw enables attackers to gain complete control over all resources within a project, including the ability to create, update, read, and delete any resource, compromising the privacy and security of sensitive information.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "lunary"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.2.26"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-4146"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/lunary-ai/lunary/commit/c43b6c62035f32ca455f66d5fd22ba661648cde7"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/lunary-ai/lunary"
  }, {
    "type" : "WEB",
    "url" : "https://huntr.com/bounties/a749e696-b398-4260-b2d0-b0054b9fffa7"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-285", "CWE-863" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-06-10T15:33:08Z",
    "nvd_published_at" : "2024-06-08T20:15:52Z"
  }
}