-
Notifications
You must be signed in to change notification settings - Fork 1
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/plugin-users-permissions to v4.24.2 [security] - autoclosed #178
Closed
renovate
wants to merge
1
commit into
master
from
renovate/npm-@strapi/plugin-users-permissions-vulnerability
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
renovate
bot
force-pushed
the
renovate/npm-@strapi/plugin-users-permissions-vulnerability
branch
from
June 14, 2024 15:28
b154fd9
to
95b2953
Compare
renovate
bot
force-pushed
the
renovate/npm-@strapi/plugin-users-permissions-vulnerability
branch
from
June 14, 2024 17:03
95b2953
to
7fbed58
Compare
renovate
bot
force-pushed
the
renovate/npm-@strapi/plugin-users-permissions-vulnerability
branch
from
June 16, 2024 00:40
7fbed58
to
5f5eb66
Compare
renovate
bot
force-pushed
the
renovate/npm-@strapi/plugin-users-permissions-vulnerability
branch
from
June 19, 2024 08:54
5f5eb66
to
d97b93f
Compare
renovate
bot
force-pushed
the
renovate/npm-@strapi/plugin-users-permissions-vulnerability
branch
from
June 19, 2024 09:06
d97b93f
to
c01b746
Compare
renovate
bot
force-pushed
the
renovate/npm-@strapi/plugin-users-permissions-vulnerability
branch
from
June 20, 2024 17:07
c01b746
to
8c889e7
Compare
renovate
bot
force-pushed
the
renovate/npm-@strapi/plugin-users-permissions-vulnerability
branch
from
June 24, 2024 15:59
8c889e7
to
9a2a5ef
Compare
renovate
bot
force-pushed
the
renovate/npm-@strapi/plugin-users-permissions-vulnerability
branch
from
July 1, 2024 14:14
9a2a5ef
to
b062fb0
Compare
👍 Dependency issues cleared. Learn more about Socket for GitHub ↗︎ This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored. |
renovate
bot
force-pushed
the
renovate/npm-@strapi/plugin-users-permissions-vulnerability
branch
from
July 5, 2024 10:05
b062fb0
to
a29c8a5
Compare
renovate
bot
force-pushed
the
renovate/npm-@strapi/plugin-users-permissions-vulnerability
branch
from
July 5, 2024 12:38
a29c8a5
to
a8903e8
Compare
renovate
bot
force-pushed
the
renovate/npm-@strapi/plugin-users-permissions-vulnerability
branch
from
July 5, 2024 12:42
a8903e8
to
42e2332
Compare
renovate
bot
force-pushed
the
renovate/npm-@strapi/plugin-users-permissions-vulnerability
branch
from
July 5, 2024 12:49
42e2332
to
69a5eec
Compare
renovate
bot
force-pushed
the
renovate/npm-@strapi/plugin-users-permissions-vulnerability
branch
from
July 8, 2024 07:38
69a5eec
to
23da4ad
Compare
renovate
bot
force-pushed
the
renovate/npm-@strapi/plugin-users-permissions-vulnerability
branch
from
July 17, 2024 16:43
23da4ad
to
b705b64
Compare
renovate
bot
force-pushed
the
renovate/npm-@strapi/plugin-users-permissions-vulnerability
branch
from
July 18, 2024 19:52
b705b64
to
e43ae80
Compare
renovate
bot
force-pushed
the
renovate/npm-@strapi/plugin-users-permissions-vulnerability
branch
from
July 24, 2024 11:13
e43ae80
to
1f7859b
Compare
renovate
bot
force-pushed
the
renovate/npm-@strapi/plugin-users-permissions-vulnerability
branch
from
July 30, 2024 10:18
1f7859b
to
34e9872
Compare
renovate
bot
force-pushed
the
renovate/npm-@strapi/plugin-users-permissions-vulnerability
branch
from
July 30, 2024 12:55
34e9872
to
c5bae1f
Compare
Quality Gate passedIssues Measures |
renovate
bot
changed the title
fix(deps): update dependency @strapi/plugin-users-permissions to v4.24.2 [security]
fix(deps): update dependency @strapi/plugin-users-permissions to v4.24.2 [security] - autoclosed
Aug 6, 2024
renovate
bot
deleted the
renovate/npm-@strapi/plugin-users-permissions-vulnerability
branch
August 6, 2024 09:21
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
4.24.0
->4.24.2
GitHub Vulnerability Alerts
CVE-2024-34065
Summary
By combining two vulnerabilities (an
Open Redirect
andsession token sent as URL query parameter
) in Strapi framework is its possible of an unauthenticated attacker to bypass authentication mechanisms and retrieve the 3rd party tokens. The attack requires user interaction (one click).Impact
Unauthenticated attackers can leverage two vulnerabilities to obtain an 3rd party token and the bypass authentication of Strapi apps.
Technical details
Vulnerability 1: Open Redirect
Description
Open redirection vulnerabilities arise when an application incorporates user-controllable data into the target of a redirection in an unsafe way. An attacker can construct a URL within the application that causes a redirection to an arbitrary external domain.
In the specific context of Strapi, this vulnerability allows the SSO token to be stolen, allowing an attacker to authenticate himself within the application.
Remediation
If possible, applications should avoid incorporating user-controllable data into redirection targets. In many cases, this behavior can be avoided in two ways:
If it is considered unavoidable for the redirection function to receive user-controllable input and incorporate this into the redirection target, one of the following measures should be used to minimize the risk of redirection attacks:
Example 1: Open Redirect in /api/connect/microsoft via
$_GET["callback"]
$_GET["callback"]
Payload:
Final payload:
User clicks on the link:
Look at the intercepted request in Burp and see the redirect to Microsoft:
Microsoft check the cookies and redirects to the original domain (and route) but with different GET parameters.
Then, the page redirects to the domain controlled by the attacker (and a token is added to controlled the URL):
The domain originally specified (https://google.fr) as
$_GET["callback"]
parameter is present in the cookies. So <TARGET> is using the cookies (koa.sess
) to redirect.koa.sess
cookie:The vulnerability seems to come from the application's core:
File: packages/plugins/users-permissions/server/controllers/auth.js
And more specifically:
Possible patch:
_.get(ctx, 'query.callback')
=$_GET["callback"]
and_.get(ctx, 'session')
=$_COOKIE["koa.sess"]
(which is{"grant":{"provider":"microsoft","dynamic":{"callback":"https://XXXXXXX/"}},"_expire":1701275652123,"_maxAge":86400000}
) so_.get(ctx, 'session.grant.dynamic.callback')
=https://XXXXXXX/
.The route is clearly defined here:
File: packages/plugins/users-permissions/server/routes/content-api/auth.js
File: packages/plugins/users-permissions/server/services/providers-registry.js
If parameter
$_GET["callback"]
is defined in the GET request, the assignment does not evaluate all conditions, but stops at the beginning. The value is then stored in the cookiekoa.sess
:koa.sess
=eyJncmFudCI6eyJwcm92aWRlciI6Im1pY3Jvc29mdCIsImR5bmFtaWMiOnsiY2FsbGJhY2siOiJodHRwczovL2FkbWluLmludGUubmV0YXRtby5jb20vdXNlcnMvYXV0aC9yZWRpcmVjdCJ9fSwiX2V4cGlyZSI6MTcwMTI3NTY1MjEyMywiX21heEFnZSI6ODY0MDAwMDB9
Which once base64 decoded become
{"grant":{"provider":"microsoft","dynamic":{"callback":"https://<TARGET>/users/auth/redirect"}},"_expire":1701275652123,"_maxAge":86400000}
.The signature of the cookie is stored in cookie
koa.sess.sig
:koa.sess.sig
=wTRmcVRrn88hWMdg84VvSD87-_0
File: packages/plugins/users-permissions/server/bootstrap/grant-config.js
Vulnerability 2: Session token in URL
Description
Applications should not send session tokens as URL query parameters and use instead an alternative mechanism for transmitting session tokens, such as HTTP cookies or hidden fields in forms that are submitted using the POST method.
Example 1: SSO token transmitted within URL (
$_GET["access_token"]
)$_GET["callback"]
When a callback was called, the 3rd party token was transmitted in an insecure way within the URL, which could be used to increase the impact of the Open Redirect vulnerability described previously by stealing the SSO token.
Weaponized payload:
With a web server specially developed to exploit the vulnerability listening on <C2>:8080, it is possible to retrieve a JWT token allowing authentication on Strapi.
A user is on his browser when he decides to click on a link sent to him by e-mail.
The server specially developed by the attacker to show that the vulnerability is exploitable, recovers the user's SSO token.
Because the victim didn't change to another Web page.
The attacker can use the SSO token to authenticate himself within the application and retrieve a valid JWT token enabling him to interact with it.
Details
Get the JWT token with the
access_token
First of all, thanks to the SSO token, you authenticate yourself and get a JWT token to be able to interact with the various API routes.
Request (HTTP):
Response (HTTP):
Request API routes using the JWT token
Then reuse the JWT token to request the API.
Request (HTTP):
Response (HTTP):
POC (Web server stealing SSO token and retrieving JWT token then bypassing authentication)
Release Notes
strapi/strapi (@strapi/plugin-users-permissions)
v4.24.2
Compare Source
Strapi was made aware of a vulnerably 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.
📚 Update and Migration Guides
Full Changelog: strapi/strapi@v4.24.2...v4.24.1
v4.24.1
Compare Source
🔥 Bug fix
📚 Update and Migration Guides
Configuration
📅 Schedule: Branch creation - "" in timezone Europe/Paris, Automerge - At any time (no schedule defined).
🚦 Automerge: Enabled.
♻ 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.
This PR was generated by Mend Renovate. View the repository job log.