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

Confirm that 1.4.13 was not a security release? #38

Closed
mcdruid opened this issue Apr 26, 2021 · 11 comments
Closed

Confirm that 1.4.13 was not a security release? #38

mcdruid opened this issue Apr 26, 2021 · 11 comments

Comments

@mcdruid
Copy link
Contributor

mcdruid commented Apr 26, 2021

GHSA-rpw6-9xfx-jvcx

...suggests that 1.4.13 included a new security fix for CVE-2020-28948.

It looks to me like #35 / #36 was a bugfix for a regression caused by the mitigation for CVE-2020-28948 ( cde4605 ), but I don't think it's a new security fix in itself.

Could you please confirm either way @mrook? Thanks!

@mrook
Copy link
Member

mrook commented Apr 27, 2021

Hi @mcdruid, that's correct. #35/#36 fix a regression introduced by the fix for the vulnerability. This regression broke functionality for at least the folks using nextcloud.

@mrook mrook closed this as completed Apr 27, 2021
@mcdruid
Copy link
Contributor Author

mcdruid commented Apr 27, 2021

Thanks @mrook!

I've got a support ticket open with github about the mistaken advisory but not sure if/when that'll go anywhere.

@vladxendev
Copy link

vladxendev commented Dec 20, 2021

Hello, Guys.
Currently, I have gained experience in operating this bug on my server(I used latest version 1.4.14 from docker).
Please tell me how to fix this vulnerability, if the fixes in versions 1.4.12 / 1.4.13 / 1.4.14 do not fix the problem of delivering the miner to the web using the pear/Archive_Tar vuln?
Live PHP logs as arguments:
php | [18-Dec-2021 17:53:42] NOTICE: fpm is running, pid 1
php | [18-Dec-2021 17:53:42] NOTICE: ready to handle connections
php | 172.18.0.5 - 18/Dec/2021:17:54:49 +0000 "GET /index.php" 200
php | 172.18.0.5 - 18/Dec/2021:17:57:45 +0000 "POST /index.php" 200
php | 172.18.0.5 - 18/Dec/2021:17:57:50 +0000 "POST /index.php" 200
php | 172.18.0.5 - 18/Dec/2021:17:57:54 +0000 "POST /index.php" 200
php | 172.18.0.5 - 18/Dec/2021:17:59:08 +0000 "POST /index.php" 200
php | 172.18.0.5 - 18/Dec/2021:17:59:12 +0000 "GET /index.php" 200
php | 172.18.0.5 - 18/Dec/2021:17:59:43 +0000 "GET /index.php" 200
php | 172.18.0.5 - 18/Dec/2021:18:00:15 +0000 "GET /index.php" 200
php | 172.18.0.5 - 18/Dec/2021:19:13:40 +0000 "GET /index.php" 200
php | 172.18.0.5 - 18/Dec/2021:19:29:41 +0000 "GET /index.php" 200
php | 172.18.0.5 - 18/Dec/2021:19:41:23 +0000 "GET /index.php" 200
php | 172.18.0.5 - 18/Dec/2021:19:41:28 +0000 "GET /index.php" 200
php | 172.18.0.5 - 18/Dec/2021:19:50:54 +0000 "GET /index.php" 200
php | 195...149 - 18/Dec/2021:20:13:47 +0000 "POST /usr/bin/phar.phar" 404
php | 195...149 - 18/Dec/2021:20:13:47 +0000 "POST /usr/share/php/PEAR.php" 404
php | 195...149 - 18/Dec/2021:20:13:47 +0000 "POST /usr/local/lib/php/PEAR.php" 200
php | chattr: No such file or directory while trying to stat /etc/ld.so.preload
php | chattr: No such file or directory while trying to stat /var/spool/cron
php | chattr: No such file or directory while trying to stat /etc/crontab
php | bash: line 9: ufw: command not found
php | bash: line 10: iptables: command not found
php | bash: line 11: /proc/sys/kernel/nmi_watchdog: Read-only file system
php | bash: line 12: /etc/sysctl.conf: Permission denied
php | main: line 177: ps: command not found
php | main: line 178: pkill: command not found
php | main: line 179: netstat: command not found
php | main: line 180: netstat: command not found
php | main: line 181: netstat: command not found
php | main: line 182: netstat: command not found
php | main: line 183: pkill: command not found
php | main: line 184: pkill: command not found
php | main: line 185: pkill: command not found
php | main: line 186: pkill: command not found
php | main: line 187: pkill: command not found
php | main: line 188: pkill: command not found
php | main: line 189: pkill: command not found
php | main: line 190: pkill: command not found
php | main: line 191: pkill: command not found
php | main: line 192: pkill: command not found
php | main: line 193: pkill: command not found
php | main: line 194: pkill: command not found
php | main: line 195: pkill: command not found
php | main: line 196: pkill: command not found
php | main: line 197: pkill: command not found
php | main: line 198: pkill: command not found
php | main: line 199: pkill: command not found
php | main: line 200: pkill: command not found
php | main: line 201: pkill: command not found
php | main: line 202: pkill: command not found
php | main: line 203: pkill: command not found
php | main: line 204: pkill: command not found
php | main: line 205: pkill: command not found
php | main: line 206: pkill: command not found
php | main: line 207: pkill: command not found
php | main: line 208: pkill: command not found
php | main: line 209: pkill: command not found
php | main: line 210: pkill: command not found
php | main: line 211: ps: command not found
php | cat: /tmp/.X11-unix/01: No such file or directory
php | cat: /tmp/.X11-unix/11: No such file or directory
php | cat: /tmp/.X11-unix/22: No such file or directory
php | cat: /tmp/.pg_stat.0: No such file or directory
php | cat: /tmp/.pg_stat.1: No such file or directory
php | cat: /var/www/data/./oka.pid: No such file or directory
php | main: line 218: pkill: command not found
php | main: line 219: pkill: command not found
php | main: line 220: pkill: command not found
php | main: line 221: pkill: command not found
php | main: line 222: pkill: command not found
php | main: line 223: pkill: command not found
php | main: line 224: pkill: command not found
php | main: line 225: ps: command not found
php | main: line 226: ps: command not found
php | main: line 227: ps: command not found
php | main: line 228: ps: command not found
php | main: line 229: ps: command not found
php | main: line 230: ps: command not found
php | md5sum: /tmp/kinsing: No such file or directory
php | /tmp/kinsing is not 648effa354b3cbaad87b45f48d59c616, actual
php | chmod: cannot access '/tmp/kinsing': No such file or directory
php | % Total % Received % Xferd Average Speed Time Time Time Current
php | Dload Upload Total Spent Left Speed
100 13.9M 100 13.9M 0 0 3052k 0 0:00:04 0:00:04 --:--:-- 2737k
php | /tmp/kinsing is 648effa354b3cbaad87b45f48d59c616
php | md5sum: /tmp/libsystem.so: No such file or directory
php | /tmp/libsystem.so is not ccef46c7edf9131ccffc47bd69eb743b, actual
php | chmod: cannot access '/tmp/libsystem.so': No such file or directory
php | % Total % Received % Xferd Average Speed Time Time Time Current
php | Dload Upload Total Spent Left Speed
100 26800 100 26800 0 0 436k 0 --:--:-- --:--:-- --:--:-- 443k
php | /tmp/libsystem.so is ccef46c7edf9131ccffc47bd69eb743b
php | % Total % Received % Xferd Average Speed Time Time Time Current
php | Dload Upload Total Spent Left Speed
100 26800 100 26800 0 0 415k 0 --:--:-- --:--:-- --:--:-- 415k
php | /tmp/libsystem.so is ccef46c7edf9131ccffc47bd69eb743b
php | main: line 261: /etc/ld.so.preload: Permission denied
php | main: line 265: crontab: command not found
php | main: line 265: crontab: command not found
php | main: line 266: crontab: command not found
php | main: line 266: crontab: command not found
php | main: line 267: crontab: command not found
php | main: line 267: crontab: command not found
php | main: line 268: crontab: command not found
php | main: line 268: crontab: command not found
php | main: line 269: crontab: command not found
php | main: line 269: crontab: command not found
php | main: line 270: crontab: command not found
php | main: line 270: crontab: command not found
php | main: line 271: crontab: command not found
php | main: line 271: crontab: command not found
php | main: line 272: crontab: command not found
php | main: line 272: crontab: command not found
php | main: line 273: crontab: command not found
php | main: line 273: crontab: command not found
php | main: line 274: crontab: command not found
php | main: line 274: crontab: command not found
php | main: line 275: crontab: command not found
php | main: line 275: crontab: command not found
php | main: line 276: crontab: command not found
php | main: line 276: crontab: command not found
php | main: line 277: crontab: command not found
php | main: line 277: crontab: command not found
php | main: line 278: crontab: command not found
php | main: line 278: crontab: command not found
php | main: line 279: crontab: command not found
php | main: line 279: crontab: command not found
php | main: line 280: crontab: command not found
php | main: line 280: crontab: command not found
php | main: line 281: crontab: command not found
php | main: line 281: crontab: command not found
php | main: line 282: crontab: command not found
php | main: line 282: crontab: command not found
php | main: line 283: crontab: command not found
php | main: line 283: crontab: command not found
php | main: line 284: crontab: command not found
php | main: line 284: crontab: command not found
php | main: line 285: crontab: command not found
php | main: line 285: crontab: command not found
php | main: line 286: crontab: command not found
php | main: line 286: crontab: command not found
php | main: line 287: crontab: command not found
php | main: line 287: crontab: command not found
php | main: line 288: crontab: command not found
php | main: line 288: crontab: command not found
php | main: line 289: crontab: command not found
php | main: line 289: crontab: command not found
php | main: line 290: crontab: command not found
php | main: line 290: crontab: command not found
php | main: line 291: crontab: command not found
php | main: line 291: crontab: command not found
php | main: line 292: crontab: command not found
php | main: line 292: crontab: command not found
php | main: line 293: crontab: command not found
php | main: line 293: crontab: command not found
php | main: line 294: crontab: command not found
php | main: line 294: crontab: command not found
php | main: line 295: crontab: command not found
php | main: line 295: crontab: command not found
php | main: line 296: crontab: command not found
php | main: line 296: crontab: command not found
php | main: line 297: crontab: command not found
php | main: line 297: crontab: command not found
php | main: line 298: crontab: command not found
php | main: line 298: crontab: command not found
php | main: line 299: crontab: command not found
php | main: line 299: crontab: command not found
php | main: line 300: crontab: command not found
php | main: line 300: crontab: command not found
php | main: line 301: crontab: command not found
php | main: line 301: crontab: command not found
php | main: line 302: crontab: command not found
php | main: line 302: crontab: command not found
php | main: line 303: crontab: command not found
php | main: line 303: crontab: command not found
php | main: line 304: crontab: command not found
php | main: line 304: crontab: command not found
php | main: line 305: crontab: command not found
php | main: line 305: crontab: command not found
php | main: line 306: crontab: command not found
php | main: line 306: crontab: command not found
php | main: line 307: crontab: command not found
php | main: line 307: crontab: command not found
php | main: line 308: crontab: command not found
php | main: line 308: crontab: command not found
php | main: line 309: crontab: command not found
php | main: line 309: crontab: command not found
php | main: line 310: crontab: command not found
php | main: line 310: crontab: command not found
php | main: line 311: crontab: command not found
php | main: line 311: crontab: command not found
php | main: line 312: crontab: command not found
php | main: line 312: crontab: command not found
php | main: line 313: crontab: command not found
php | main: line 313: crontab: command not found
php | bash: line 356: crontab: command not found
php | bash: line 363: crontab: command not found
php | bash: line 362: echo: write error: Broken pipe
php | 62...46 - 18/Dec/2021:20:14:23 +0000 "POST /usr/local/lib/php/PEAR.php" 200
php | [18-Dec-2021 20:15:59] ALERT: oops, unknown child (373) exited with code 0. Please open a bug report (https://bugs.php.net).
php | bash: line 362: echo: write error: Broken pipe
php | 147...53 - 20/Dec/2021:12:45:43 +0000 "POST /usr/local/lib/php/System.php" 200
php | bash: line 356: crontab: command not found
php | bash: line 363: crontab: command not found
php | bash: line 362: echo: write error: Broken pipe
php | 147...53 - 20/Dec/2021:12:45:43 +0000 "POST /usr/local/lib/php/PEAR.php" 200
php | [20-Dec-2021 12:45:47] ALERT: oops, unknown child (4029) exited with code 0. Please open a bug report (https://bugs.php.net).
php | 172.18.0.5 - 20/Dec/2021:12:47:11 +0000 "GET /index.php" 200
php | [20-Dec-2021 12:47:47] ALERT: oops, unknown child (4331) exited with code 0. Please open a bug report (https://bugs.php.net).

This is miner after delivering initiate compromised you data published on server, next step crypting you database and create blank table of one written text: Please pay bitcoin wallet for lost your crypted data from you database.
THIS IS CRITICAL VULN(

@mrook
Copy link
Member

mrook commented Dec 20, 2021

Hi @vladxendev - I'm not sure what I'm looking at. Is this a log file? From what? An exploit? What "miner" are you talking about?

@vladxendev
Copy link

Hi @mrook - I'm talking about exploiting the CVE-2020-36193 vulnerability, the fixes for which do not work in versions 1.4.12 / 1.4.13 / 1.4.14, since this vulnerability was exploited on my server where pear / Archive_Tar 1.4.14 is installed by the current latest version.
These are the logs from PHP 7.4.23 which is installed on a server inside docker for which I manually installed the latest pear / Archive_Tar 1.4.14 patch.
As a miner, I describe the consequences of the exploitation of this vulnerability, which leads to its exploitation by hackers, that is, I describe the threat that occurred on my server in order to alert other users who are faced with this problem.

@mrook
Copy link
Member

mrook commented Dec 21, 2021

Okay, understood. Can you explain how you are exploiting this, i.e. how our fixes might fail to defend against the exploit?

@vladxendev
Copy link

I see the involvement of the CVE-2020-36193 vulnerability, which I encountered half a year ago, and I already had exactly the same consequences on my sites, I then manually installed at that time the version with the very first fix 1.4.12, and up to 18.12 .2021 I slept peacefully, but noticed in the server processes /tmp/kdevtmpfsi and /tmp/kinsing that load all the server processor cores to 100%, I immediately thought that maybe I forgot to install patch 1.4.12 somewhere, but after checking orb I found that it was installed everywhere and did not work, so how I found out in the logs what happened the last time half a year ago, I reinstalled the system and installed the fix 1.4.14, but a day later I found a newly appeared miner inside the docker container, traces of which, as an explanation, are in the log that I provided and that's all that I have.

@mrook
Copy link
Member

mrook commented Dec 21, 2021

I see. It's hard to make any conclusions from your posted log, especially without knowing more context. What is in your /index.php for example? Can you share where you are using Archive_Tar in publicly accessible scripts? What archives are being unpacked?

@vladxendev
Copy link

I do not use the tar archiver in my scripts, it is simply available in my Php environment and comes bundled by default as a built-in package or module, but judging by the logs, I see that it is being exploited by a post request using a call to "POST /usr/local/lib/php/PEAR.php" 200 and "POST /usr/local/lib/php/System.php" 200.
I can also, as an aid and assistance to the Php community, I can directly provide you with my VPS server which is under attack to exploit this vulnerability, so that you can determine how this happens)

@mcdruid
Copy link
Contributor Author

mcdruid commented Dec 21, 2021

As @mrook said, it's hard to conclude anything much from the details shared.

However, to me this does not look related to the directory traversal vulnerabilities addressed in recent releases of Archive_Tar.

It looks like perhaps you have a Remote Code Execution vulnerability somewhere and it's being exploited to run this:

https://sysdig.com/blog/zoom-into-kinsing-kdevtmpfsi/

I am curious about requests to the path /usr/local/lib/php/PEAR.php would get a 200? Should that path be accessible within your webserver's docroot? I'd have thought not.

@mrook
Copy link
Member

mrook commented Dec 21, 2021

Indeed, /usr/local/lib/php/PEAR.php and /usr/local/lib/php/System.php should not be publically accessible through a web server. Additionally, those files are part of PEAR's core, not Archive_Tar.

I'm more than happy to help you (and if there's really something amiss with Archive_Tar, fix it) - but it's difficult to determine from what I've seen so far.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants