Advisory

GHSA-chmr-rg2f-9jmf

Also known as: CVE-2023-34093

Summary

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

Details

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.

Severity

Medium Basis: The source's own band: MODERATE

Dates

Published
2023-07-25 17:17 UTC
Modified
2023-11-08 04:12 UTC

Affected packages and fixes

@strapi/strapi

npm · All systems

Affected

  • introduced 0, fixed 4.10.8 (semver)

Fixed versions

4.10.8

Fix

@strapi/utils

npm · All systems

Affected

  • introduced 0, fixed 4.10.8 (semver)

Fixed versions

4.10.8

Fix

@strapi/database

npm · All systems

Affected

  • introduced 0, fixed 4.10.8 (semver)

Fixed versions

4.10.8

Fix

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences