Skip to content

Making all attributes on a content-type public without noticing it

Moderate severity GitHub Reviewed Published Jul 25, 2023 in strapi/strapi • Updated Nov 5, 2023

Package

npm @strapi/database (npm)

Affected versions

< 4.10.8

Patched versions

4.10.8
npm @strapi/strapi (npm)
< 4.10.8
4.10.8
npm @strapi/utils (npm)
< 4.10.8
4.10.8

Description

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:

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.

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.

References

@alexandrebodin alexandrebodin published to strapi/strapi Jul 25, 2023
Published by the National Vulnerability Database Jul 25, 2023
Published to the GitHub Advisory Database Jul 25, 2023
Reviewed Jul 25, 2023
Last updated Nov 5, 2023

Severity

Moderate

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
High
Privileges required
High
User interaction
Required
Scope
Unchanged
Confidentiality
High
Integrity
Low
Availability
None

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:U/C:H/I:L/A:N

EPSS score

0.086%
(38th percentile)

Weaknesses

CVE ID

CVE-2023-34093

GHSA ID

GHSA-chmr-rg2f-9jmf

Source code

Credits

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.