Skip to content

Commit 05ebba3

Browse files
update readme and cleanup repo
1 parent 2ee2d08 commit 05ebba3

File tree

6 files changed

+101
-9
lines changed

6 files changed

+101
-9
lines changed

3.6.10/gitkeep

Whitespace-only changes.

3.6.8/gitkeep

Whitespace-only changes.

3.6.9/gitkeep

Whitespace-only changes.

4.3.9/gitkeep

Whitespace-only changes.

4.4.7/gitkeep

Whitespace-only changes.

README.md

Lines changed: 101 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,102 @@
1+
# Patches for Strapi security issue 2212 (Users-Permissions-Template)
12

2-
- [x] 4.4.7
3-
- [x] 4.3.9
4-
- [x] 4.2.3
5-
- [x] 4.1.12
6-
- [x] 4.0.8
7-
- [x] 3.6.11
8-
- [ ] 3.6.10
9-
- [ ] 3.6.9
10-
- [ ] 3.6.8
3+
## Introduction
4+
5+
As you [may be aware](https://github.com/strapi/strapi/releases/tag/v4.5.6), Strapi was made aware of a critical security vulnerability that was patched in v4.5.6. If you're looking at this guide, it means you are on a version of Strapi less than v4.5.6 and are trying to apply [this fix](https://github.com/strapi/strapi/pull/15385), before you upgrade your Strapi app. This guide is split into two parts: patching your app with your own files, and patching your application with patch files obtained from the Strapi team.
6+
7+
## Prerequisites
8+
9+
For this guide, it's imperative that you are familiar (not an expert) with [patch-package](https://github.com/ds300/patch-package). Ideally, your only use of patch-package will you require you to apply the patch using a single command.
10+
11+
## Setting up your project
12+
13+
This zip contains various patch versions for the latest "patch version" for the latest minor releases. You should only pick the proper patch folder for the version you are on, if your version is not listed we ask that you please upgrade to the closest version.
14+
15+
For example:
16+
17+
- If you are currently on v4.0.7, you should upgrade your application to v4.0.8 BEFORE you apply the patches
18+
- If you are currently on a v3 version below v3.6.11, you should upgrade your application to v3.6.11 BEFORE you apply the patches
19+
20+
For update guides see the following documentation:
21+
22+
- For v4 you can use the [following documentation](https://docs.strapi.io/developer-docs/latest/update-migration-guides/update-version.html)
23+
- For v3 you can use the [following documentation](https://docs-v3.strapi.io/developer-docs/latest/update-migration-guides/update-version.html)
24+
25+
### Required packages
26+
27+
1. You will need the following packages installed in your application: `patch-package` and `postinstall-postinstall`
28+
1. For NPM: `npm install patch-package postinstall-postinstall`
29+
2. For Yarn: `yarn add patch-package postinstall-postinstall`
30+
2. Edit your `package.json` file to add the patch-package script to your `scripts`.
31+
32+
```json
33+
// Path: `./package.json`
34+
35+
{
36+
"name": "your-strapi-app",
37+
// ...
38+
"scripts": {
39+
// ...
40+
"postinstall": "patch-package"
41+
},
42+
// ...
43+
}
44+
```
45+
46+
### Using the patch files
47+
48+
After choosing your desired version, copy and paste the patches folder into your application at the root of the Strapi app (if you are using a monorepo)
49+
50+
#### Sample V4 app structure
51+
52+
```
53+
├── config
54+
├── database
55+
├── node_modules
56+
├── patches
57+
│ ├── @strapi+plugin-email+4.0.8.patch
58+
│ ├── @strapi+plugin-users-permissions+4.0.8.patch
59+
│ └── @strapi+utils+4.0.8.patch
60+
├── public
61+
├── src
62+
├── .gitignore
63+
└── package.json
64+
```
65+
66+
#### Sample V3 app structure
67+
68+
```
69+
├── api
70+
├── config
71+
├── extensions
72+
├── node_modules
73+
├── patches
74+
│ ├── strapi-plugin-email+3.6.11.patch
75+
│ └── strapi-plugin-users-permissions+3.6.11.patch
76+
├── public
77+
├── .gitignore
78+
└── package.json
79+
```
80+
81+
### Apply the patch
82+
83+
Once you have your package.json configured and the patches copied into your app; in order to apply the patches you will need to reinstall your node modules:
84+
85+
- For NPM: `npm install -f`
86+
- For Yarn: `yarn install -f`
87+
88+
Patch-package should notify after you install the modules that it has applied the patches, see the following example response below:
89+
90+
```bash
91+
user@hostname:~/yourApp$ yarn install -f
92+
yarn install v1.22.19
93+
[1/5] Validating package.json...
94+
[2/5] Resolving packages...
95+
success Already up-to-date.
96+
$ patch-package
97+
patch-package 6.5.1
98+
Applying patches...
99+
strapi-plugin-email@3.6.11 ✔
100+
strapi-plugin-users-permissions@3.6.11 ✔
101+
Done in 0.80s.
102+
```

0 commit comments

Comments
 (0)