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

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.

Basic information

Type
reviewed
Severity
medium
Advisory on GitHub
Open advisory ↗
Repository advisory
Open repository advisory ↗
Source code
Browse source ↗
Published (advisory)
2023-07-25 17:17:12 UTC
Updated
2023-11-05 05:00:49 UTC
GitHub reviewed
2023-07-25 17:17:12 UTC
NVD published
2023-07-25

EPSS Score

Score Percentile
0.08% 22.52%

CVSS Scores

Base score Version Severity Vector
4.8 3.1
CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:U/C:H/I:L/A:N Click to expand
Attack vector (AV:N)
Could be attacked over the internet or any normal routed network—not just someone sitting at the machine.
Attack complexity (AC:H)
Even with access, the exploit needs extra luck, timing, or a fussy environment to actually work.
Privileges required (PR:H)
They need powerful rights—admin, root, or similar—before this pays off.
User interaction (UI:R)
A real person has to do something—click, install, enable—otherwise it doesn’t land.
Scope (S:U)
Damage stays in the same “trust bubble” as the broken component—no big spill into unrelated systems.
Confidentiality (C:H)
Serious risk that confidential data gets exposed in a big way.
Integrity (I:L)
Attackers could change some data, but it’s limited—not everything goes.
Availability (A:N)
Service keeps running; no real outage angle.

Identifiers

CWEs

CWE id Name
CWE-200 Exposure of Sensitive Information to an Unauthorized Actor

Credits

  • nathan-pichon (remediation_developer)
  • Marc-Roig (reporter)
  • derrickmehaffy (remediation_verifier)
  • innerdvations (remediation_reviewer)
  • Convly (remediation_reviewer)

Affected packages (3)

Vulnerable version ranges and first patched releases as published by GitHub.

Ecosystem Package Vulnerable range First patched Vulnerable functions
npm @strapi/strapi < 4.10.8 4.10.8
npm @strapi/utils < 4.10.8 4.10.8
npm @strapi/database < 4.10.8 4.10.8

References

cvelogic Threat Intelligence