CVE-2023-34093: @strapi/strapi Making All Attributes On A Vulnerability

MODERATE
Advisory Identifier: GHSA-chmr-rg2f-9jmf
CVSS 4.8
CWE-200
Published
Advisory Summary

CVE-2023-34093 is a MODERATE (CVSS 4.8) making all attributes on a vulnerability (CWE-200: Exposure of Sensitive Information to an Unauthorized Actor) affecting @strapi/strapi libraries in the npm ecosystem. The issue involves making all attributes on a content-type public without noticing it. Remediation is available by upgrading affected packages to version 4.10.8.

CVE-2023-34093 at a Glance

CVE Identifier CVE-2023-34093
GHSA Identifier GHSA-chmr-rg2f-9jmf
Severity MODERATE
CVSS v3.1 Base Score 4.8
CWE Classification CWE-200: Exposure of Sensitive Information to an Unauthorized Actor
Affected Product @strapi/strapi
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 4.8

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

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

How to Fix CVE-2023-34093

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

@strapi/strapi fixed: 4.10.8
npm install @strapi/strapi@4.10.8
@strapi/utils fixed: 4.10.8
npm install @strapi/utils@4.10.8
@strapi/database fixed: 4.10.8
npm install @strapi/database@4.10.8
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 @strapi/strapi

How to Check if You Are Affected

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

npm ls @strapi/strapi

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

Note: The npm ls @strapi/strapi 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-200: Exposure of Sensitive Information to an Unauthorized Actor, where the product exposes sensitive information to an actor that is not explicitly authorized to have access to that information. In @strapi/strapi, 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

### Summary Anyone (Strapi developers, users, plugins) can make every attribute of a Content-Type public without knowing it. ### Details When dealing with content-types inside a Strapi instance, we can extend those using the appropriate container: ```javascript strapi.container.get('content-types').extend(contentTypeUID, (contentType) => newContentType); ``` The vulnerability only affects the handling of content types by Strapi, not the actual content types themselves. Users can use plugins or modify their own content types without realizing that the `privateAttributes` getter is being removed, which can result in any attribute becoming public. This can lead to sensitive information being exposed or the entire system being taken control of by an attacker(having access to password hashes). ### PoC Extend any content type on runtime (like in the bootstrap functions) and do a copy of the content-type object. ```javascript strapi.container.get('content-types').extend(contentTypeUID, (contentType) => { const newCT = { ... contentType, attributes: { ...contentType.attributes, newAttr: {} } }; return newCT; }); ``` This will have as effect to remove the getter and as we rely on it in sanitization, every attributes will be considered as public. ### Impact Everyone can be impacted. Depending on how people are using/extending content-types. If the users are mutating the content-type, they will not be affected.

CVE-2023-34093 Affected @strapi/strapi Versions

3 component(s)
Fixed Versions:
4.10.8
Product / Package Ecosystem Affected Versions Fixed Version
@strapi/strapi
npm
< 4.10.8
4.10.8
@strapi/utils
npm
< 4.10.8
4.10.8
@strapi/database
npm
< 4.10.8
4.10.8

References

Frequently Asked Questions

What is CVE-2023-34093?
CVE-2023-34093 is a security vulnerability in @strapi/strapi involving Making all attributes on a content-type public without noticing it under CWE-200: Exposure of Sensitive Information to an Unauthorized Actor.
Which @strapi/strapi versions are affected?
Affected versions include releases prior to 4.10.8 across affected packages: @strapi/strapi, @strapi/utils, @strapi/database.
What version fixes CVE-2023-34093?
Upgrading to 4.10.8 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @strapi/strapi affected?
Yes, @strapi/strapi is affected in releases prior to 4.10.8. Upgrade your dependency to 4.10.8 or later.
Is @strapi/utils affected?
Yes, @strapi/utils is affected in releases prior to 4.10.8. Upgrade your dependency to 4.10.8 or later.
What is the CVSS score of CVE-2023-34093?
CVE-2023-34093 has a CVSS v3.1 base score of 4.8 (MODERATE) with vector string CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:U/C:H/I:L/A:N.
What CWE is associated with CVE-2023-34093?
CVE-2023-34093 is classified under CWE-200: Exposure of Sensitive Information to an Unauthorized Actor (The product exposes sensitive information to an actor that is not explicitly authorized to have access to that information.).
How can I check npm dependencies for CVE-2023-34093?
Run the dependency tree command: 'npm ls @strapi/strapi'. 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-chmr-rg2f-9jmf",
  "modified" : "2023-07-25T17:17:12Z",
  "published" : "2023-07-25T17:17:12Z",
  "aliases" : [ "CVE-2023-34093" ],
  "summary" : "Making all attributes on a content-type public without noticing it",
  "details" : "### Summary\nAnyone (Strapi developers, users, plugins) can make every attribute of a Content-Type public without knowing it.\n\n### Details\nWhen dealing with content-types inside a Strapi instance, we can extend those using the appropriate container:\n```javascript\nstrapi.container.get('content-types').extend(contentTypeUID, (contentType) => newContentType);\n```\nThe vulnerability only affects the handling of content types by Strapi, not the actual content types themselves. Users can use plugins or modify their own content types without realizing that the `privateAttributes` getter is being removed, which can result in any attribute becoming public. This can lead to sensitive information being exposed or the entire system being taken control of by an attacker(having access to password hashes).\n\n### PoC\nExtend any content type on runtime (like in the bootstrap functions) and do a copy of the content-type object.\n```javascript\nstrapi.container.get('content-types').extend(contentTypeUID, (contentType) => {\n  const newCT = { ... contentType, attributes: { ...contentType.attributes, newAttr: {} } };\n  return newCT;\n});\n```\nThis will have as effect to remove the getter and as we rely on it in sanitization, every attributes will be considered as public.\n\n### Impact\nEveryone can be impacted. Depending on how people are using/extending content-types. If the users are mutating the content-type, they will not be affected.\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:U/C:H/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@strapi/strapi"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "4.10.8"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@strapi/utils"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "4.10.8"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@strapi/database"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "4.10.8"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/strapi/strapi/security/advisories/GHSA-chmr-rg2f-9jmf"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-34093"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/strapi/strapi/commit/2fa8f30371bfd1db44c15e5747860ee5789096de"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/strapi/strapi"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/strapi/strapi/releases/tag/v4.10.8"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-200" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-07-25T17:17:12Z",
    "nvd_published_at" : "2023-07-25T15:15:13Z"
  }
}