CVE-2023-34235: @strapi/database Leaking Sensitive User Information Still Vulnerability

HIGH
Advisory Identifier: GHSA-9xg4-3qfm-9w8f
CVSS 8.6
CWE-200
Published
Advisory Summary

CVE-2023-34235 is a HIGH (CVSS 8.6) leaking sensitive user information still vulnerability (CWE-200: Exposure of Sensitive Information to an Unauthorized Actor) affecting @strapi/database libraries in the npm ecosystem. The issue involves leaking sensitive user information still possible by filtering on private with prefix fields. Remediation is available by upgrading affected packages to version 4.10.8.

CVE-2023-34235 at a Glance

CVE Identifier CVE-2023-34235
GHSA Identifier GHSA-9xg4-3qfm-9w8f
Severity HIGH
CVSS v3.1 Base Score 8.6
CWE Classification CWE-200: Exposure of Sensitive Information to an Unauthorized Actor
Affected Product @strapi/database
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 8.6

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

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

How to Fix CVE-2023-34235

To remediate this vulnerability, upgrade all affected @strapi/database 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/database fixed: 4.10.8
npm install @strapi/database@4.10.8
@strapi/utils fixed: 4.10.8
npm install @strapi/utils@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/database

How to Check if You Are Affected

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

npm ls @strapi/database

Analyze the terminal output to locate any version of @strapi/database 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/database 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/database, 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 Still able to leak private fields if using the t(number) prefix ### Details Knex query allows you to change there default prefix ```SqliteError: select distinct `t0`.* from `pages` as `t0` left join `admin_users` as `t1` on `t0`.`updated_by_id` = `t1`.`id` where (`t1`.`password` = 1)``` so if you change the prefix to the same as it was before or to an other table you want to query you query changes from password to t1.password password is protected by filtering protections but t1.password is not protected ### PoC 1 Create a contentType 2 add to its options "populateCreatorFields" 3 create 1 entity in your new content type 4 in settings enable the find route in settings for the content type you created for public 5 /api/(Your contenttype)?filters%5BupdatedBy%5D%5Bt1.password%5D%5B%24startsWith%5D=a%24 And now the api returns noting if you were to do /api/(Your contenttype)?filters%5BupdatedBy%5D%5Bt1.password%5D%5B%24startsWith%5D=%24 it would return your entity ### Impact You can do filtering attacks on everything related to the object again including admin passwords and reset-tokens.

CVE-2023-34235 Affected @strapi/database Versions

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

References

Frequently Asked Questions

What is CVE-2023-34235?
CVE-2023-34235 is a security vulnerability in @strapi/database involving Leaking sensitive user information still possible by filtering on private with prefix fields under CWE-200: Exposure of Sensitive Information to an Unauthorized Actor.
Which @strapi/database versions are affected?
Affected versions include releases prior to 4.10.8 across affected packages: @strapi/database, @strapi/utils.
What version fixes CVE-2023-34235?
Upgrading to 4.10.8 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @strapi/database affected?
Yes, @strapi/database 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-34235?
CVE-2023-34235 has a CVSS v3.1 base score of 8.6 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:N.
What CWE is associated with CVE-2023-34235?
CVE-2023-34235 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-34235?
Run the dependency tree command: 'npm ls @strapi/database'. 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-9xg4-3qfm-9w8f",
  "modified" : "2023-07-25T17:17:37Z",
  "published" : "2023-07-25T17:17:37Z",
  "aliases" : [ "CVE-2023-34235" ],
  "summary" : "Leaking sensitive user information still possible by filtering on private with prefix fields",
  "details" : "### Summary\nStill able to leak private fields if using the t(number) prefix \n\n### Details\nKnex query allows you to change there default prefix \n```SqliteError: select distinct `t0`.* from `pages` as `t0` left join `admin_users` as `t1` on `t0`.`updated_by_id` = `t1`.`id` where (`t1`.`password` = 1)```\nso if you change the prefix to the same as it was before or to an other table you want to query you query changes from password to t1.password password is protected by filtering protections but t1.password is not protected\n### PoC\n1 Create a contentType\n2 add to its options \"populateCreatorFields\"\n3 create 1 entity in your new content type\n4 in settings enable the find route in settings for the content type you created for public\n5 /api/(Your contenttype)?filters%5BupdatedBy%5D%5Bt1.password%5D%5B%24startsWith%5D=a%24\nAnd now the api returns noting if you were to do\n/api/(Your contenttype)?filters%5BupdatedBy%5D%5Bt1.password%5D%5B%24startsWith%5D=%24 it would return your entity\n\n### Impact\nYou can do filtering attacks on everything related to the object again including admin passwords and reset-tokens.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@strapi/database"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "4.10.8"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 4.10.7"
    }
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@strapi/utils"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "4.10.8"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 4.10.7"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/strapi/strapi/security/advisories/GHSA-9xg4-3qfm-9w8f"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-34235"
  }, {
    "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" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-07-25T17:17:37Z",
    "nvd_published_at" : "2023-07-25T18:15:10Z"
  }
}