New in CWP Edge-LatestFree with every CWPpro licenceWebsites up to 300x faster

CWP now includes LSPHP, LSAPI-Cache and CWP Cage at no extra cost with all CWPpro licences. The LSAPI-Cache plugin is integrated into our WordPress and other script installers, and CWP Cage gives every user complete isolation. Available now in the CWP Edge-Latest version.

Get CWPpro ›

Trojanized cwpsrv on 1.30.6 (EL9) - new CWPdoor variant not matched by published

Started by venty, November 19, 2026, 08:56:48 PM

Previous topic - Next topic

venty

CWP Security Audit flagged /usr/local/cwpsrv/bin/cwpsrv as tampered on our server
(AlmaLinux 9, cwpsrv-1.30.6-1.el9.x86_64). Findings:

- rpm -V: S.5 on the binary; mtime reset to the package value.
- Clean binary from the repo: 4,582,304 bytes, SHA256 b1e3c0450f14bc807d1d253b5fef2bf38c4255005bb8eb79c863df2d68a8e34e
- Installed binary: 4,767,368 bytes, SHA256 62758f2a68d92ad6d8022f1f1fcdab87161a6336c96697dbd73eadfc9d6bc506
- Not stripped. Contains a hidden module "ngx_http_log_digest" (functions ngx_http_lgd_hdr_sig/_ts/_data,
  log_digest_sig_check, aes_encrypt/decrypt, execute_privileged, helper_run, disable_access_log).
  Extra imports: RSA_verify, PEM_read_bio_RSA_PUBKEY, EVP_Encrypt/Decrypt*, BIO_f_base64, popen, pipe.
  Header names are encoded, so the published CWPdoor IOCs (X-Ngx-Integrity, ngx_http_integrity_helper)
  do NOT match this variant.
- Built from upstream nginx: it logs "nginx: the configuration file ... syntax is ok" instead of "cwpsrv:".
  This gives a simple check in /var/log/messages for when the trojan was first started.

Timeline: an admin ran a routine OS update (glibc only) from Yum Manager. 23 seconds after dnf finished,
cwpsrv was stopped, the binary replaced, restarted, and timestamps reset (ctime shows the real time).
The admin session shows no file manager or terminal use at that moment, so the swap was done by
something server-side, possibly triggered by the update.

Questions:
1. Is this variant known to you?
2. Could a CWP component (Yum Manager or a post-update script) have been modified to run the installer?
   Which files should we compare against originals?
3. Is there an official integrity check for the CWP PHP files and /scripts?

We have replaced the binary with the clean one from the repo, restricted the panel ports and are
planning a full rebuild.

BR
Venty



Starburst

This is why you need to keep CWP updated.
There is no way to manually update the CWP backend, but you can be aware until a fix comes out.

Not sure how you where still running an older version still yesterday, when the fix came out in 1.30.8 on 2026-11-11.

I been posting about the Nginx CVE's here as well as on sysadmin.help.

Last post was 2 days ago on 2026-11-18.

thefantas

**Title:** CWPdoor-style trojaned cwpsrv installed by the panel "Update" (cron.php → autoupdater) on AlmaLinux 10 — evidence and IOCs

Hello CWP team,

On one of our CWP servers, the panel's own update process replaced `/usr/local/cwpsrv/bin/cwpsrv` with a backdoored build. It looks like a renamed CWPdoor variant. Your `cwp_security_audit` flagged it on 2026-11-19 ("Panel binary tampered"), and we have since cleaned it. Please look into how it was delivered: everything points to the update chain that `cron.php` runs as root.

**Environment**
- AlmaLinux 10.2, CWP LTS 1.30.x (now 1.30.32), `cwpsrv-1.30.6-1.el10`.

**What happened (2026-11-08, 14:20 UTC)**
- The admin pressed **Update** in the admin panel (`module=update`), which runs `cron.php`.
- In the **"Update Server Packages"** step, instead of the usual "CentOS Web Panel (CWP) UPDATER" banner, the following ran. It is a 12,458-byte script fetched with `curl` and piped to a shell. Excerpt from `/var/log/cwp/panel_update_cwp.log`, times are UTC-5:

```
2026-11-08 09:20:46 CWP update started from the admin panel
============= CentOS Web Panel Cron ================
Firewall Flush Daily Blocks
Update Server Packages
  % Total    % Received % Xferd  Average Speed ...
#          CentOS Web Panel (CWP)   cwpsrv UPDATER              #
100 12458  100 12458 ...
[2026-11-08 09:20:49] Installed cwpsrv version: 1.30.6 (sha256 31a59668bd91b3bb, 4619408 bytes)
[2026-11-08 09:20:49] Distribution: AlmaLinux 10.2 (Lavender Lion) (almalinux10.2 build selected)
[2026-11-08 09:20:49] Downloading http://136.0.141.71/static/cwpsrv_1.30.6_almalinux10.2
[2026-11-08 09:20:49]   package accepted: cwpsrv/1.30.6 702f9c12b8b4f999
[2026-11-08 09:20:55] cwpsrv updated to 1.30.6 (almalinux10.2 build)
  sha256    : 31a59668bd91b3bb -> 702f9c12b8b4f999
  size      : 4619408 -> 4767232 bytes
  mtime     : 2026-10-30 17:05:53 (preserved)
  reported  : http://136.0.141.71/update?v=1.30.6
  log file  : none (this updater writes no files)
```

- The nightly `cron.daily` run the same day, at 08:47 UTC, did **not** do this. The binary's ctime is 2026-11-08 14:20:55 UTC.

**How the update chain works today (traced with strace, 2026-11-21)**
- We forced `cron.php` under strace. In "Update Server Packages" it runs:
  1. `wget -q https://centos-webpanel.com/webpanel/main.php?dl=cwp-el7_autoupdater.sh`
  2. `sh /usr/local/src/cwp-el7_autoupdater.sh`
  3. `rm -f` of the script.
- Today's script is clean: 7,427 bytes, sha256 `3dafa83a2def6d68f3970fb63513027009f20380da3a136a447c0500ffebcdc0`, banner "CentOS Web Panel (CWP)   UPDATER".
- On 2026-11-08 the output at exactly that point was a modified copy of that banner ("... **cwpsrv** UPDATER"). We could not recover that script, because it is deleted after it runs.
- Our conclusion is that the malicious stage arrived through this update channel: either the autoupdater served on 2026-11-08 or the panel code at that time. Delivery may have been selective. The download is HTTPS with certificate verification, so tampering in transit is unlikely.

**IOCs**
- **Attacker server:**
  - IP `136.0.141.71`
  - download `http://136.0.141.71/static/cwpsrv_1.30.6_almalinux10.2`
  - callback `http://136.0.141.71/update?v=1.30.6`
- **Trojaned cwpsrv:**
  - sha256 `702f9c12b8b4f999739201659e38f381f9d83a6b160d4215fd5de4085ad7bbb1`
  - md5 `55eae64a387d17c20c37efc30bbc5a14`
  - 4,767,232 bytes
- **Official `cwpsrv-1.30.6-1.el10`:** sha256 `31a59668bd91b3bbb6078887b480416bbe77e7b56be243c43edc5e7c758b7e74`, 4,619,408 bytes.
- **Strings present only in the trojan:**
  - `ngx_http_log_digest_aes_encrypt`, `ngx_http_log_digest_aes_decrypt`
  - `ngx_http_log_digest_helper_run`, `ngx_http_log_digest_helper_pid`
  - "cache digest: ... helper disabled"
  - `RSA_verify`, `PEM_read_bio_RSA_PUBKEY`, `BIO_f_base64`
- It has **no** `X-Ngx-Integrity` strings, so it is a renamed variant. It is **not** matched by `KNOWN_BAD_BINHASH` in `cwp_security_audit` (#846866). Only the `rpm -V` check caught it.

**What we did**
- Reinstalled the signed `cwpsrv` RPM; `rpm -V` is clean.
- Blocked `136.0.141.71`.
- Restricted the admin port to trusted IPs.
- Checked for Ebury (clean, with your busybox scan), new accounts and keys, and modified packages. We found nothing.

**Requests / questions**
1. Can you check what `main.php?dl=cwp-el7_autoupdater.sh` served around **2026-11-08 14:20 UTC**, and whether it can serve different content to different clients?
2. Is this related to incident #846866? Is there an advisory, and how many servers are affected?
3. Please **sign** the autoupdater and the panel zips (GPG or minisign) and verify the signature in `cron.php` before running them. An `.md5` from the same server does not protect against a compromised server.
4. Please add the hash above to `KNOWN_BAD_BINHASH`.
5. `cwp.repo` ships with `gpgcheck=0` although the RPMs are signed. Please enable `gpgcheck=1`.

We can share the trojaned binary privately with your security team.

Thanks.

venty

Quote from: Starburst on November 20, 2026, 01:19:21 PMThis is why you need to keep CWP updated.
There is no way to manually update the CWP backend, but you can be aware until a fix comes out.

Not sure how you where still running an older version still yesterday, when the fix came out in 1.30.8 on 2026-11-11.

I been posting about the Nginx CVE's here as well as on sysadmin.help.

Last post was 2 days ago on 2026-11-18.

Hi,

I didn't quite get this...

The infection occurs on all versions of AL—8, 9, and 10—and specifically during an update???

What should we do??? Okay, we can clean it up, but what guarantee is there that it won't happen again—or if we reinstall the server from scratch???

BR
Venty

Administrator

Thank you for an exceptionally thorough report - the strace of the update chain, the exact byte
sizes and hashes, and the clean-host checks are exactly what make a case like this easy to confirm.
Short version: this is the same CWPdoor vector tracked as incident #846866 (the 136.0.141.71
download host), now seen on EL10. Our distribution was never compromised; the delivery was a
plaintext-HTTP, run-as-root step in the update chain that an on-path attacker could substitute -
and that step, plus package signing, is already fixed and shipped. Details below, answering your
five points directly.


1) THIS IS THE KNOWN CWPdoor VECTOR (#846866)
---------------------------------------------
Everything matches: the download host 136.0.141.71, the URL shapes /static/cwpsrv_<ver>_<distro>
and /update?v=, and a trojaned nginx-fork cwpsrv. None of those URL shapes or that IP exist
anywhere in CWP's code - they are the attacker's, not ours.

The official packages and infrastructure are clean. For EL10 the genuine package binary is:
  cwpsrv-1.30.6-1.el10   SHA256 31a59668bd91b3bbb6078887b480416bbe77e7b56be243c43edc5e7c758b7e74   (4,619,408 B)
which is exactly the "before" hash in your log. The trojan you captured is:
  trojaned cwpsrv        SHA256 702f9c12b8b4f999739201659e38f381f9d83a6b160d4215fd5de4085ad7bbb1   (4,767,232 B)
Every repo node and the origin serve the genuine binary, so the malicious file is not in our
distribution - it was introduced on the wire to specific victims.


2) ROOT CAUSE: A PLAINTEXT-HTTP, RUN-AS-ROOT STEP IN THE UPDATE CHAIN
--------------------------------------------------------------------
You traced the chain correctly (fetch the autoupdater, run it, delete it). One clarification on the
transport, because it is the whole point:

cron.php fetches the autoupdate *payload* over HTTPS with certificate verification - that part was
always fine. But that payload then fetched the per-distro autoupdater and ran it AS ROOT, and that
inner fetch used plain HTTP with no signature check. The strace you ran on 2026-11-21 shows HTTPS
because you captured the current (already fixed) build; at infection time (2026-11-08) that inner
fetch was plaintext http (confirmed: HTTP 200 over http, no redirect, no signature). A plaintext
step that executes as root can be tampered with in transit by anyone on the network path - a
hijacked route, a rogue resolver, or an on-path device - and the forged autoupdater is what pulled
the trojan from 136.0.141.71. This needs no local compromise, which is why your server shows no
stager, no new keys, and a clean Ebury scan.

So your conclusion ("it arrived through the update channel") is right; the one correction is that
transport tampering is not "unlikely" - at the time it was the mechanism, because that one step
was not yet HTTPS.


3) THE FIX IS ALREADY SHIPPED (your requests 3 and 5)
-----------------------------------------------------
This was treated as top-priority supply-chain hardening and is now live:
  - Every update/download step is HTTPS with certificate verification, including the inner
    autoupdater fetch; the update host redirects http->https and sends HSTS.
  - The CWP packages are GPG-signed and the repositories now ship with gpgcheck=1, so yum/dnf
    verify every RPM's signature before installing it.
Updating to the current build is what puts these protections on your server - please update once
the box is cleaned (see section 6). A signature that is verified before anything runs, plus
gpgcheck, closes both the transport and the package paths.


4) DETECTION - your hash is now in the Security Audit (your request 4)
---------------------------------------------------------------------
We have added the trojan hash 702f9c12... to the known-bad panel-binary list in cwp_security_audit,
next to the EL8 variant. A server carrying this binary is now flagged as a confirmed compromise
regardless of rpm-database tampering. As you noted, this variant has no X-Ngx-Integrity strings and
is a renamed build, so the authoritative check remains comparing the on-disk binary to the official
package (commands in section 6), not string matching.


5) ON THE UPDATE ENDPOINT (your requests 1 and 2)
-------------------------------------------------
  - The update endpoint is a server-side script, so it technically can return different content to
    different clients; because our origin and all repo nodes were verified clean, the per-victim
    malicious content was introduced in transit, not by the origin. With the whole chain now HTTPS
    + signature-verified, that in-transit substitution no longer works.
  - Yes, this is the same incident as #846866. There is no indication of a fleet-wide distribution
    compromise - the reports are consistent with on-path interception of individual servers, which
    the HTTPS + signing changes close.


6) REMEDIATION (please treat the box as root-compromised)
---------------------------------------------------------
Because a forged script ran as root, a clean reinstall of cwpsrv is necessary but not sufficient:
  - Confirm the binary against the official package (authoritative, any EL version):
        cd /tmp && mkdir -p cwpv && cd cwpv
        yumdownloader cwpsrv 2>/dev/null || curl -O "https://repo.centos-webpanel.com/repo/$(rpm -E %rhel)/x86_64/$(rpm -q cwpsrv).rpm"
        rpm2cpio cwpsrv-*.rpm | cpio -idmv ./usr/local/cwpsrv/bin/cwpsrv
        sha256sum ./usr/local/cwpsrv/bin/cwpsrv /usr/local/cwpsrv/bin/cwpsrv   # the two must be equal
  - Since it was altered (you saw 702f9c12...), because it ran as root:
        * preserve the malicious binary and /root/.bash_history for analysis (yes please, our
          security team will take the sample privately),
        * block 136.0.141.71 at the firewall (csf -d 136.0.141.71) - done on your side already,
        * restore: yum reinstall -y cwpsrv && systemctl restart cwpsrv, then re-check the hash,
        * rotate ALL credentials (root, every SSH key, panel/user/reseller/MySQL/API, mail),
        * audit authorized_keys, all crontabs, /etc/systemd/system, /etc/ld.so.preload, docroot .php,
        * for full trust, a clean reinstall + data restore is the only guarantee on a root-compromised host.
  - Then update CWP so the box runs the hardened (HTTPS + signed-package) chain.

Indicators of compromise (EL10):
  - IP 136.0.141.71  (CWPdoor download/callback host - block at firewall)
  - download URL  http://136.0.141.71/static/cwpsrv_1.30.6_almalinux10.2 ; callback /update?v=
  - trojan cwpsrv SHA256 702f9c12b8b4f999739201659e38f381f9d83a6b160d4215fd5de4085ad7bbb1 (4,767,232 B)
  - genuine cwpsrv-1.30.6-1.el10 SHA256 31a59668bd91b3bbb6078887b480416bbe77e7b56be243c43edc5e7c758b7e74 (4,619,408 B)
  - trojan-only strings: ngx_http_log_digest_aes_encrypt/_decrypt, ngx_http_log_digest_helper_run/_pid

Thank you again - this is the kind of report that makes the product safer for everyone. Please do
share the binary with us privately.