You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+67-14
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,10 @@
1
-
# Magento 2 patch for CVE-2024-34102(aka Cosmic Sting)
1
+
# Magento 2 Patch for CVE-2024-34102(aka Cosmic Sting)
2
2
3
-
**Another way(as an extension) to fix CVE-2024-34102(XXE vulnerability) with extra XML Security enhancement. If you cannot upgrade Magento or cannot apply the official patch, this one is an alternative solution.**
3
+
**An alternative solution(as a Magento 2 extension) to fix the XXE vulnerability CVE-2024-34102(aka Cosmic Sting). If you cannot upgrade Magento or cannot apply the official patch, try this one.**
4
4
5
5
**_If you don't fix this vulnerability, the attacker can RCE. We've already observed real world attacks._**
6
6
7
-
[")](https://www.wubinworks.com/cosmic-sting-patch.html)
## CVE-2024-34102 Affected Magento Versions(starting from 2.3)
10
10
@@ -15,7 +15,7 @@
15
15
16
16
## Background
17
17
18
-
[CVE-2024-34102](https://cve.org/CVERecord?id=CVE-2024-34102)(aka Cosmic Sting) was identified as XXE vulnerability and the details were published on June 2024. By exploiting this vulnerability, the attacker can read secret and important configuration files on the server.
18
+
[CVE-2024-34102](https://cve.org/CVERecord?id=CVE-2024-34102)(aka Cosmic Sting) was identified as [XXE](https://en.wikipedia.org/wiki/XML_external_entity_attack) vulnerability and the details were published on June 2024. By exploiting this vulnerability, the attacker can read secret and important configuration files on the server.
19
19
Typically, the attacker will extract encryption keys in `env.php`.
20
20
21
21
In most hacked servers, we observed one or multiple of the followings:
@@ -25,7 +25,7 @@ In most hacked servers, we observed one or multiple of the followings:
25
25
- Backdoors
26
26
- Magento core files modified
27
27
- PHP script that steals sales data
28
-
- Inject Javascript to CMS pages to steal credit cards
28
+
- Inject malicious Javascript to CMS pages to steal credit cards
29
29
- And maybe more
30
30
31
31
If you want to know _"How Exactly It Works"_, we have very detailed blog posts that [examine](https://www.wubinworks.com/blog/post/cve-2024-34102-cosmic-sting-attack) and [fix](https://www.wubinworks.com/blog/post/cve-2024-34102-aka-cosmicsting-how-to-defend) the vulnerability.
@@ -38,20 +38,20 @@ The attacker can craft fake Admin Token by using the stolen encryption key. With
38
38
39
39
### Chained with CVE-2024-2961
40
40
41
-
> XXEs are now RCEs
41
+
> XXEs are now RCEs.
42
42
43
43
As CVE-2024-34102 enables the ability to read arbitrary file on the server, the attacker can now combine it with a bug([CVE-2024-2961](https://www.cve.org/CVERecord?id=CVE-2024-2961)) discovered in `glibc` to run any command on the server. One real case we experienced was that multiple backdoors got downloaded and installed.
44
44
The `glibc` bug exists in `glibc` version <= 2.3.9
45
45
46
46
##### Check `glibc` version by running
47
47
48
-
```
48
+
```bash
49
49
ldd --version | grep -i 'libc'
50
50
```
51
51
52
52
## How to fix?
53
53
54
-
### Fix CVE-2024-34102
54
+
### Fix the Main Vulnerability CVE-2024-34102
55
55
56
56
There are 3 Ways Available:
57
57
@@ -66,7 +66,7 @@ There are 3 Ways Available:
66
66
This step invalidates crafted fake tokens to completely deny WebAPI access from attacker.
67
67
_If you are unsure whether encryption keys are leaked or not, do this step._
68
68
69
-
##### More Info
69
+
##### Additional Info
70
70
71
71
Some Magento 2.4 versions have a bug that you need to apply a [patch](https://github.com/wubinworks/magento2-jwt-auth-patch) before performing key rotation.
72
72
@@ -76,26 +76,79 @@ Some Magento 2.4 versions have a bug that you need to apply a [patch](https://gi
If you got incorrect IP such as `127.0.0.1`, empty string or a CDN's IP, this means your ***web server, middleware, and/or proxy server have incorrect settings***. There is no way to tell the real IP address without fixing those incorrect settings.
124
+
83
125
## Requirements
84
126
85
-
Magento 2.3
86
-
Magento 2.4
127
+
Magento 2.3 or 2.4
128
+
129
+
##### PHP Version Compatibility
130
+
131
+
Version 1.0.0 and 1.1.0 support PHP 8 only
132
+
Version 1.2.0(re-designed) supports PHP 7 and PHP 8
Copy file name to clipboardexpand all lines: composer.json
+2-3
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
{
2
2
"name": "wubinworks/module-cosmic-sting-patch",
3
-
"description": "Another way(as an extension) to fix CVE-2024-34102(XXE vulnerability) with extra XML Security enhancement. If you cannot upgrade Magento or cannot apply the official patch, this one is an alternative solution.",
3
+
"description": "An alternative solution(as a Magento 2 extension) to fix the XXE vulnerability CVE-2024-34102(aka Cosmic Sting). If you cannot upgrade Magento or cannot apply the official patch, try this one.",
0 commit comments