Lookup for vulnerabilities affecting packages.

Vulnerability_idVCID-jpqv-dukr-fyhu
Summary
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 does not filter out private fields.

```js
 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

```js
 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 does 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;
```
Aliases
0
alias CVE-2023-39345
1
alias GHSA-gc7p-j5xm-xxh2
Fixed_packages
0
url pkg:npm/%40strapi/plugin-users-permissions@4.13.1
purl pkg:npm/%40strapi/plugin-users-permissions@4.13.1
is_vulnerable false
affected_by_vulnerabilities
resource_url http://public2.vulnerablecode.io/packages/pkg:npm/%2540strapi/plugin-users-permissions@4.13.1
1
url pkg:npm/%40strapi/strapi@4.13.1
purl pkg:npm/%40strapi/strapi@4.13.1
is_vulnerable false
affected_by_vulnerabilities
resource_url http://public2.vulnerablecode.io/packages/pkg:npm/%2540strapi/strapi@4.13.1
Affected_packages
0
url pkg:npm/strapi@4.0.0
purl pkg:npm/strapi@4.0.0
is_vulnerable true
affected_by_vulnerabilities
0
vulnerability VCID-jpqv-dukr-fyhu
1
vulnerability VCID-qcu6-ntuc-byea
resource_url http://public2.vulnerablecode.io/packages/pkg:npm/strapi@4.0.0
1
url pkg:npm/%40strapi/plugin-users-permissions@4.0.0
purl pkg:npm/%40strapi/plugin-users-permissions@4.0.0
is_vulnerable true
affected_by_vulnerabilities
0
vulnerability VCID-jpqv-dukr-fyhu
resource_url http://public2.vulnerablecode.io/packages/pkg:npm/%2540strapi/plugin-users-permissions@4.0.0
2
url pkg:npm/%40strapi/strapi@4.0.0
purl pkg:npm/%40strapi/strapi@4.0.0
is_vulnerable true
affected_by_vulnerabilities
0
vulnerability VCID-jpqv-dukr-fyhu
1
vulnerability VCID-qcu6-ntuc-byea
resource_url http://public2.vulnerablecode.io/packages/pkg:npm/%2540strapi/strapi@4.0.0
References
0
reference_url https://strapi.io/blog/security-disclosure-of-vulnerabilities-sept-2023
reference_id
reference_type
scores
url https://strapi.io/blog/security-disclosure-of-vulnerabilities-sept-2023
1
reference_url https://nvd.nist.gov/vuln/detail/CVE-2023-39345
reference_id CVE-2023-39345
reference_type
scores
url https://nvd.nist.gov/vuln/detail/CVE-2023-39345
2
reference_url https://github.com/advisories/GHSA-gc7p-j5xm-xxh2
reference_id GHSA-gc7p-j5xm-xxh2
reference_type
scores
url https://github.com/advisories/GHSA-gc7p-j5xm-xxh2
3
reference_url https://github.com/strapi/strapi/security/advisories/GHSA-gc7p-j5xm-xxh2
reference_id GHSA-gc7p-j5xm-xxh2
reference_type
scores
url https://github.com/strapi/strapi/security/advisories/GHSA-gc7p-j5xm-xxh2
Weaknesses
0
cwe_id 1035
name OWASP Top Ten 2017 Category A9 - Using Components with Known Vulnerabilities
description Weaknesses in this category are related to the A9 category in the OWASP Top Ten 2017.
1
cwe_id 937
name OWASP Top Ten 2013 Category A9 - Using Components with Known Vulnerabilities
description Weaknesses in this category are related to the A9 category in the OWASP Top Ten 2013.
2
cwe_id 287
name Improper Authentication
description When an actor claims to have a given identity, the product does not prove or insufficiently proves that the claim is correct.
Exploits
Severity_range_scorenull
Exploitabilitynull
Weighted_severitynull
Risk_scorenull
Resource_urlhttp://public2.vulnerablecode.io/vulnerabilities/VCID-jpqv-dukr-fyhu