Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(deps): update dependency @strapi/strapi to v4.13.1 [security] #14

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

plural-renovate[bot]
Copy link
Contributor

@plural-renovate plural-renovate bot commented Apr 19, 2023

This PR contains the following updates:

Package Type Update Change
@strapi/strapi (source) dependencies minor 4.5.2 -> 4.13.1

GitHub Vulnerability Alerts

CVE-2023-22894

Summary

Strapi through 4.7.1 allows unauthenticated attackers to discover sensitive user details for Strapi administrators and API users.

Details

Strapi through 4.7.1 allows unauthenticated attackers to discover sensitive user details for Strapi administrators and API users. The unauthenticated attacker can filter users by columns that contain sensitive information and infer the values by the changes in the API responses. An unauthenticated attacker can exploit this vulnerability to hijack Strapi administrator accounts and gain unauthorized Strapi Super Administrator access by leaking the password reset token and changing the admin password. This can be exploited on all Strapi versions <=4.7.1.

IoC

The exploitation of CVE-2023-22894 is easily detectable, since the payload is within the GET parameters and are normally included in request logs. The following regex pattern will extract requests that are exploiting this vulnerability to leak user's email, password and password reset token columns.

/(\[|%5B)\s*(email|password|reset_password_token|resetPasswordToken)\s*(\]|%5D)/

You can search log files for this IoC by using the following grep command.

grep -iE '(\[|%5B)\s*(email|password|reset_password_token|resetPasswordToken)\s*(\]|%5D)' $PATH_TO_LOG_FILE

If the above regex pattern matches any lines in your log files, take extra precaution to look out for multiple requests that include password, reset_password_token or resetPasswordToken. This would indicate that an attacker has leaked the password hashes and reset tokens on your Strapi server and you need to immediately start an incident response!

Impact

All Strapi users below 4.8.0

CVE-2023-34093

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.

CVE-2023-39345

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.

register

user

private_field

table

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;

Release Notes

strapi/strapi (@​strapi/strapi)

v4.13.1

Compare Source

⚠️ Breaking Changes ⚠️

Starting with Strapi v4.13.1, requests to the Content API using invalid query parameters will be rejected with an error response instead of being silently removed from the query. If you are seeing “Invalid parameter” errors in a Content API request, please ensure that every parameter in your query string is valid. If you need the previous behavior of filtering out invalid parameters, you will need to use a custom controller that only calls sanitizeQuery and not validateQuery. For more information as to why we made this change please see #​17001

⚠️ Security Warning and Notice ⚠️

Strapi was made aware of a few vulnerabilities that were patched in this release, for now we are going to delay the detailed disclosure of the exact details on how to exploit it and how it was patched to give time for users to upgrade before we do public disclosure.

For now the delay timeline looks like we will release the detailed information in the next two (2) weeks, we expect to do public disclosure (via a blog post) on Wednesday Sept 13th, 2023. The previous disclosure mentioned in v4.12.1 was delayed and will also be disclosed on Sept 13th, 2023.

💅 Enhancement
🚀 New feature
🔥 Bug fix
🚨 Security
⚙️ Chore
📚 Update and Migration Guides
  • General update guide can be found here
  • Migration guides can be found here 📚

v4.13.0

Compare Source

v4.12.7

Compare Source

  • Revert to v4.12.5 due to high severity issue.

v4.12.6

Compare Source

⚙️ Chore
📖 Documentation
📚 Update and Migration Guides
  • General update guide can be found here
  • Migration guides can be found here 📚

v4.12.5

Compare Source

🔥 Bug fix
⚙️ Chore
💅 Enhancement
📚 Update and Migration Guides
  • General update guide can be found here
  • Migration guides can be found here 📚

v4.12.4

Compare Source

⚙️ Chore
🔥 Bug fix
📖 Documentation

📚 Update and Migration Guides
  • General update guide can be found here
  • Migration guides can be found here 📚

v4.12.2

Compare Source

v4.12.1

Compare Source

⚠️ Security Warning and Notice ⚠️

Strapi was made aware of a few vulnerabilities that were patched in this release, for now we are going to delay the detailed disclosure of the exact details on how to exploit it and how it was patched to give time for users to upgrade before we do public disclosure.

For now the delay timeline looks like we will release the detailed information in the next four (4) weeks, we expect to do public disclosure (via a blog post) on Wednesday Aug 30th, 2023.

⚙️ Chore
💅 Enhancement
🔥 Bug fix

📚 Update and Migration Guides
  • General update guide can be found here
  • Migration guides can be found here 📚

v4.12.0

Compare Source

🚀 New feature
⚙️ Chore
💅 Enhancement
🔥 Bug fix
📚 Update and Migration Guides
  • General update guide can be found here
  • Migration guides can be found here 📚

v4.11.7

Compare Source

Skipping v4.11.6 due to publication errors

🔥 Bug fix
⚙️ Chore

📚 Update and Migration Guides
  • General update guide can be found here
  • Migration guides can be found here 📚

v4.11.6

Compare Source

v4.11.5

Compare Source

⚙️ Chore
💅 Enhancement
🔥 Bug fix
📚 Update and Migration Guides
  • General update guide can be found here
  • Migration guides can be found here 📚
  • ⚠️ If you experience no assets visible at the root of the Media Library please check this migration guide ⚠️

v4.11.4

Compare Source

⚙️ Chore
🔥 Bug fix
📖 Documentation

📚 Update and Migration Guides
  • General update guide can be found here
  • Migration guides can be found here 📚
  • ⚠️ If you experience no assets visible at the root of the Media Library please check this migration guide ⚠️

v4.11.3

Compare Source

💅 Enhancement
🔥 Bug fix
⚙️ Chore
📚 Update and Migration Guides
  • General update guide can be found here
  • Migration guides can be found here 📚

v4.11.2

Compare Source

🔥 Bug fix

Configuration

📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Renovate Bot.

@plural-renovate plural-renovate bot force-pushed the renovate/npm-@strapi/strapi-vulnerability branch from 81cb5b7 to c189e21 Compare July 25, 2023 18:57
@plural-renovate plural-renovate bot changed the title fix(deps): update dependency @strapi/strapi to v4.8.0 [security] fix(deps): update dependency @strapi/strapi to v4.10.8 [security] Jul 25, 2023
@plural-renovate plural-renovate bot force-pushed the renovate/npm-@strapi/strapi-vulnerability branch from c189e21 to 0e902f6 Compare November 3, 2023 21:12
@plural-renovate plural-renovate bot changed the title fix(deps): update dependency @strapi/strapi to v4.10.8 [security] fix(deps): update dependency @strapi/strapi to v4.13.1 [security] Nov 3, 2023
@plural-renovate plural-renovate bot changed the title fix(deps): update dependency @strapi/strapi to v4.13.1 [security] fix(deps): update dependency @strapi/strapi to v4.13.1 [security] - autoclosed Feb 24, 2024
@plural-renovate plural-renovate bot closed this Feb 24, 2024
@plural-renovate plural-renovate bot deleted the renovate/npm-@strapi/strapi-vulnerability branch February 24, 2024 03:24
@plural-renovate plural-renovate bot changed the title fix(deps): update dependency @strapi/strapi to v4.13.1 [security] - autoclosed fix(deps): update dependency @strapi/strapi to v4.13.1 [security] Feb 24, 2024
@plural-renovate plural-renovate bot reopened this Feb 24, 2024
@plural-renovate plural-renovate bot restored the renovate/npm-@strapi/strapi-vulnerability branch February 24, 2024 07:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants