Unauthorized Access to Private Fields in User Registration API
System Details
| Name | Value |
|---|---|
| OS | Windows 11 |
| Version | 4.11.1 (node v16.14.2) |
| Database | mysql |
Description
I marked some fields as private fields in user content-type, and tried to register as a new user via api, at the same time I added content to fill the private fields and sent a post request, and as you can see from the images below, I can write to the private fields.




To prevent this, I went to the extension area and tried to extend the register method, for this I wanted to do it using the sanitizeInput function that I know in the source codes of the strap. But the sanitizeInput function did not filter out private fields.
const { auth } = ctx.state;
const data = ctx.request.body;
const userSchema = strapi.getModel("plugin::users-permissions.user");
sanitize.contentAPI.input(data, userSchema, { auth });
here's the solution I've temporarily kept to myself, code snippet
const body = ctx.request.body;
const { attributes } = strapi.getModel("plugin::users-permissions.user");
const sanitizedData = _.omitBy(body, (data, key) => {
const attribute = attributes[key];
if (_.isNil(attribute)) {
return false;
}
//? If you want, you can throw an error for fields that we did not expect.
// if (_.isNil(attribute))
// throw new ApplicationError(`Unexpected value ${key}`);
// if private value is true, we do not want to send it to the database.
return attribute.private;
});
return sanitizedData;
Software afectado
Haz clic en una tecnología para ver todas sus vulnerabilidades.
| Plataforma | Paquete | Versiones vulnerables | Corregida en |
|---|---|---|---|
| Paquete de npm | @strapi/plugin-users-permissions | >= 4.0.0, < 4.13.1 | 4.13.1 |
| Paquete de npm | @strapi/strapi | >= 4.0.0, < 4.13.1 | 4.13.1 |
Referencias
- Vector CVSS
CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:U/C:L/I:H/A:L- Debilidad (CWE)
CWE-287- Plataforma
- npm
- Paquete
@strapi/plugin-users-permissions, @strapi/strapi- Publicada
- 03.11.2023
- Actualizado
- 11.10.2026 10:22
Fuentes y licencias
OSV / GitHub Advisory Database - GHSA-gc7p-j5xm-xxh2 - CC BY 4.0
Historial de vulnerabilidades: @strapi/plugin-users-permissions
Todas las vulnerabilidades publicadas de este paquete (Paquete de npm), de la más reciente a la más antigua. Muestra si es un fallo aislado o un paquete que hay que vigilar.
- Entradas en total
- 8
- Primera → última
- 04.2023 05.2026
- Sin corrección
- 0
- Explotada en ataques
- 0
Distribución por gravedad
- Crítica 1
- Alta 4
- Media 2
- Baja 1
Divulgaciones por año
- 2023: 5
- 2024: 1
- 2025: 0
- 2026: 2
-
Unauthorized Access to Private Fields in User Registration API esta entrada
Identifica las vulnerabilidades de tu aplicación
Con la integración de DockRay y el inventario de software activado, DockRay compara las versiones notificadas de los componentes con las vulnerabilidades conocidas y avisa de las coincidencias confirmadas. La cobertura depende de la tecnología compatible y de los avisos disponibles.